PDA

View Full Version : Strange Zbuffer moiree



resle
06-21-2010, 01:49 AM
This is a dump of depth values as generated from the "render scene to a FBO from the light's point of view" pass of classic shadowmapping

http://www.lalista.org/pay/debug_zbuffer.jpg

What's going on here in your opinion? Looks like some Z-fight but nothing is rendered twice, why should a mesh z-fight againist itself?

skynet
06-21-2010, 02:15 AM
This is to be expected. You interpret a single 24 bit integer (the depth buffer value) color as 8/8/8bit RGB color.

resle
06-21-2010, 04:36 AM
Right, then there must be something wrong in the way the DEPTH_COMPONENT texture is interpreted thereafter when it's used for the 2nd pass, the shadowing one, because the exact moiree pattern that's seen in the picture resurfaces as z-fighting!

(http://www.lalista.org/pay/happy_artifacts.avi - 3.2 mb)

skynet
06-21-2010, 05:40 AM
Are you talking about the artifacs on the back of the bear? This is a known artifact in conjuction with shadow mapping, I think it is called "shadow acne" and is usually fixed by biasing the shadowmap depth values by a certain amount.

Dark Photon
06-21-2010, 06:43 PM
Right, then there must be something wrong in the way the DEPTH_COMPONENT texture is interpreted thereafter when it's used for the 2nd pass, the shadowing one, because the exact moiree pattern that's seen in the picture resurfaces as z-fighting!

(http://www.lalista.org/pay/happy_artifacts.avi - 3.2 mb)
See pg. 36 here (http://ati.amd.com/developer/gdc/2006/Isidoro-ShadowMapping.pdf) (Shadow Mapping - Isidoro, GDC06), and for a better example of this shadow acne, see pg 6. here (ftp://download.nvidia.com/developer/presentations/2004/GPU_Jackpot/Shadow_Mapping.pdf) (Shadow Mapping, King, GPU Jackpot '04).