Does anyone knows where to find glsl shaders that realize shadow mapping^

Like in subject…does anyone knows where to find informations on shadow mapping and glsl?
Thank you

I have written about it here and on gamedev before… so let’s do it again. ;]

Set up things like you would for fixed-function shadow-mapping.
Create the depth-texture, change the texture-matrix with the bias etc…

Then in my vertex program I do:

varying vec4 ProjShadow;

ProjShadow = gl_TextureMatrix[1] * gl_Vertex;

And then in the fragment part:

varying vec4 ProjShadow;
uniform sampler2DShadow ShadowMap;

color *= shadow2DProj(ShadowMap, ProjShadow).r;

And that’s all there is to it.

Good luck!

thank you for the answer but i’ve tried without results, if it’s not disturbing can you send me an example application or a place where download it?
(i cannot post my code because i’m working on a scripting language mapped on opengl)
Thank you very much

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