[osg-users] osg::View NO_LIGHT bug?

Robert Osfield robert.osfield at gmail.com
Mon Jun 6 00:34:12 PDT 2016


HI Nickolai,

If you don't want the default global light then simple do:


   viewer.setLightingMode(osg::Viewer::NO_LIGHT);


Rather than switching it to SKY_LIGHT!

Robert.




On 5 June 2016 at 22:44, Nickolai Medvedev <raizel.dev at yandex.ru> wrote:
> Well, we can deceive viewer if we make so:
>
>
> Code:
> viewer.getLight()->setAmbient(osg::Vec4(0.0,0.0,0.0,1.0));
> viewer.getLight()->setPosition(osg::Vec4(0.0,0.0,0.0,1.0));
> viewer.getLight()->setDiffuse(osg::Vec4(0.0,0.0,0.0,1.0));
> viewer.getLight()->setConstantAttenuation(0.003);
> viewer.getLight()->setLinearAttenuation(0.1);
> viewer.getLight()->setQuadraticAttenuation(0.1);
> viewer.getLight()->setName("global_light");
> viewer.getLight()->setLightNum(0);
>
> viewer.setLightingMode(osg::View::SKY_LIGHT);
>
>
>
> The light source still be exist, but will be invisible.
>
> Cheers,
> Nickolai
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=67426#67426
>
>
>
>
>
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org



More information about the osg-users mailing list