CSM Scrolling

69
CSM Scrolling An acceleration technique for the rendering of cascaded shadow maps

description

CSM Scrolling. An acceleration technique for the rendering of cascaded shadow maps. CSM Scrolling by: Mike Day [email protected] CSM Caching by: Al Hastings [email protected] Who am I? Mike Acton [email protected]. Quick Background. - PowerPoint PPT Presentation

Transcript of CSM Scrolling

Page 1: CSM Scrolling

CSM ScrollingAn acceleration technique for the rendering of cascaded shadow maps

 

Page 3: CSM Scrolling

Quick Background

Page 4: CSM Scrolling

From light POV, imagine whole world as single mega shadow texture

Page 5: CSM Scrolling

On any particular frame, a shadow map represents a 2D

rectangular slice of that volume.

Page 6: CSM Scrolling

Cascade refers to multiple resolutions of

that slice

Page 7: CSM Scrolling

Assumptions

Page 8: CSM Scrolling

Most of the time, the camera does not make radical changes across frames

Page 9: CSM Scrolling

Most geometry is relatively static across

frames

Page 10: CSM Scrolling

Geometry which has changed from the previous

frame can be identified

Page 11: CSM Scrolling

The light direction is relatively stable across

frames

Page 12: CSM Scrolling

Results of spatial queries can be used in the same

frame as shadow rendering

Page 13: CSM Scrolling

Geometry is divided into small* instances

Page 14: CSM Scrolling

Concept

Page 15: CSM Scrolling

Store “static” geometry from previous frame in cached map

Page 16: CSM Scrolling

Scroll cached map to account for change in camera view

Page 17: CSM Scrolling

Render additional “static” geometry into edges exposed by scrolling

Page 18: CSM Scrolling

Render newly “static” geometry in cached area

Page 19: CSM Scrolling

Copy map to use as final shadow map for current frame

Page 20: CSM Scrolling

Render non-static geometry into final shadow map for frame 

Page 21: CSM Scrolling

CSM Caching

Page 22: CSM Scrolling

Assumption: Camera is not moving (much)

Page 23: CSM Scrolling

Store “static” geometry from previous frame in cached map

Page 24: CSM Scrolling

Store “static” geometry from previous frame in cached map

“static” = not moved for t time. (e.g. 5 seconds) 

Page 25: CSM Scrolling

Each frame, render non-static geometry on to cached copy

Page 26: CSM Scrolling

Cache of previous frame shadow map

Page 27: CSM Scrolling

Cache of previous frame shadow map

Invalid if…

Page 28: CSM Scrolling

Cache of previous frame shadow map

Invalid if…• Camera moves• Camera FOV changes

Page 29: CSM Scrolling

Cache of previous frame shadow map

Invalid if…• Camera moves• Camera FOV changes• “Static” geometry moves

Page 30: CSM Scrolling

Render newly “static” geometry in cached area

Page 31: CSM Scrolling

Query for state of “static” geometry

Page 32: CSM Scrolling

Diff current “static” versus previous “static” query results

Page 33: CSM Scrolling

Dynamic occlusion system used

Page 34: CSM Scrolling

Create copy new map cache to use this frame

Page 35: CSM Scrolling

“Dynamic” geometry rendered to temporary shadow map

Page 36: CSM Scrolling

CSM Scrolling

Page 37: CSM Scrolling

Assumption: Camera moves a lot (but slowly*)

Page 38: CSM Scrolling

Insert in to CSM Caching:1. Scroll map2. Render into exposed 

edges

Page 39: CSM Scrolling

Scroll cached map to account for change in camera view

Page 40: CSM Scrolling

Sample shadow texels from previous frame

Page 41: CSM Scrolling

Scrolled area is clamp-to-border (color=1.0)

Page 42: CSM Scrolling

Observe: Camera motion is 3D

Page 43: CSM Scrolling

Observe: Camera motion is 3D

• Lateral scrolling• Depth scrolling

Page 44: CSM Scrolling

Lateral scrollingTranslation perpendicular to light rays

UV translated by delta camera in light frame

Page 45: CSM Scrolling

Lateral scrollingTranslation perpendicular to light rays

Simple texture lookup(Point sampling)

Page 46: CSM Scrolling

Depth scrollingTranslation parallel to light rays

Additional handling needed for depth scroll

Page 47: CSM Scrolling

Depth scrollingTranslation parallel to light rays

Delta camera depth in light frame

Page 48: CSM Scrolling

Depth scrollingTranslation parallel to light rays

Offset all previous depths (scroll depth)

Page 49: CSM Scrolling

Depth scrollingTranslation parallel to light rays

Gotchas:• Near plane• Far plane

Page 50: CSM Scrolling

Depth scrollingTranslation parallel to light rays

Gotchas:• Near plane• Far plane

Clamp to 0.0

Page 51: CSM Scrolling

Depth scrollingTranslation parallel to light rays

Gotchas:• Near plane• Far plane Problem 1.0 = buffer clear

Page 52: CSM Scrolling

Depth scrollingTranslation parallel to light rays

Gotchas:• Near plane• Far plane Problem 1.0 = buffer clear

No offset

Page 53: CSM Scrolling

Render additional “static” geometry into edges exposed by scrolling

Page 54: CSM Scrolling

Scrolled in area divided into slabs (thin OBBs)

Page 55: CSM Scrolling

‘Static’ geom with overlapping bounding volume rendered

Page 56: CSM Scrolling

Observe: Coarseness of geometry relative to view

Page 57: CSM Scrolling

Lots of overlapping volumes

Page 58: CSM Scrolling

Very few overlapping volumes

Page 59: CSM Scrolling

Jagged pattern not relevant: Using square geom tiles

(Aside)

Page 60: CSM Scrolling

Render newly “static” geometry in cached area

Page 61: CSM Scrolling

Copy map to use as final shadow map for current frame

Page 62: CSM Scrolling

CSM Scrolling

Page 63: CSM Scrolling

Each map (512x512) PS3/360

Page 64: CSM Scrolling

Another view…

Page 65: CSM Scrolling

Wrap up

Page 66: CSM Scrolling

Straightforward addition to CSM Caching

Page 67: CSM Scrolling

Key: Like 2D bitmap scrolling

Page 68: CSM Scrolling

Do not render ~70% of ‘static’ geometry in to CSM

Page 69: CSM Scrolling

Detailed paper:bit.ly/QIoBr9