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

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

Embed Size (px)

Citation preview

Page 1: CSM Scrolling An acceleration technique for the rendering of cascaded shadow maps

CSM ScrollingAn acceleration technique for the rendering of cascaded shadow maps

 

Page 3: CSM Scrolling An acceleration technique for the rendering of cascaded shadow maps

Quick Background

Page 4: CSM Scrolling An acceleration technique for the rendering of cascaded shadow maps

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

Page 5: CSM Scrolling An acceleration technique for the rendering of cascaded shadow maps

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

rectangular slice of that volume.

Page 6: CSM Scrolling An acceleration technique for the rendering of cascaded shadow maps

Cascade refers to multiple resolutions of

that slice

Page 7: CSM Scrolling An acceleration technique for the rendering of cascaded shadow maps

Assumptions

Page 8: CSM Scrolling An acceleration technique for the rendering of cascaded shadow maps

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

Page 9: CSM Scrolling An acceleration technique for the rendering of cascaded shadow maps

Most geometry is relatively static across

frames

Page 10: CSM Scrolling An acceleration technique for the rendering of cascaded shadow maps

Geometry which has changed from the previous

frame can be identified

Page 11: CSM Scrolling An acceleration technique for the rendering of cascaded shadow maps

The light direction is relatively stable across

frames

Page 12: CSM Scrolling An acceleration technique for the rendering of cascaded shadow maps

Results of spatial queries can be used in the same

frame as shadow rendering

Page 13: CSM Scrolling An acceleration technique for the rendering of cascaded shadow maps

Geometry is divided into small* instances

Page 14: CSM Scrolling An acceleration technique for the rendering of cascaded shadow maps

Concept

Page 15: CSM Scrolling An acceleration technique for the rendering of cascaded shadow maps

Store “static” geometry from previous frame in cached map

Page 16: CSM Scrolling An acceleration technique for the rendering of cascaded shadow maps

Scroll cached map to account for change in camera view

Page 17: CSM Scrolling An acceleration technique for the rendering of cascaded shadow maps

Render additional “static” geometry into edges exposed by scrolling

Page 18: CSM Scrolling An acceleration technique for the rendering of cascaded shadow maps

Render newly “static” geometry in cached area

Page 19: CSM Scrolling An acceleration technique for the rendering of cascaded shadow maps

Copy map to use as final shadow map for current frame

Page 20: CSM Scrolling An acceleration technique for the rendering of cascaded shadow maps

Render non-static geometry into final shadow map for frame 

Page 21: CSM Scrolling An acceleration technique for the rendering of cascaded shadow maps

CSM Caching

Page 22: CSM Scrolling An acceleration technique for the rendering of cascaded shadow maps

Assumption: Camera is not moving (much)

Page 23: CSM Scrolling An acceleration technique for the rendering of cascaded shadow maps

Store “static” geometry from previous frame in cached map

Page 24: CSM Scrolling An acceleration technique for the rendering of cascaded shadow maps

Store “static” geometry from previous frame in cached map

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

Page 25: CSM Scrolling An acceleration technique for the rendering of cascaded shadow maps

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

Page 26: CSM Scrolling An acceleration technique for the rendering of cascaded shadow maps

Cache of previous frame shadow map

Page 27: CSM Scrolling An acceleration technique for the rendering of cascaded shadow maps

Cache of previous frame shadow map

Invalid if…

Page 28: CSM Scrolling An acceleration technique for the rendering of cascaded shadow maps

Cache of previous frame shadow map

Invalid if…• Camera moves• Camera FOV changes

Page 29: CSM Scrolling An acceleration technique for the rendering of cascaded shadow maps

Cache of previous frame shadow map

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

Page 30: CSM Scrolling An acceleration technique for the rendering of cascaded shadow maps

Render newly “static” geometry in cached area

Page 31: CSM Scrolling An acceleration technique for the rendering of cascaded shadow maps

Query for state of “static” geometry

Page 32: CSM Scrolling An acceleration technique for the rendering of cascaded shadow maps

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

Page 33: CSM Scrolling An acceleration technique for the rendering of cascaded shadow maps

Dynamic occlusion system used

Page 34: CSM Scrolling An acceleration technique for the rendering of cascaded shadow maps

Create copy new map cache to use this frame

Page 35: CSM Scrolling An acceleration technique for the rendering of cascaded shadow maps

“Dynamic” geometry rendered to temporary shadow map

Page 36: CSM Scrolling An acceleration technique for the rendering of cascaded shadow maps

CSM Scrolling

Page 37: CSM Scrolling An acceleration technique for the rendering of cascaded shadow maps

Assumption: Camera moves a lot (but

slowly*)

Page 38: CSM Scrolling An acceleration technique for the rendering of cascaded shadow maps

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

edges

Page 39: CSM Scrolling An acceleration technique for the rendering of cascaded shadow maps

Scroll cached map to account for change in camera view

Page 40: CSM Scrolling An acceleration technique for the rendering of cascaded shadow maps

Sample shadow texels from previous frame

Page 41: CSM Scrolling An acceleration technique for the rendering of cascaded shadow maps

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

Page 42: CSM Scrolling An acceleration technique for the rendering of cascaded shadow maps

Observe: Camera motion is 3D

Page 43: CSM Scrolling An acceleration technique for the rendering of cascaded shadow maps

Observe: Camera motion is 3D

• Lateral scrolling• Depth scrolling

Page 44: CSM Scrolling An acceleration technique for the rendering of cascaded shadow maps

Lateral scrollingTranslation perpendicular to light rays

UV translated by delta camera in light frame

Page 45: CSM Scrolling An acceleration technique for the rendering of cascaded shadow maps

Lateral scrollingTranslation perpendicular to light rays

Simple texture lookup(Point sampling)

Page 46: CSM Scrolling An acceleration technique for the rendering of cascaded shadow maps

Depth scrollingTranslation parallel to light rays

Additional handling needed for depth scroll

Page 47: CSM Scrolling An acceleration technique for the rendering of cascaded shadow maps

Depth scrollingTranslation parallel to light rays

Delta camera depth in light frame

Page 48: CSM Scrolling An acceleration technique for the rendering of cascaded shadow maps

Depth scrollingTranslation parallel to light rays

Offset all previous depths (scroll depth)

Page 49: CSM Scrolling An acceleration technique for the rendering of cascaded shadow maps

Depth scrollingTranslation parallel to light rays

Gotchas:• Near plane• Far plane

Page 50: CSM Scrolling An acceleration technique for the rendering of cascaded shadow maps

Depth scrollingTranslation parallel to light rays

Gotchas:• Near plane• Far plane

Clamp to 0.0

Page 51: CSM Scrolling An acceleration technique for the rendering of cascaded shadow maps

Depth scrollingTranslation parallel to light rays

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

Page 52: CSM Scrolling An acceleration technique for the rendering of cascaded shadow maps

Depth scrollingTranslation parallel to light rays

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

No offset

Page 53: CSM Scrolling An acceleration technique for the rendering of cascaded shadow maps

Render additional “static” geometry into edges exposed by scrolling

Page 54: CSM Scrolling An acceleration technique for the rendering of cascaded shadow maps

Scrolled in area divided into slabs (thin OBBs)

Page 55: CSM Scrolling An acceleration technique for the rendering of cascaded shadow maps

‘Static’ geom with overlapping bounding volume rendered

Page 56: CSM Scrolling An acceleration technique for the rendering of cascaded shadow maps

Observe: Coarseness of geometry relative to view

Page 57: CSM Scrolling An acceleration technique for the rendering of cascaded shadow maps

Lots of overlapping volumes

Page 58: CSM Scrolling An acceleration technique for the rendering of cascaded shadow maps

Very few overlapping volumes

Page 59: CSM Scrolling An acceleration technique for the rendering of cascaded shadow maps

Jagged pattern not relevant: Using square geom tiles

(Aside)

Page 60: CSM Scrolling An acceleration technique for the rendering of cascaded shadow maps

Render newly “static” geometry in cached area

Page 61: CSM Scrolling An acceleration technique for the rendering of cascaded shadow maps

Copy map to use as final shadow map for current frame

Page 62: CSM Scrolling An acceleration technique for the rendering of cascaded shadow maps

CSM Scrolling

Page 63: CSM Scrolling An acceleration technique for the rendering of cascaded shadow maps

Each map (512x512) PS3/360

Page 64: CSM Scrolling An acceleration technique for the rendering of cascaded shadow maps

Another view…

Page 65: CSM Scrolling An acceleration technique for the rendering of cascaded shadow maps

Wrap up

Page 66: CSM Scrolling An acceleration technique for the rendering of cascaded shadow maps

Straightforward addition to CSM

Caching

Page 67: CSM Scrolling An acceleration technique for the rendering of cascaded shadow maps

Key: Like 2D bitmap scrolling

Page 68: CSM Scrolling An acceleration technique for the rendering of cascaded shadow maps

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

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

Detailed paper:

bit.ly/QIoBr9