Re: [osg-users] Shadows, clouds...
Hi, Thank you for your pieces of advices Jean-Sébastian, but how coud I make it if the variable that makes cloud effect is an Environment variable and this variable is the father of the terrain? Thank you again, and sorry for my silly questions... Cheers, Jose -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=30375#30375 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Shadows, clouds...
Hi Jose, Thank you for your pieces of advices Jean-Sébastian, but how coud I make it if the variable that makes cloud effect is an Environment variable and this variable is the father of the terrain? I don't quite get what you're saying about environment variables... You can structure your graph in any way you want. But if your clouds are under the ShadowedScene, they will be affected by shadows. You can set a null osg::Program or put a different shader on your clouds to prevent this (the first suggestion in my previous message) or you can move your clouds to not be under your ShadowedScene (the second suggestion). The clouds cannot be a parent of the terrain, because they're both geometry, therefore both leaf nodes. Please look at your scene graph structure again and figure out how to make it work (writing your whole scene to a .osg file is useful in cases like this, use osgDB::writeNodeFile(*sceneRoot, filename.osg); ). Hope this helps, J-S -- __ Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com http://www.cm-labs.com/ http://whitestar02.webhop.org/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Shadows, clouds...
Hi, When I use shadowedscene with shadowmap and clouds, clouds are a little black! How can I delete this effect? Thank you!!! Cheers, Jose -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=30325#30325 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Shadows, clouds...
Hi Jose, When I use shadowedscene with shadowmap and clouds, clouds are a little black! How can I delete this effect? Please search the archives in the future, this is a frequently asked question. There are two ways to make it so that shadows are not applied to the clouds: 1. Customize the shader applied to them so it doesn't do the shadow test (or remove the shader altogether). If you don't put a shader on that object, it inherits the one from higher in the graph (probably the one ShadowMap uses). See src/osgShadow/ShadowMap.cpp in the OSG source code. If you just want to remove this shader, you can do: node-getOrCreateStateSet()-setAttributeAndModes( new osg::Program, osg::StateAttribute::OFF); because a program with no shaders means the fixed pipeline. 2. Put your objects outside the shadowed scene. I.e. have a root osg::Group which has as children the osgShadow::ShadowedScene, and put your clouds under that root and not under the shadowed scene. root /\ shadowedSceneother non-shadowed objects | shadowed objects Hope this helps, J-S -- __ Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com http://www.cm-labs.com/ http://whitestar02.webhop.org/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org