Cristina,

Do you have a code snippet you can provide us?

The following works for our case for each camera in the scene. We are using
the compositeViewer where each view added to the viewer has its own camera.

fog = new osg::Fog();
fog->setMode(osg::Fog::EXP2);
fog->setFogCoordinateSource(osg::Fog::FRAGMENT_DEPTH);
fog->setColor(fogcolor);
view->getCamera()->getOrCreateStateSet()->setAttributeAndModes(fog,
osg::StateAttribute::ON);

You should be able to set a different fog state for each camera in turn...

-Shayne

-----Original Message-----
From: osg-users-boun...@lists.openscenegraph.org
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Cristina
Paponi
Sent: Monday, June 01, 2009 12:22 PM
To: osg-users@lists.openscenegraph.org
Subject: [osg-users] Set fog in the canera StateSet

Hi,

Could you please help me with the following problem. In my scene I have 2
cameras one for day and one for thermo.
Because the fog will appear different in day and thermo, I tried to assign
the fog to the camera's StateSet.
When I try to set the fog attribute to the camera StateSet there is no
effect, but if I set the fog to the root of the scene's StateSet everything
is fine.
Is it possible to set the fog in the camera ?

Thank you!

Cheers,
Cristina

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=13293#13293





_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to