After calling Viewer::realize() in your main(), you'll have a current
context and can glGetIntegerv( GL_MAX_LIGHTS ). (At least, this is true of
SingleThreaded mode, not sure about the other threading models.)

Eight is typical. It's limited by hardware.

That's the fixed function pipe; If you're using shaders, obviously you can
have as many lights as you want.

Each light is enabled using an OSG state mode, analogous to the OpenGL
enable/disable:
  StateSet::setMode( GL_LIGHT0, StateAttribute::ON );
  StateSet::setMode( GL_LIGHT1, StateAttribute::ON );
  StateSet::setMode( GL_LIGHT2, StateAttribute::ON );
  // etc...

(Not trying to start a flamewar about documentation, but this is covered in
the Quick Start Guide.)

Hope that helps,

Paul Martz
Skew Matrix Software LLC
http://www.skew-matrix.com
303 859 9466



> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf 
> Of Dave Pugmire
> Sent: Thursday, August 23, 2007 2:51 PM
> To: [email protected]
> Subject: [osg-users] Light sources
> 
> Hi,
> How many are allowed? I'm having trouble getting multiple 
> lights. One seems to work fine, but not 2 or 3. Does 
> something need to be enabled?
> 
> Thanks,
> Dave
> 
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-opensce
negraph.org

_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to