Hi J-S,

Scenario you described is quite common. My collegue had similar problem recently while mixing shadows with soem animation techniques. He was trying to come up with similar identification scheme.

Simplest method I can think of: is modification of osgShadow:: LisPSM techniques and related to give well defined unique names to rtt cameras they create. Its maybe not particularly bright idea but its simple and effective.

I think names like "osgShadow_StandardShadowMapCamera" and "osg_MinimalDrawBoundsAnalisisCamera" could do the trick...

Cheers,
Wojtek



----- Original Message ----- From: "Jean-Sébastien Guay" <[email protected]>
To: "OpenSceneGraph Users" <[email protected]>
Sent: Thursday, July 09, 2009 10:51 PM
Subject: [osg-users] Integrating shadows with osgOcean


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

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

Reply via email to