[osg-users] Render to texture and Shadows

Tugkan Calapoglu tugkan at vires.com
Tue Nov 3 00:10:28 PST 2009


Hi All,

I am using Light Space Perspective Shadow Maps for shadowing. I would
like to render the shadowed scene to a texture, so I have another camera
on top of the shadowed scene. It looks like following:

root
 |
RTTCamera
 |
ShadowedScene

I also render a small sized screen aligned quad which visualizes the
texture to which RTTCamera is rendering.

When there is no RTT, shadows work as expected. However, when I am
rendering onto the texture, there are no shadows. I can see the scene on
the screen aligned quad but it simply has no shadows.

When I debugged the application I found out that
StandardShadowMap::ViewData::selectLight does not find the light.
Following line should normally give a list of matrices/attrib pairs

rs->getPositionalStateContainer()->getAttrMatrixList();

however, it returns an empty list. I am not familiar with the
implementation of Shadows in OSG so I got stuck here. Does anybody have
an idea?

Thanks,
Tugkan


More information about the osg-users mailing list