Download presentation
Presentation is loading. Please wait.
1
黃聰賢
2
Light Position Mesh Polygon Shadow Polygon
3
Clear color buffer and stencil buffer Render the scene with ambient only
4
Mask color buffer and depth buffer Enable back face culling Increase stencil value if depth test is passed Draw shadow polygons Stencil value = 1 Stencil value = 0
5
Mask color buffer and depth buffer Enable front face culling Decrease stencil value if depth test is passed Draw shadow polygons Stencil value = +1 -1 = 0 Stencil value = +1
6
Clear depth buffer Set stencil pass condition ◦ Equal to zero Render the scene with full lighting Ambient only
7
light
8
Why? +1 +1-1 =0
9
How? Edge A Edge B light n n n n front back Edge C n back n
10
Front n Back n Ensure shadow polygons face outside. ab a' b' a b a' c c
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.