Ray Tracing Depth Maps Using Precomputed Edge Tables
description
Transcript of Ray Tracing Depth Maps Using Precomputed Edge Tables
![Page 1: Ray Tracing Depth Maps Using Precomputed Edge Tables](https://reader035.fdocuments.net/reader035/viewer/2022062804/568149c0550346895db6f543/html5/thumbnails/1.jpg)
Ray Tracing Depth Maps Using Precomputed Edge TablesRay Tracing Depth Maps Using Precomputed Edge Tables
Kevin Egan
Rhythm & Hues Studios
![Page 2: Ray Tracing Depth Maps Using Precomputed Edge Tables](https://reader035.fdocuments.net/reader035/viewer/2022062804/568149c0550346895db6f543/html5/thumbnails/2.jpg)
OverviewOverview
• Shadowing
• Ray tracing depth maps
• Our new technique
• Analysis and future work
![Page 3: Ray Tracing Depth Maps Using Precomputed Edge Tables](https://reader035.fdocuments.net/reader035/viewer/2022062804/568149c0550346895db6f543/html5/thumbnails/3.jpg)
ShadowingShadowing
• Shadows provide realism and a sense of depth
• We will focus on opaque objects casting shadows from an area light
– Ray traced shadows
– Depth maps
area light
occluder
umbrapenumbra
![Page 4: Ray Tracing Depth Maps Using Precomputed Edge Tables](https://reader035.fdocuments.net/reader035/viewer/2022062804/568149c0550346895db6f543/html5/thumbnails/4.jpg)
Area Lights and Depth MapsArea Lights and Depth Maps
• Create and sample many depth maps
• Percentage closer filtering with an expanded filter region
– Incorrect self-shadowing
• Ray tracing depth maps
![Page 5: Ray Tracing Depth Maps Using Precomputed Edge Tables](https://reader035.fdocuments.net/reader035/viewer/2022062804/568149c0550346895db6f543/html5/thumbnails/5.jpg)
Ray Tracing Depth MapsRay Tracing Depth Maps
• Agrawala et al. introduced techniques for ray tracing through depth maps (SIGGRAPH 2000)
– Correctly cast rays from shading point to area light
– Hierarchical depth map
– Caching shadow rays
– Trace one ray at a time
![Page 6: Ray Tracing Depth Maps Using Precomputed Edge Tables](https://reader035.fdocuments.net/reader035/viewer/2022062804/568149c0550346895db6f543/html5/thumbnails/6.jpg)
Side ViewSide View
area light
depth mapprojection point
shading point
shadow ray
pixel frusta
![Page 7: Ray Tracing Depth Maps Using Precomputed Edge Tables](https://reader035.fdocuments.net/reader035/viewer/2022062804/568149c0550346895db6f543/html5/thumbnails/7.jpg)
Side ViewSide View
area light
depth mapprojection point
shading point
shadow ray
pixel frusta
![Page 8: Ray Tracing Depth Maps Using Precomputed Edge Tables](https://reader035.fdocuments.net/reader035/viewer/2022062804/568149c0550346895db6f543/html5/thumbnails/8.jpg)
Side ViewSide View
area light
depth mapprojection point
shading point
pixel frusta
shadow ray
![Page 9: Ray Tracing Depth Maps Using Precomputed Edge Tables](https://reader035.fdocuments.net/reader035/viewer/2022062804/568149c0550346895db6f543/html5/thumbnails/9.jpg)
Overhead viewOverhead view
shadow raypixel frusta
shading point
![Page 10: Ray Tracing Depth Maps Using Precomputed Edge Tables](https://reader035.fdocuments.net/reader035/viewer/2022062804/568149c0550346895db6f543/html5/thumbnails/10.jpg)
Overhead viewOverhead view
shadow ray
shading point
pixel frusta
![Page 11: Ray Tracing Depth Maps Using Precomputed Edge Tables](https://reader035.fdocuments.net/reader035/viewer/2022062804/568149c0550346895db6f543/html5/thumbnails/11.jpg)
Overhead viewOverhead view
shadow ray
shading point
pixel frusta
![Page 12: Ray Tracing Depth Maps Using Precomputed Edge Tables](https://reader035.fdocuments.net/reader035/viewer/2022062804/568149c0550346895db6f543/html5/thumbnails/12.jpg)
Ray Tracing Depth MapsRay Tracing Depth Maps
• In Agrawala implementation tracing many rays leads to repeated depth map lookups
![Page 13: Ray Tracing Depth Maps Using Precomputed Edge Tables](https://reader035.fdocuments.net/reader035/viewer/2022062804/568149c0550346895db6f543/html5/thumbnails/13.jpg)
Overhead viewOverhead view
shadow rays
shading point
pixel frusta
![Page 14: Ray Tracing Depth Maps Using Precomputed Edge Tables](https://reader035.fdocuments.net/reader035/viewer/2022062804/568149c0550346895db6f543/html5/thumbnails/14.jpg)
Our WorkOur Work
• Same basic idea as Agrawala et al.
– Correctly cast rays from shading point to area light
• New datastructure for tracing many shadow ray segments in parallel
![Page 15: Ray Tracing Depth Maps Using Precomputed Edge Tables](https://reader035.fdocuments.net/reader035/viewer/2022062804/568149c0550346895db6f543/html5/thumbnails/15.jpg)
Precomputed Edge TablesPrecomputed Edge Tables
• Pick a shading position to precompute
• For each pixel frustum edge compute intersection with all shadow rays
– For each intersection store bitmask recording which rays intersect below intersection point
– We call this set of bitmasks an edge table
![Page 16: Ray Tracing Depth Maps Using Precomputed Edge Tables](https://reader035.fdocuments.net/reader035/viewer/2022062804/568149c0550346895db6f543/html5/thumbnails/16.jpg)
Side ViewSide View
area light
depth mapprojection point
shading position
pixel frustaoccluder
shadow ray
![Page 17: Ray Tracing Depth Maps Using Precomputed Edge Tables](https://reader035.fdocuments.net/reader035/viewer/2022062804/568149c0550346895db6f543/html5/thumbnails/17.jpg)
Side ViewSide View
area light
depth mapprojection point
shading position
pixel frusta
bitmasks
shadow ray
![Page 18: Ray Tracing Depth Maps Using Precomputed Edge Tables](https://reader035.fdocuments.net/reader035/viewer/2022062804/568149c0550346895db6f543/html5/thumbnails/18.jpg)
Precomputed Edge TablesPrecomputed Edge Tables
• We can efficiently find all rays occluded by a single depth map pixel
![Page 19: Ray Tracing Depth Maps Using Precomputed Edge Tables](https://reader035.fdocuments.net/reader035/viewer/2022062804/568149c0550346895db6f543/html5/thumbnails/19.jpg)
Overhead viewOverhead view
shadow rays
shading point
pixel frusta
![Page 20: Ray Tracing Depth Maps Using Precomputed Edge Tables](https://reader035.fdocuments.net/reader035/viewer/2022062804/568149c0550346895db6f543/html5/thumbnails/20.jpg)
Precomputed Edge TablesPrecomputed Edge Tables
For each pixel in filter region
Lookup depth from depth map
Find nearest bitmasks for all edges
XOR bitmasks for incoming edges with outgoing
edges
Mark all occluded rays
Record percentage of occluded rays
![Page 21: Ray Tracing Depth Maps Using Precomputed Edge Tables](https://reader035.fdocuments.net/reader035/viewer/2022062804/568149c0550346895db6f543/html5/thumbnails/21.jpg)
Precomputed Edge TablesPrecomputed Edge Tables
• Edge table masks store all relevant edge tables
– Efficient and accurate computation for one shading position
• Assume the light source is planar and perpendicular to the axis of projection
– One edge table mask can be used for many pixels
![Page 22: Ray Tracing Depth Maps Using Precomputed Edge Tables](https://reader035.fdocuments.net/reader035/viewer/2022062804/568149c0550346895db6f543/html5/thumbnails/22.jpg)
Precomputed Edge TablesPrecomputed Edge Tables
• Generate masks for some number of positions
precomputed maskpositions
![Page 23: Ray Tracing Depth Maps Using Precomputed Edge Tables](https://reader035.fdocuments.net/reader035/viewer/2022062804/568149c0550346895db6f543/html5/thumbnails/23.jpg)
Precomputed Edge TablesPrecomputed Edge Tables
• Masks generated for one pixel can be reused for all pixels
replicated maskpositions
precomputed maskpositions
![Page 24: Ray Tracing Depth Maps Using Precomputed Edge Tables](https://reader035.fdocuments.net/reader035/viewer/2022062804/568149c0550346895db6f543/html5/thumbnails/24.jpg)
Precomputed Edge TablesPrecomputed Edge Tables
• For new shading point move the nearest masks to the new shading position and linearly blend the results
– Moving a mask from its precomputed position effectively shrinks or shifts the light
![Page 25: Ray Tracing Depth Maps Using Precomputed Edge Tables](https://reader035.fdocuments.net/reader035/viewer/2022062804/568149c0550346895db6f543/html5/thumbnails/25.jpg)
Precomputed Edge TablesPrecomputed Edge Tables
new shadingposition
![Page 26: Ray Tracing Depth Maps Using Precomputed Edge Tables](https://reader035.fdocuments.net/reader035/viewer/2022062804/568149c0550346895db6f543/html5/thumbnails/26.jpg)
ResultsResults
![Page 27: Ray Tracing Depth Maps Using Precomputed Edge Tables](https://reader035.fdocuments.net/reader035/viewer/2022062804/568149c0550346895db6f543/html5/thumbnails/27.jpg)
ResultsResults
![Page 28: Ray Tracing Depth Maps Using Precomputed Edge Tables](https://reader035.fdocuments.net/reader035/viewer/2022062804/568149c0550346895db6f543/html5/thumbnails/28.jpg)
DrawbacksDrawbacks
• Rendering time and memory consumption are dependent on:
– Filter size (penumbra width)
– Depth map resolution
– Density of edge table masks
• Undersampling filter region does not give good results
![Page 29: Ray Tracing Depth Maps Using Precomputed Edge Tables](https://reader035.fdocuments.net/reader035/viewer/2022062804/568149c0550346895db6f543/html5/thumbnails/29.jpg)
BenefitsBenefits
• Improvement to Agrawala implementation
– Especially when shadow ray caching is ineffective
– Precomputation for geometry and shadow rays
• More robust than percentage closer filtering
• Faster than ray traced shadows
![Page 30: Ray Tracing Depth Maps Using Precomputed Edge Tables](https://reader035.fdocuments.net/reader035/viewer/2022062804/568149c0550346895db6f543/html5/thumbnails/30.jpg)
Future WorkFuture Work
• Mixing ray tracing and precomputed depth maps
– Accuracy along silhouette edges
– Efficiency for other areas
• Multi-resolution depth map
• GPU implementation
![Page 31: Ray Tracing Depth Maps Using Precomputed Edge Tables](https://reader035.fdocuments.net/reader035/viewer/2022062804/568149c0550346895db6f543/html5/thumbnails/31.jpg)
Thanks!Thanks!
• Ivan Neulander
• Rhythm & Hues Studios