Fast and Accurate Soft Shadows Fast and Accurate Soft Shadows using a Real-Time Beam Tracer using a Real-Time Beam Tracer Ravi Ramamoorthi Columbia Vision and Graphics Center Columbia University http://www.cs.columbia.edu/~ravir Intel, Mar 29, 200 work with Ryan Overbeck (Columbia), Bill Mark (UT A
82
Embed
Fast and Accurate Soft Shadows using a Real-Time Beam Tracer Ravi Ramamoorthi Columbia Vision and Graphics Center Columbia University ravir.
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Fast and Accurate Soft Shadows using Fast and Accurate Soft Shadows using a Real-Time Beam Tracera Real-Time Beam Tracer
Ravi Ramamoorthi
Columbia Vision and Graphics CenterColumbia University
http://www.cs.columbia.edu/~ravir
Intel, Mar 29, 2007
Joint work with Ryan Overbeck (Columbia), Bill Mark (UT Austin)
Beam Tracing:
Reference Quality (Our Method)
Ray Tracing:
Comparable Time 4 Shadow Rays
Ray Tracing:
Comparable Quality 256 Shadow Rays
3 Seconds 3 Seconds 99 Seconds
Note that secondary effects (soft shadows) are often hard to accelerate in modern fast ray tracers
Renaissance of interest in ray tracing [Whitted 80]
Real-time ray tracing has become a reality by exploiting geometric coherence of rays in the scene Ray Packets [Wald et al. 2001] Frustum Proxies [Reshetov et al. 2005 (MLRTA)] SIMD instructions (Intel SSE2) to trace multiple rays
Ray tracing can produce significantly higher quality images than standard rasterization based algorithms Potential for a revolution in interactive graphics pipeline
ChallengesChallenges
Problems with current Real-Time Ray Tracing algorithms How to use packets/frusta well for secondary visibility? More geometric coherence than current ray tracers use Per pixel operations (even simple shading) bottleneck Can’t yet afford to subsample pixels leading to aliasing
Our solution: Real-Time Beam Tracing Trace beams instead of individual rays Old technique [Heckbert Hanrahan 84] but previously
considered too slow, complicated
Beam Tracing Beam Tracing
Start with beam and scene geometry For primary visibility, the beam is the view frustum
Beam TracingBeam Tracing
The beam is intersected against the first geometry primitive
Beam TracingBeam Tracing
The beam is split against the primitive’s boundaries (triangle edges)
Beam TracingBeam Tracing
The beam is split against the primitive’s boundaries (triangle edges)
Beam TracingBeam Tracing
Each sub-beam is intersected against the other primitives and is recursively split
Beam TracingBeam Tracing
Each sub-beam is intersected against the other primitives and is recursively split
Beam TracingBeam Tracing
Each sub-beam is intersected against the other primitives and is recursively split
Beam TracingBeam Tracing
Each sub-beam is intersected against the other primitives and is recursively split
Beam TracingBeam Tracing
Each sub-beam is intersected against the other primitives and is recursively split
Beam TracingBeam Tracing
Each sub-beam is intersected against the other primitives and is recursively split
Beam TracingBeam Tracing
The result is the visible surface of the scene
Beam TracingBeam Tracing
The final hit beams often contain many samples/pixels, for large performance gains
How to efficiently address secondary visibility? Large coherent area samples for hard shadows Only need area coverage on light for soft shadows
More geometric coherence than current ray tracers Automatically adapts to (all) available coherence Only split beam when necessary, at triangle boundaries
Per pixel (even simple shading) bottleneck Returns area samples instead of point samples Independent of resolution, combines with GPU, software
Aliasing: Can’t yet afford to subsample pixels Area elements: can inherently be antialiased on GPU
Beam Tracing: Cons and Contrib.Beam Tracing: Cons and Contrib.
Little work since HH84 (considered slow technique) Beam-Triangle intersection is slow vs ray-triangle No effective acceleration structures, fast traversals Often used in acoustics [Funkhouser 98,99]
Contributions Fast Beam-Triangle Intersections Fast Beam-Kd-tree traversal Includes modern ray tracing accelerations, SSE Application to primary, secondary visibility
Beam intersects triangle and splits That part that hits, and that part that misses
High-Level Algorithmic Decisions Mirror ray-triangle intersection, diverging only if needed Parallelize through use of SIMD SSE Instructions Operate on (3 or 4) corners of beam as if single ray
Rays vs. kd-tree -> Rays vs. SlabsRays vs. kd-tree -> Rays vs. Slabs
x
y
1x 2x
1y
2y
Ray – kd-tree traversal based on slabs
Rays vs. SlabsRays vs. Slabs
x
y
1x 2x
1y
2y
The current bounding box is the intersection of slabs
X slab
Y slab
Current Bounding Box
Rays vs. SlabsRays vs. Slabs
x
y
1x 2x
1y
2y
This ray intersects the current bounding box
Rays vs. SlabsRays vs. Slabs
x
y
1x 2x
1y
2y
We calculate the ray’s entry (tmin) and exit (tmax) distance for each slab
minxt
maxxt
Rays vs. SlabsRays vs. Slabs
x
y
1x 2x
1y
2y
We calculate the ray’s entry (tmin) and exit (tmax) distance for each slab
minxt
maxxt
minyt
maxyt
Rays vs. SlabsRays vs. Slabs
x
y
1x 2x
1y
2y
If the ray enters each slab before it exits any other slab, then it hits the bounding box
minxt
maxxt
minyt
maxyt
maxminyx tt maxminxy tt
Rays vs. SlabsRays vs. Slabs
x
y
1x 2x
1y
2y
How do we know that this ray misses the bounding box?
maxxt
minyt
maxyt
Rays vs. SlabsRays vs. Slabs
x
y
1x 2x
1y
2y
Because it exits the x slab before it enters the y slab
maxxt
minyt
maxyt
maxminxy tt
Rays vs. kd-treeRays vs. kd-tree
x
y
1x 2x
1y
2y
For a ray in a kd-tree, it is enough for a ray to keep track of where the ray enters the current bounding box (tmin) and where it exits (tmax)
minmin ttx
maxmax tt y
Beams vs. kd-treeBeams vs. kd-tree
How do we trace a beam through a kd-tree?
Beams vs. kd-treeBeams vs. kd-tree
How do we trace a beam through a kd-tree?
Kd-treeCurrent Bounding Box
Beams vs. kd-treeBeams vs. kd-tree
How do we trace a beam through a kd-tree?
Beam
Beams vs. kd-treeBeams vs. kd-tree
If we just use the tmins and tmaxes from the corner rays, the tmin/tmax points define a near and far plane for the active part of the beam. This works as long as all four corners take the same
path through the tree.
tmins
tmaxes
Beams vs. kd-treeBeams vs. kd-tree
But if the next split plane causes the beam’s rays to take different paths…
Next split plane
Beams vs. kd-treeBeams vs. kd-tree
…the new tmax value lies on a different kd plane from the other tmax values…
New tmax
Beams vs. kd-treeBeams vs. kd-tree
…and the new tmaxes define a new far plane…
Beams vs. kd-treeBeams vs. kd-tree
…which doesn’t fully represent the active portion of the beam.
Under-represented area
Beams vs. kd-treeBeams vs. kd-tree
This causes problems in 3D, when the corner of a split plane passes through a face of the beam. The beam on the right will only traverse the far side of
the split plane when both sides should be visited
Beams vs. kd-treeBeams vs. kd-tree
Another option…
Beams vs. kd-treeBeams vs. kd-tree
Split the beam where the split plane passes through the far plane of the active beam.
Beam split
Beams vs. kd-treeBeams vs. kd-tree
This assures that the tmins/tmaxes of all corner rays lie on the same kd-plane.
This works, but excessive splitting leads to slower render times.
Beams vs. kd-treeBeams vs. kd-tree
Instead we keep multiple tmin/tmax values, one for each dimension.
tmaxx
tmaxy
Beams vs. kd-treeBeams vs. kd-tree
The active part of the beam is the intersection of the beams defined by these planes.
Active part of beam
Beams vs. kd-treeBeams vs. kd-tree
To traverse the tree, we much check the tmins/tmaxes on all dimensions
Example: If all of the beam’s tmax values for the x-slab are less than the distance to the current split plane, only the near side of the plane needs to be traversed.
Beam tracing has many benefits over ray tracing Can be significantly faster when required sample
density is higher than the required geometric fidelity Area Samples vs. Point Samples Antialiasing, shading Perfect soft shadows and other secondary effects
Beam tracing old technique, assumed slow No longer true, viable method for real-time, shadows
Future WorkFuture Work
Area to area beams for faster soft shadows
Fall back on point samples when geometric fidelity is too high (tris smaller than pixel)
Multiresolution representations (aka Razor)
Explore other visual effects Specular to diffuse interactions (Caustics) Glossy reflections
The FutureThe Future
What is the future rendering algorithm?
Hybrid Beam Tracing/GPU ?
Hybrid Beam Tracing/Ray Tracing?
How does it depend on visual effects needed?
On future architectures?
Research ProjectsResearch Projects
High quality real-time rendering Real-time ray tracing All-frequency interactive relighting Volumetric scattering in mist, fog, rain