[osg-users] Lighting behavior and osgViewer::osgViewer

Paul Martz pmartz at skew-matrix.com
Wed Sep 12 09:33:41 PDT 2007

- How can I deactivate the lighting set by default by the osgViewer ? 

The fact that osgViewer/SceneView set up default lighting does seem to
confuse many users, as your posting demonstrates. However, lighting state is
really no different from any other state. You can control it in your own
scene graph using standard OSG setMode, setAttribute, and
setAttributeAndModes calls.
StateSet::setMode( GL_LIGHTING, OFF ); // Disable the OpenGL lighting
StateSet::setMode( GL_LIGHT_0, OFF ); // Disable OpenGL light 0
The above two calls disable the two features enabled in osgViewer/SceneView
by default.
If you want to leave lighting and light 0 enabled and simply control the
light's attribute (position, color, etc) then you should use osg::Light and
the osg::LightSource node as demonstrated in the osglighting example
Hope that helps,
Paul Martz
Skew Matrix Software LLC
http://www.skew-matrix.com <http://www.skew-matrix.com/> 
303 859 9466
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20070912/ac4673f7/attachment-0003.htm>

More information about the osg-users mailing list