View Full Version : Does anyone knows where to find glsl shaders that realize shadow mapping^

03-09-2005, 01:04 AM
Like in subject...does anyone knows where to find informations on shadow mapping and glsl?
Thank you

03-09-2005, 01:43 AM
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!

03-09-2005, 07:05 AM
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