perspective shadow maps marc stamminger and george drettakis speaker: alvin date: 5/28/2003 siggraph...

Post on 20-Dec-2015

221 Views

Category:

Documents

3 Downloads

Preview:

Click to see full reader

TRANSCRIPT

Perspective Shadow Maps

Marc Stamminger and George Drettakis

Speaker: AlvinSpeaker: Alvin

Date: 5/28/2003Date: 5/28/2003

SIGGRAPH 2002SIGGRAPH 2002

Alivn/GAME LAB/CSIE/NDHU Prespective Shadow Maps 2

Outline

– Shadow Maps– Shadow Map Aliasing– Frame Works– Light Sources– Point Rendering– Result– Conclusion

Alivn/GAME LAB/CSIE/NDHU Prespective Shadow Maps 3

Shadow Maps

[Williams78]Casting curved shadows

on curved surfaces– Image-space algorithm– Well suited for hardware

implementation

Alivn/GAME LAB/CSIE/NDHU Prespective Shadow Maps 4

Shadow Maps Algorithm

– Render scene as seen from light source

– Save back depth buffer (2D shadow map)

– Render scene from viewer’s position• Transform pixel coordinates to light source space• Compare z with z value stored in shadow map

– Pixel is in shadow if z(light) < z(viewer)

Alivn/GAME LAB/CSIE/NDHU Prespective Shadow Maps 5

Outline

– Shadow Maps– Perspective Aliasing– Frame Works– Light Sources– Point Rendering– Result– Conclusion

Alivn/GAME LAB/CSIE/NDHU Prespective Shadow Maps 6

Perspective aliasing

Alivn/GAME LAB/CSIE/NDHU Prespective Shadow Maps 7

Outline

– Shadow Maps– Perspective Aliasing– Frame Works– Light Sources– Point Rendering– Result– Conclusion

Alivn/GAME LAB/CSIE/NDHU Prespective Shadow Maps 8

IdeaIdea

uniform shadow map perspective shadow map

Alivn/GAME LAB/CSIE/NDHU Prespective Shadow Maps 9

IdeaIdea

uniform shadow map perspective shadow map

Alivn/GAME LAB/CSIE/NDHU Prespective Shadow Maps 10

Frame Works

– Map the scene to post-perspective space.

– Generate a standard shadow map in this space by rendering a view from the transformed light source to the unit cube.

Alivn/GAME LAB/CSIE/NDHU Prespective Shadow Maps 11

Including Objects Casting Including Objects Casting ShadowsShadows

S: The bounding box of the scene objects.S: The bounding box of the scene objects.

V: The viewing frustum.V: The viewing frustum.

L: The light frustum.L: The light frustum.

l: The light source.l: The light source.

M: Contain all rays from the points in V to l.M: Contain all rays from the points in V to l.

H: M H: M ۸۸ S S ۸۸ LL

Alivn/GAME LAB/CSIE/NDHU Prespective Shadow Maps 12

Shadows From Behind

► Virtually move camera backwards

Alivn/GAME LAB/CSIE/NDHU Prespective Shadow Maps 13

Outline

– Shadow Maps– Perspective Aliasing– Frame Works– Light Sources– Point Rendering– Result– Conclusion

Alivn/GAME LAB/CSIE/NDHU Prespective Shadow Maps 14

Light Sources

– Parallel light transformation– Point light transformation

In this paper, point lights means spot lights.

– Discussion

Alivn/GAME LAB/CSIE/NDHU Prespective Shadow Maps 15

Parallel Light Transformation

– Parallel light becomes point light at infinity.– Perspective mapping can move these

source to a infinity position. z = (far+near)/(far-near)– A directional light source from behind is

mapped to a “inverted” point light source.– Inverted point can be handle as hit point

furthest from the point source survive.

Alivn/GAME LAB/CSIE/NDHU Prespective Shadow Maps 16

Parallel Light Transformation

Alivn/GAME LAB/CSIE/NDHU Prespective Shadow Maps 17

Point light transformation

– Point light sources in front of the viewer remain point lights.

– Point light sources behind the viewer are mapped beyond the infinity plane and becomes inverted.

– Point light sources on the plane which is perpendicular to the view direction become directional.

Alivn/GAME LAB/CSIE/NDHU Prespective Shadow Maps 18

Point light transformation

Alivn/GAME LAB/CSIE/NDHU Prespective Shadow Maps 19

Discussion

– Worst case:Become uniform shadow map.

– Best case: – Parallel light in post-perspective space. – No new perspective distortion.

Alivn/GAME LAB/CSIE/NDHU Prespective Shadow Maps 20

Near Plane Selection

– Near plane as far as possible

– Automatic selection: reading back depth buffer.

Alivn/GAME LAB/CSIE/NDHU Prespective Shadow Maps 21

Outline

– Shadow Maps– Perspective Aliasing– Frame Works– Light Sources– Point Rendering– Result– Conclusion

Alivn/GAME LAB/CSIE/NDHU Prespective Shadow Maps 22

Point Rendering

– Not suited for uniform Shadow Map.Not suited for uniform Shadow Map.

A very large, dense point set needs to be A very large, dense point set needs to be generated frequently.generated frequently.

– Well suited for Perspective Shadow Well suited for Perspective Shadow Map.Map.

– – Point clouds have uniform point density.Point clouds have uniform point density.

– – Assume the point densities are uniform.Assume the point densities are uniform.

– – Easy to select the splat size to avoid holes.Easy to select the splat size to avoid holes.

Alivn/GAME LAB/CSIE/NDHU Prespective Shadow Maps 23

Outline

– Shadow Maps– Perspective Aliasing– Frame Works– Light Sources– Point Rendering– Result– Conclusion

Alivn/GAME LAB/CSIE/NDHU Prespective Shadow Maps 24

Result

Alivn/GAME LAB/CSIE/NDHU Prespective Shadow Maps 25

Result

With shadow maps of size 1024*1024.FPS = 15

Alivn/GAME LAB/CSIE/NDHU Prespective Shadow Maps 26

Result

With shadow maps of size 1024*1024.FPS = 10

Alivn/GAME LAB/CSIE/NDHU Prespective Shadow Maps 27

Result

With shadow maps of size 1024*1024.

FPS = 10

Alivn/GAME LAB/CSIE/NDHU Prespective Shadow Maps 28

Result

With shadow maps of size 1024*1024.

FPS = 10

Alivn/GAME LAB/CSIE/NDHU Prespective Shadow Maps 29

Result

no shadows20 million triangles, FPS = 1

Alivn/GAME LAB/CSIE/NDHU Prespective Shadow Maps 30

Result

no shadows20 million triangles, FPS = 1

Alivn/GAME LAB/CSIE/NDHU Prespective Shadow Maps 31

Result

no shadows20 million triangles, FPS = 0.83

Alivn/GAME LAB/CSIE/NDHU Prespective Shadow Maps 32

DemoDemo

Alivn/GAME LAB/CSIE/NDHU Prespective Shadow Maps 33

Outline

– Shadow Maps– Perspective Aliasing– Frame Works– Light Sources– Point Rendering– Result– Conclusion

Alivn/GAME LAB/CSIE/NDHU Prespective Shadow Maps 34

Conclusion

Perspective Shadow Maps– Shadow map in post-perspective space– View-dependent– Easy for hardware support– Needs recomputation per frame– Minimal overhead for dynamic scenes

top related