[osg-users] Absolutely dark scene

Richard Baron Penman richardbp+osg at gmail.com
Mon Mar 23 21:02:19 PDT 2009


I was wondering about that - thanks for the tip,
Richard


On Wed, Mar 18, 2009 at 3:04 AM, Fernan <osgforum at tevs.eu> wrote:

> Hi Robert,
>
> Thank you for your help.
> I've achieved my purpose.
>
> Following your instructions I realized that my problems were two:
>
> 1) On the one hand, the scene by default sets the AmbientIntensity as
> follows:
>
>        osg::LightModel* lightmodel = new osg::LightModel;
>        lightmodel->setAmbientIntensity(osg::Vec4(0.1f,0.1f,0.1f,1.0f));
>        _globalStateSet->setAttributeAndModes(lightmodel,
> osg::StateAttribute::ON);
>
> And due this the scene was always a little light.
> Then I set this value to zero in my application after create the scene:
>
>        osg::LightModel* lightmodel = new osg::LightModel;
>        lightmodel->setAmbientIntensity(osg::Vec4(0.0f,0.0f,0.0f,1.0f));
>        _globalStateSet->setAttributeAndModes(lightmodel,
> osg::StateAttribute::ON);
>
> And I got all the elements of the scene appear dark unless sea.
>
> 2) On the other, I realized that I was applying to the sea surface an
> OSG::Material with Emission value set to nonzero. Once I set the zero value
> to this parameter, all to be completely dark in my scene.
>
> ------
>
> I leave here my solution in order to it can help someone with same problem.
>
> Thanks a lot again for your help.
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=8627#8627
>
>
>
>
>
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20090324/78d9e61d/attachment-0003.htm>


More information about the osg-users mailing list