sampler2DShadow & deferred shading

i’ve just switched to deferred shading, but shadow mapping doesn’t work anymore. sampler2DShadow() needs the fragment’s depth to compare the shadow map’s depth value with, right? argh!

what can i do? would it help to get the depth somehow and write it to gl_FragDepth before the shadow map comparison?

thanks!

You didn’t have to pass the fragments depth to sampler2DShadow(). Recalculate the WorldView Position and project it into the lightspace. Pass the Lightspace position to sampler2DShadow() to get a correct shadow…

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.