Presentation is loading. Please wait.

Presentation is loading. Please wait.

Shadow and Shadow Maps [5]. Object without shadow seem floating above the scene Shadow gives the depth information Shadow gives the information of the.

Similar presentations


Presentation on theme: "Shadow and Shadow Maps [5]. Object without shadow seem floating above the scene Shadow gives the depth information Shadow gives the information of the."— Presentation transcript:

1 Shadow and Shadow Maps [5]

2 Object without shadow seem floating above the scene Shadow gives the depth information Shadow gives the information of the relative position of lights and objects in the scene What kind of visual cues does shadow give? [1]

3 Shadow increases scene realism Shadow makes the scene conceivable What kind of visual cues does shadow give?

4 Some Shadow Algorithms Shodow Polygon (Blinn) Basically project polygon vertices to a flat plane Shadow Polygon Scanline (Appel; Bouknight, Kelly) Shadow Volume (F. C. Crow) [1]

5 Some Shadow Algorithms Shodow Polygon (Blinn) Shadow Polygon Scanline (Appel; Bouknight, Kelly) Figure out all the polygons involved in shadowing. Pair each polygon that cast shadow with each polygon that it casts shadow upon Process shadow at each scanline for those polygons Shadow Volume (F. C. Crow)

6 Some Shadow Algorithms Shodow Polygon (Blinn) Shadow Polygon Scanline (Appel; Bouknight, Kelly) Shadow Volume (F. C. Crow) Create a volume polygon for the intersection of view frustum and semi-infinite shadow volume Collision test for the shadow volume and polygons [2]

7 Shadow Algorithms Pros: Precision Good for production / static scenes Cons: Requires non-trivial data structures Requires large amount of memory Lack hardware support Too slow for interactive rendering

8 Shadow Map (L. Williams 1978) Render from the view point of the light source. Use the depth buffer as shadow map [5]

9 Shadow Map (L. Williams 1978) Render from camera view point Project to light source and compare with shadow map If the depth are the same, it’s not under shadow (1) If the point is behind shadow map, it’s under shadow (2) 1 2 [5]

10 Shadow Map Aliasing It’s all because of undersampling [5]

11 Shadow Map Aliasing d s r s /r i becomes large  perspective aliasing cos  /cos  becomes large  projection aliasing [5]

12 Shadow Map Aliasing d s r s /r i becomes large  perspective aliasing cos  /cos  becomes large  projection aliasing [5]

13 Shadow Map Pros: Performance not constrained by number of polygons Shadow map = z-buffer. Supported in today’s graphic cards due to its simplicity Cons: Aliasing!

14 Adaptive Shadow Map (R. Fernando, S. Fernandez, K. Bala, D.P. Greenberg 2001) Transform as usual Analyze shadow map base on depth. Try to reduce d s r s /r i and cos  /cos  [4]

15 Adaptive Shadow Map Refined shadow map by building an hierarchical refinement map [4]

16 Adaptive Shadow Map Pros: Much better quality than uniform shadow map No manual intervention involved Uses mip-map feature on hardware Cons: Still a software solution (analyzer, data structure etc) Interactive drawbacks – need to refine a lot of data during interaction

17 Perspective Shadow Map – The Idea (Marc Stamminger, Gorge Drettakis 2002) Apply perspective transformation to the scene View frustum is now a cube instead of a pyramided [5]

18 Perspective Shadow Map – The Idea Now the size in this new scene is proportional to the final image We take the shadow map of the new scene instead The result is a shadow map with resolution same as the final image [5]

19 Uniform Shadow Map Shadow map has lower resolution than image plane Perspective Shadow Map Shadow map has exactly same resolution than image plane [5]

20 Is it really that easy? No! The light sources need perspective transformation too No! All objects casting shadow into view frustum must be included – need an optimization plan for bounding box

21 Perspective Shadow Map – Light Sources Light sources need to be relocated before shadow map is taken Directional light in world space becomes point lights in post perspective space on infinity plane [5]

22 Perspective Shadow Map – Light Sources Point lights are still point lights but not on the infinity plane Point lights on infinity plane in world space becomes directional light [5]

23 Perspective Shadow Map – Objects What happens if a shadow in view frustum is cast by an object outside of view frustum? In post-perspective space, the objects that needs to cast shadow appear beyond infinity plane. Transformed objects beyond infinity plane appears inverted [5]

24 Perspective Shadow Map – Objects Need to include more than just view frustum for perspective transformation M is all rays from light source to view frustum boundary The new world space to transform, H, is intersection of M, S(world space boundary) and light frustum Now we have a little more than just view frustum [5]

25 Perspective Shadow Map – Objects What about the inverted trees beyond infinity plane? Move the camera back in post perspective space so everything looks upright This solves the problem but we lose some resolution for taking a bigger picture [5]

26 Perspective Shadow Map Pros: Everything uniform shadow map does, this can do much better Way faster than adaptive shadow map Takes full advantage of hardware supported shadow map Cons: Transformations are not so trivial Slight computational overhead Occasional degradation when shadows are cast by objects behind camera (but always better than shadow map)

27 Perspective Shadow Map – Pictures [5]

28 Perspective Shadow Map – Pictures [5]

29 Perspective Shadow Map – Pictures cs2.machineroom.org/ media/doom3-2.jpg

30 References 1.J. Teng. Institute of automation. Chinese Academy of Science liama.ia.ac.cn/meeting/Archives/shadow.ppt 2002 2.F.C. Crow Shadow algorithms for computer graphics. ACM Press. 1977. 3.L. Williams. Casting curved shadows on curved surface. Computer Graphics SIGGRAPH 1978 4.R. Fernando, S. Fernndez, K. Bala, D.P. Greenberg. Adaptive shadow maps. SIGGRAPH 2001 5.M. Stamminger, G. Drettakis. Perspective shadow maps. SIGGRAPH 2002

31 http://www-sop.inria.fr/reves/publications/data/2002/SD02/psm_divx.avi.gz


Download ppt "Shadow and Shadow Maps [5]. Object without shadow seem floating above the scene Shadow gives the depth information Shadow gives the information of the."

Similar presentations


Ads by Google