[osg-users] problem with osgFX::SpecularHighlights

Jean-Sébastien Guay jean-sebastien.guay at cm-labs.com
Sun Apr 17 05:50:44 PDT 2011


Hello Lv,

> when shl->setLightNumber(8)
>
> it prints "
>
> Warning: detected OpenGL error 'invalid enumerant' at after RenderBin::draw(..) "
>
> when set Light Numbe below 8 ,it is OK.

The OpenGL fixed pipeline supports up to 8 lights, indices 0 to 7 
(enumerants GL_LIGHT0 to GL_LIGHT7). So index 8 is out of bounds. The 
error is because GL_LIGHT8 doesn't exist.

If you want to use more than 8 lights, you have to write your own 
shaders, and you can't use fixed pipeline techniques.

Hope this helps,

J-S
-- 
______________________________________________________
Jean-Sebastien Guay    jean-sebastien.guay at cm-labs.com
                                http://www.cm-labs.com/
                     http://whitestar02.dyndns-web.com/



More information about the osg-users mailing list