Re: [osg-users] Set fog in the canera StateSet

2009-06-04 Thread Cristina Paponi
Hi,
Shayne
My code is more or less like yours, but I'm not using the Composite viewer. I'm 
not sure why it doesn't work.

Hi Wojtek Lewandowski
Your solution worked for me too.

Thank you both for your time!

Cheers,
Cristina

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





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


Re: [osg-users] Set fog in the canera StateSet

2009-06-02 Thread Wojciech Lewandowski

Hi Cristina,

Take it with the grain of salt, as I am not completely sure if this is 
similar problem, but we saw a cases where some StateAttributes set in graph 
nested cameras did not work. Usually solution was adding a group to the 
camera and setup the stateset and scene there. Can you check if this works 
for you ?


If I recall correctly I did small research and noticed that stateset in the 
camera are applied before camera is switched to its rendering surface. I 
don't exactly understand why this could cause problems but the method 
described above was usually avoiding the trouble.


Cheers,
Wojtek Lewandowski

- Original Message - 
From: Tueller,Shayne R Civ USAF AFMC 519 SMXS/MXDEC 
shayne.tuel...@hill.af.mil

To: osg-users@lists.openscenegraph.org
Sent: Monday, June 01, 2009 10:31 PM
Subject: Re: [osg-users] Set fog in the canera StateSet



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



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


[osg-users] Set fog in the canera StateSet

2009-06-01 Thread Cristina Paponi
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


Re: [osg-users] Set fog in the canera StateSet

2009-06-01 Thread Tueller, Shayne R Civ USAF AFMC 519 SMXS/MXDEC
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


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