Hi all,

I'm currently trying to integrate osgOcean into our application and I'm having trouble combining it with shadows. We're using osgShadow::LightSpacePerspectiveShadowMap (and derivatives). The problem seems to be that they both do additional RTT passes, and they seem to interfere with each other.

I've placed the OceanScene under the ShadowedScene. I'd like to know, in OceanScene::traverse(), whether the current traversal is the shadow pass, and if so, don't do any reflections or refractions (because that would be quite wasteful). The only way I've thought of is doing:

    if (cv->getCurrentCamera()->isRenderToTextureCamera())
    {
        // Shadow pass, don't do reflections etc.
        osg::Group::traverse(nv);
    }
    else
    {
        // Do the rest as normal.
    }

That works, but it strikes me as a blanket check - there may be RTT passes where we'll want to have reflections/refractions (i.e. which are not just depth buffer passes)...

I wonder if someone would have any suggestion for a better test that would be able to detect the shadow pass only...

Thanks in advance,

J-S
--
______________________________________________________
Jean-Sebastien Guay    [email protected]
                               http://www.cm-labs.com/
                        http://whitestar02.webhop.org/

_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to