Shadow mapping, cull face and depth precision

Hi,

I read that for a depth precision issue we use cull face during shadow mapping. Unfortunately, I have a scenario where objects must be rendered double sided… Making cull facing impossible and the depth precision issue appearing…

First… from where this precision issue come from? I actually don’t see the issue. Then, is there any way to use shadow mapping for double sided objects?

Where did you read this?

N.

http://www.paulsprojects.net/tutorials/smt/smt.html

Here :slight_smile:

Ah, I see. This theory only applies fully when your objects are ‘closed’ meshes and have a thickness that is non-zero. My best guess is to use polygon offset in your case.

N.

Thank, I will try this!
However I still miss the point of the none zero thickness.

This is what happens when you draw the back facing polygons in your lights depth map:

for non-zero thickness


             ________         ________
             |       |        |       |
  L -------- | ----- | ------ | ----- |------> Ray
             |_______|        |_______|
light        1       2        3       4
origin


Depth of 2 (back face) gets rendered into depth map.
Comparisons:
1-depthmap: lit - accurate
2-depthmap: shadowed - inaccurate but shadowed anyway because normal faces away from light
3-depthmap: shadowed - accurate
4-depthmap: shadowed - accurate and shadowed anyway because normal faces away from light

for zero thickness


                     ________
             |       |       |
  L -------- | ----- | ----- |------> Ray
             |       |_______|
light        1+2     3       4
origin


Depth of 2 (back face) gets rendered into depth map.
Comparisons:
1-depthmap: lit/shadowed - inaccurate!!
2-depthmap: shadowed - inaccurate but shadowed anyway because normal faces away from light
3-depthmap: shadowed - accurate
4-depthmap: shadowed - accurate and shadowed anyway because normal faces away from light

N.