2 Nov 2007 15:36
Re: [Algorithms] Second layer shadow mapping to avoid acne?
Joris Mans <joris.mans <at> 10tacle.be>
2007-11-02 14:36:49 GMT
2007-11-02 14:36:49 GMT
Front face culling does allow self-shadowing. It
breaks down when your objects arent "closed" dough (there is some nice term to
describe this property, but i m not so good at computational-geometry-bingo so
i'll leave that one to the specialists ;) ).
We use this, combined with some small bias, and
some extra geometry inside objects to fix some leak cases.
But the generale rule with shadows is: whatever
system you take, there are always cases where it breaks down.
Joris
----- Original Message -----From: Eric HainesSent: Friday, November 02, 2007 3:23 PMSubject: [Algorithms] Second layer shadow mapping to avoid acne?So a classic problem with shadow mapping is self-shadowing, "surface acne", where the receiver shadows itself. There are various fixed and plane gradient biases that can be set to avoid the problem, though nothing's foolproof.
One old trick (Wang & Molnar 1994, though I'd seen it before then) is to simply do frontface culling when making the shadow map. Now the receiver is (usually) nowhere near the depth of the occluder and self-shadowing is avoided.
My question: is this what game developers using shadow maps usually do? I was talking with someone at NVIDIA and he maintains most do so. Also, are there any fatal flaws I'm missing? (see list below)
I was a little surprised that backface culling would be the norm, as this method has its own problems:
1) double-sided objects: the backface == the frontface, so the surface acne problem is back. This happens for things like palm fronds or other cutout textures. I'd solve it by simply offsetting the fronds a fair bit when written into the shadow map (more than solid objects).
2) thin objects: similar problem.
3) near silhouette edges: again with the acne. All these could be helped by traditional biasing techniques, but then that makes the next problem worse:
4) light leaks at point of contact: a cube is on a plane, you're looking at an edge on the plane in shadow. Light leaks through the cube (since the backfaces are very close to the plane) and there's a streak of random light blobs on the plane where the cube is. My NVIDIA contact says "move the cube off the plane, no one will notice". Fair enough - a little Peter Panning, but otherwise OK.
5) if objects interpenetrate you'll get the same light leaking at the points of contact. Solution: don't let objects interpenetrate for any appreciable amount of time.
Really, none of these problem are insurmountable, and so "draw the backfaces" does seem like a pretty good solution overall as it avoids self-shadowing headaches 95% of the time by default.
Comments? I'm writing about this in "Real-Time Rendering" and would like to get "best practices" across.
Eric-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/_______________________________________________
GDAlgorithms-list mailing list
GDAlgorithms-list <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list
Archives:
http://sourceforge.net/mailarchive/forum.php?forum_name=gdalgorithms-list
------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________ GDAlgorithms-list mailing list GDAlgorithms-list <at> lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list Archives: http://sourceforge.net/mailarchive/forum.php?forum_name=gdalgorithms-list
RSS Feed