1 / 24

Anti-aliasing and Continuity using Trapezoidal Shadow Maps

Anti-aliasing and Continuity using Trapezoidal Shadow Maps. Speaker: Tobias Martin Co-Author: Tiow-Seng Tan National University of Singapore. Standard Shadow Maps. Content. Shadows in Computer Graphics Standard Shadow Maps (SSM) Problems with SSM Problem #1: Aliasing/Resolution

brittney
Download Presentation

Anti-aliasing and Continuity using Trapezoidal Shadow Maps

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Anti-aliasing and ContinuityusingTrapezoidal Shadow Maps Speaker: Tobias Martin Co-Author: Tiow-Seng Tan National University of Singapore Standard Shadow Maps

  2. Content • Shadows in Computer Graphics • Standard Shadow Maps (SSM) • Problems with SSM • Problem #1: Aliasing/Resolution • Problem #2: Polygon Offset • Problem #3: Continuity • Trapezoidal Shadow Maps • Conclusion

  3. Shadows in Computer Graphics • Why? • Spatial relationship between objects is better perceivable • Realism is enhanced • Our Requirements: • Robust shadows in real-time (Screenshots taken from “shadowcast.exe” by Mark J. Kilgard, NVIDIA)

  4. Standard Shadow Maps (SSM) 1. Shadow Map Generation: • Transform scene into post-perspective space (PPS) of light, i.e.:vL = PL · CL· W · v • Render scene from this space • Copy depth buffer into shadow map 2. Shadow Determination: • Render scene in eye’s PPS and perform shadow test per-fragment • Fragment is in shadow iff zp > shadowmap[xp, yp], where xp,yp and zp is fragment in PPS of light (Screenshots taken from “shadowcast.exe” by Mark J. Kilgard, NVIDIA)

  5. Standard Shadow Maps (SSM) • Problem #1:Resolution ProblemJagged shadow boundary appears due to low resolution in shadow map  Trivial solution:Increase shadow map size to increase resolution & improve quality

  6. Standard Shadow Maps (SSM) • Problem #2:Polygon OffsetDue to finite precision, surfaces can cast wrong shadows on themselves Practical Solution: Adding offset to depth values to move shadow slightly away from light

  7. Current Solutions • Problem #3: Continuity (1) • Straightforward approximation can result in shadow discontinuities e.g. in Perspective Shadow Maps (PSM)[Stamminger and Drettakis 2002] e.g. in the Bounding Box Approximation (BB) [Brabec et al. 2002] Frame i +1 Frame i

  8. Current Solutions • Problem #3: Continuity (2) • What happens if shadow map depends on dynamic scene geometry? light light scene’s bounding box eye eye scene’s bounding box n frames later ”expanded” hull contains shadow occluders shadow map quality worsened ”tight” hull contains shadow occluders good shadow map quality

  9. Trapezoidal Shadow Maps (TSM) • Solution to Problem #1 (Resolution) • Shadow map generation focuses on area potentially visible to the eye • Solution to Problem #2 (Polygon Offset) • Depth values are preserved, so that problem is not worsened • Solution to Problem #3 (Continuity) • Frame coherent technique resulting in a continuous change in shadow map resolution

  10. Trapezoidal Shadow Maps (TSM) PPSof light NT A trapezoidal space Shadow map resolution is increased Shadow aliasing is reduced

  11. Trapezoidal Shadow Maps (TSM) • Solution to Problem #1 • SSM algorithm is slightly modified: • Calculate shadow map in the trapezoidal space, and perform the shadow test there as well, i.e.:vT = NT· PL· CL· W · v Except for the calculation of NT the algorithm can completely be mapped to graphics hardware!

  12. Trapezoidal Shadow Maps (TSM) • Side effect of the trapezoidal transformation a) Approximation of an eye's frustum with a trapezoid b) Applying NTmay lead to severe polygon offset problems  Different distribution of z-values require different offsets (a) (b) Non-uniform distribution Uniform distribution

  13. Trapezoidal Shadow Maps (TSM) Solution to (worsened) Problem #2: • Apply NT only to the x- and y-values • Maintain z in PPS of light:  Store (xT , yT , zL) in the shadow map Applying modifiedNT Simply applyingNT

  14. Trapezoidal Shadow Maps (TSM) • 1st pass (Shadow Map Generation) • Vertex stage: • vT = NT· PL· CL· W · v • vL = PL· CL· W · v • Fragment stage: • shadowmap[xT, yT]= zL instead of zT Use additional texture coordinate vL and replace zT with zL per fragment

  15. Trapezoidal Shadow Maps (TSM) • 2nd pass (Shadow Determination) • Vertex stage: • vE = PE· CE· W · v • vT = NT· PL· CL· W · v • vL = PL· CL· W · v • Fragment stage: • Fragment in shadow iff zL > shadowmap[xT, yT]  Use additional texture coordinate vL and use zL for shadow map comparison

  16. Trapezoidal Shadow Maps (TSM) Solution to Problem #3 • Base and Top Lines: Center Line 2D-Convex Hull Base & Top Line l lt lb CHE • Center line governs the choices of top and base line top and base line transit smoothly from frame to frame

  17. Trapezoidal Shadow Maps (TSM) • Side Lines: 80% rule governs the choices 0% Focus region of the eye 80% line Trapezoidal approximation in L Trapezoidal space due to 80% rule

  18. Trapezoidal Shadow Maps (TSM) q • Calculate NT that pL is mapped to 80% line in T • Calculate q using 1D perspective projection map to y=+1  lt map to y= ` pL  map to y=-1 E lb l • (Minus signs in the proceedings got eaten up by the printer)

  19. Trapezoidal Shadow Maps (TSM)

  20. Trapezoidal Shadow Maps (TSM) • Indication for Continuity • Plot of the total area covered by focus region in shadow map • Change in frustum are color encoded

  21. Trapezoidal Shadow Maps (TSM) light light light • General case: • Eye’s frustum E is not completely within then light’s frustum L • Algorithm can be easily adjusted • Singularities are avoided eye eye eye

  22. Results • Fantasy World: • BB vs. PSM vs. TSM Urban Model: • PSM vs. TSM

  23. Conclusion • TSM addresses • Resolution Problem • Polygon Offset Problem • Continuity Problem • …following the 3 principles • Effectiveness of 80% rule • Simplicity which is difficult to achieve • Continuity rather than “correctness” • Q and A TSM http://www.comp.nus.edu.sg/~tants/tsm.html

  24. Literature BRABEC, S., ANNEN T., AND SEIDEL, H. 2002. Practical Shadow Mapping. Journal of Graphics Tools 7(4), 9–18. CROW, F. C. 1977. Shadow Algorithms for Computer Graphics. In Proceedings of SIGGRAPH 1977, 242–248. STAMMINGER, M., AND DRETTAKIS, G. 2002. Perspective Shadow Maps. WILLIAMS, L. 1978. Casting curved shadows on curved surfaces. In Proceedings of SIGGRAPH 1978, 270–274. WOO, A., POULIN, P., AND FOURNIER, A. 1990. A survey of shadow algorithms. IEEE Computer Graphics and Applications, 10(6), 13–32.

More Related