Shadowtextures and fragmentprogram.

Does anyone have a simple explanation of what i should compare with the depthmap… i have everything in the right places, but i need to compare the textures depthvalue with something ( just in the ARB_shadow extension) but i just cant figure out what…

The depth value of the fragment the texture has been projected onto.

I also thought that, but that I cant get to work. And on a second thought, if I set the near/far planes different from the light and from the eye the values shouldn’t line up, and as far as i know its not required to have them at the exact same distance

You must compare r/q (that is, z/w) with the value in the shadow-map. If the shadow-map value is equal or greater, you have light, else you are in shadow.

If needed, you must implement linear filtering for yourself. So you have to sample the shadow-map several time to get the same quality as when using the ARB_shadow extension. It’s a shame that the specialized hardware support on the GeForceFX is wasted when implementing depth-map shadows based on fragment-programs.

but it should be re-implemented in GLSlang i guess, since it has a special texture fetch for shadowtextures.