Hello Jean-Sébastien, Thank-you for your answer.
Jean-Sébastien Guay wrote on Monday 05 May 2008: > > There is osgShadow, but it's rather short on examples. > > Or may-be I haven't seen them ? > > The example is called osgshadow... ;-) osgshadow --st -2 is probably my friend: it's an aircraft that makes it's shadow over a terrain !!! And it works. While --sm, --sv, --pssm and --ssm don't (on my setup : Linux OpenSuSE 10.3, with ATI card). Thanks again, I'll try. Cheers Zoltán > In short, it's pretty simple: > > 1. Your root node (or the root node of the subgraph which > you want to have shadows) should be an > osgShadow::ShadowedScene (subclass of osg::Group). > > 2. Instantiate the shadow technique you want (for example > osgShadow::ShadowMap) and set it as the shadow technique > on your shadowed scene (scene->setShadowTechnique(...)). > > > In your case, for an airplane flying over a large > terrain, if you use osgShadow::ShadowMap you will have > lots of shadow map aliasing. For now, ShadowMap is not > view dependent, so it uses the scene bounds (or the light > frustum for a spot light), which will be very large in > your case. As a first step, you could disable shadows for > everything but your airplane (for example, > shadowedScene->setCastsShadowTraversalMask(0x01) and then > give all your objects but your airplane a ~0x01 node > mask). Perhaps others will have better suggestions. > > Keep in mind that osgShadow::ShadowVolume does not really > work yet (at least I haven't seen it work, maybe it does > in some cases). So I would use ShadowMap with the > workaround above. > > Hope this helps, > > J-S -- ________________________ Zoltan ________________________ _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

