I still don't know why osg::View::NO_LIGHT doesn't work, but to answer my own
questions, to turn off the default light completely:
_viewer->getCamera()->getView()->setLightingMode(osg::View::HEADLIGHT);
osg::Light* light = _viewer->getCamera()->getView()->getLight();
if (light != NULL)
{
light->setAmbient(osg::Vec4(0,0,0,1));
light->setDiffuse(osg::Vec4(0,0,0,1));
light->setSpecular(osg::Vec4(0,0,0,1));
}
-Ben
________________________________
From: [email protected]
[mailto:[email protected]] On Behalf Of Ben Axelrod
Sent: Tuesday, February 17, 2009 11:36 AM
To: [email protected]
Subject: [osg-users] osg::View NO_LIGHT bug?
I cannot seem to turn off the light in osg::View. I can change it between
headlight and sky light, but when I try NO_LIGHT, I still get the headlight.
_viewer->getCamera()->getView()->setLightingMode(osg::View::SKY_LIGHT); //works
_viewer->getCamera()->getView()->setLightingMode(osg::View::HEADLIGHT); //works
_viewer->getCamera()->getView()->setLightingMode(osg::View::NO_LIGHT); //still
get headlight
How can I turn off this default light? How is it related to the osg::Lights in
the scene? I noticed when I add an osg::Light, then the headlight is
overridden. How can I change the light parameters of the SKY_LIGHT or
HEADLIGHT?
I am using osg version 2.6.
Thanks,
-Ben
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org