Hi,

In your current implementation you store your fragment positions in world space 
and use them for lighting in the final fragment shader.
If you pass a matrix uniform to this pass, that translates from world space to 
screen space of the light pass, you can calculate your shadow texcoords.
So you only need to calculate: "vec4 shadowTexCoord = 
shadowViewProjectionMatrix * p_worldposition;" in your final fragment shader. 
You can use this to fetch from your depth texture and compare the depths.

Thank you!

Cheers,
Marcel

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=56761#56761





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

Reply via email to