Shadow Mapping [help needed]

Hi all,

I hit a brick wall. I did some work on CG shaders and Panda3D and practically did it all (HDR, parallax mapping, phong, Blinn, normalmapping, etc.) But when it comes to CG shadows I really can’t seem to get it. Could someone please describe the process and the different parameters involved? I examined the shadow mapping sample by Bei Yang, but I just can’t figure it out. I also read a .lot. about shadow techniques, but to no avail.


So, how is it going ?
Any screenshots ?

What kind of shadow mapping techniques have you tried ?
Finally I’m curious about this and I’ve tried the easiest technique, i.e. the regular shadow map. Besides, the other techniques must be alot more expensive for my GFFX5200. I’ve been able to achieve the depth map from the light’s POV, and stuck there.
Even this depth map stuff is still foggy for me. It’s about the bit depth (bit per texel). We can set the component width to unsigned byte/short, float, what it is actually used for ? If it is for increasing the richness/distance of the depth map, why can’t I see any changes on the depth map ?

All I know about regular shadow map is this :

  1. generate the depth map from both cameras, i.e. the light’s and the eye’s
  2. compare them !
  3. project the result to the scene.

The step 2 is the foggy part for me. So far I read that this can be done using the register combiners. First, we must apply the polygon offset or bias to avoid the self-shadowing artifacts, and then set the comparison mode to LEQUAL and call the glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_COMPARE_MODE_ARB,GL_COMPARE_R_TO_TEXTURE_ARB).
The step 3 will be done using the tex2Dproj().

Here are my depth maps (using disco hall and some objects, with the light reparented to the eyecam for debugging purpose) :
Larger image Larger image

Larger image Larger image

Larger image

Is there anything wrong ? Please let me know. Thanks.

could you mail me this shader you’re using? my email is :

thanks in advance,


Hey, I haven’t got into the shader correctly. Those screenshots are just for showing the depth map, without any shader applied. In fact I copied the vshader from nVIDIA with some adjustments. The fshader is still in blackout. Believe me it’s totally messy.
I need to read a LOT more references to get it work. :confused:

Did u receive my mail?


could you make please any tutorial on how to use shaders and shadows? would be really nice!

cos i don’t understand how it works :frowning: :bulb:

Cheer up !