Title: Hemispherical Rasterization for SelfShadowing of Dynamic Objects
1Hemispherical Rasterization for Self-Shadowing of
Dynamic Objects
- COMP238 Class Presentation, November 22, 2004
- Nico Galoppo von Borries
2Overview
- Self Shadowing Previous Work
- Precomputed Radiance Transfer
- Dynamic Transfer Vectors
- An Efficient Hemispherical Rasterizer
- Results and Optimizations
- Properties and Issues
3Self shadowing in the past
- Traditionally, real-time rendering has only used
point light sources or area lights for shading a
scene - Unrealistic, hard shadow boundaries
- Environment maps
- Provides realistic and dynamic spherical incident
lighting, but doesnt account for shadowing
effects
4Self shadowing in the past
- Ambient Occlusion
- Precompute visibility function
- Heres how it works
- Shoot rays over hemisphere (with importance
sampling) at point p and store the fraction that
doesnt hit other geometry - Produces nice soft shadows
- For static geometry only!
5Overview
- Self Shadowing Previous Work
- Precomputed Radiance Transfer
6Precomputed Radiance Transfer
- The basic idea is to extend dynamic environment
mapping with soft shadows - We want to compute the exitant radiance Lout,p(v)
from a point p into direction v
7Precomputed Radiance Transfer
- Transfer function Vp(s,v) is independent of p,
we can precompute it!
(static geometry diffuse BRDF)
8Efficient Radiance Transfer
- Heres a cool trick to do the hemisphere
integration efficiently - Project Lin(s) and Vp(s,v) into the orthonormal
basis B with basis functions bi(s) - This yields coefficient vectors Lin and Vp(v)
- Now, the integration is simply a dot product
Lout,p (v) Lin Vp(v) - Vp(v) is the transfer vector
- Advantages
- With the right basis, only limited number of
coefficients needed for good accuracy - Integral evaluation reduced to a simple dot
product operation
9Static Transfer Vectors
- Lout,p (v) Lin Vp(v), assume
- Static models
- Diffuse BRDF
- Then the transfer vectors Vp(v) are constants
and can be precomputed - Lighting is projected into basis B at run time
- Enables shading of static objects in
time-varying, spherical lighting environments
with soft shadows - Non-diffuse BRDF is possible but requires
transfer matrix instead of transfer vectors
10Which Basis B ?
- Spherical Harmonics (SH)
- Good for low-frequency lighting environments,
only few coefficients needed - Wavelets
- Preferable for higher-frequency lighting
- Coefficients that carry most energy is unknown at
preprocessing, thus the preprocess needs to
account for all basis functions
11What about animated scenes?
- One approach PCA reduction
- Compute transfer vectors for sparse set of frames
- Perform PCA and interpolate solutions for
intermediate frames in low-dimensional PCA basis - Still, precomputation is extremely long
- This paper addresses self-shadowing of dynamic
scenes in real-time
12Overview
- Self Shadowing Previous Work
- Precomputed Radiance Transfer
- Dynamic Transfer Vectors
13Dynamic Transfer Vectors
- Main contribution of this paper
- Basic idea compute transfer coefficients
Vp,i(v) on the fly (project into basis B) - Requires evaluation of the integral
- Represent Vp(s) as a discrete binary image, the
visibility mask
This is the only non-trivial term!
14Whats this visibility mask?
- Its a 1 bit framebuffer that holds the image of
blocker triangles, rendered by a spherical
rasterizer (by hemispherical projection) - Its a regular grid inside the unit disk
- Black blocked, White environment visible from p
15Advantage of Dynamic Transfer Vectors
- Why not just integrate lighting Lout,p(v)
directly, using this visibility mask? - SH basis function integration requires lower
resolution visibility mask to suppress aliasing
artifacts - If model with diffuse BRDF is static in some
frames, the coefficients can be reused
16Heres the Rendering Pipeline
- For all vertices p to be shaded, what is
Lout,p(v) ? - Visibility rasterization ? Visibility mask
- Compute transfer vector Vp(v)
- ?i
- This is all done in the same discrete 2D domain
as the visibility mask, just discrete sum of
multiples - Integrate over hemisphere by dot product Lout,p
(v) Lin Vp(v) - Pass Lout,p (v) to GPU for rendering
17Overview
- Self Shadowing Previous Work
- Precomputed Radiance Transfer
- Dynamic Transfer Vectors
- An Efficient Hemispherical Rasterizer
18Visibility Rasterization
- The domain of the visibility mask is a regular
grid inside the unit disk - Domain of the visibility function Vp(v) is the
unit hemisphere just drop the z coordinate to
get to domain of visibility mask - Compared to single plane sampling
- This reparameterization perfectly importance
samples the hemisphere according to cosine
distribution (Nussel analog) - Occluders near horizon arent missed
- Compared to hemicube sampling
- Only requires 1 pass (vs. 5)
- No depth sorting required (visibility function
is binary function)
19Now make it efficient!
- Whats the image of a blocker triangle in the
visibility mask? - Define 3 planes for each triangle
- Formed by v and each edge of the triangle
20Pixel inside triangle test
- Pixel belongs to the image of the triangle if
point on the hemisphere that corresponds to that
pixel is above all 3 planes defined by the edges
21Use Lookup Tables
- Precompute set of bitmasks for a discrete set of
planes - An edge normal from the set defines a particular
bitmask, stored in the lookup table - Triangle mask 3 edge bitmasks ANDed together
- Visibility mask Vp for point p by ORing all
blocker triangle images together
22Indexing the Lookup Table
- Cubemap the normal vectors defining the edge
planes - 6 x 128 x 128 cubemap
- For 32 x 32 bitmasks, results in 12 Mb of data
- This resolution provides visually accurate
results with good efficiency
23Overview
- Self Shadowing Previous Work
- Precomputed Radiance Transfer
- Dynamic Transfer Vectors
- An Efficient Hemispherical Rasterizer
- Results and Optimizations
24Demo (and probably a better explanation)
25Reduce of triangles to be rasterized
- Mesh Hierarchy
- Use a 2-level mesh hierarchy
- Assume smooth lighting conditions
- Far-away blocker triangles cast soft shadows
- Use the low-res mesh
- Close-by blocker triangles (one or two-ring) cast
sharp shadows - Use the high-res mesh
26Reduce of triangles to be rasterized
- Hierarchical Culling
- Group triangles together
- Update their bounding box during animation
- Test bounding box against tangent plane
- Only rasterize those groups above the tangent
plane
27Reduce of triangles to be rasterized
- Potentially Visible Sets
- If some prior information of the animation is
known, construct PVS for each vertex - Can be static or time-dependent
- Example
- Bottom of feet will never be visible to vertices
on the top of the head - If you dont buy that, please give a demo right
here!
28Results
- Tests performed on pretty high-end system Dual
3Ghz P4 Xeon
To be rasterized for visibility mask
29Overview
- Self Shadowing Previous Work
- Precomputed Radiance Transfer
- Dynamic Transfer Vectors
- An Efficient Hemispherical Rasterizer
- Results and Optimizations
- Properties and Issues
30Properties and Issues
- Scalability
- Complexity is proportional to
- Avg. Triangles vertices of the object
- Assuming that the low-res mesh remains fixed, the
cost of increasing the resolution of the high-res
mesh is linear. - This means you can compute lighting for extra
vertices at linear cost - But inter-object shadows increase complexity
quadratically - Project approximation of other shadow casting
objects onto the environment maps of the
receiving objects
31Properties and Issues
- Per-vertex Sampling
- Shadow artifacts
- Creep due to undersampling
- This problem is inherent to per vertex sampling
and common to other techniques (such as
per-vertex Monte-Carlo integration, radiosity, ) - Sacrifice quality for speed
32Properties and Issues
- Accuracy of the local geometry
- 2-level hierarchical culling introduces shadow
artifacts - 3D distance between triangles small
- Distance along surface is larger than 2-ring
- They propose a more complex spatial data
structure, but dont specify - Does anyone have any suggestions?
33Properties and Issues
- They compare to a GPU hemispherical rasterizer
- We need to subdivide the triangles to render
curved triangle edges in the hemispherical
projection - 16 times as many triangles need to be rasterized
much slower (only 0.76 FPS) - You dont want to do it anyway, because the GPU
is busy rendering background geometry anyway,
while the CPU is computes self-shadowing
34Conclusion
- Main contributions
- Dynamic transfer vectors (based on static
transfer vectors) - The SH basis transform gives visually accurate
results for fairly low-res visibility masks which
allows efficient integration - Efficient hemispherical rasterizer
35Conclusion
- Render dynamic objects with softself-shadows in
time-varying lighting environments - No prior information on the animation is needed,
although such information can be used for
optimization
36References
- Hemispherical Rasterization for Self-Shadowing of
Dynamic Objects - Jan Kautz, J. Lehtinen, T. Aila
- Proceedings of the Eurographics Symposium on
Rendering 2004 - Precomputed Radiance Transfer for Real-Time
Rendering in Dynamic, Low-Frequency Lighting
Environments - Peter-Pike Sloan, Jan Kautz, and John Snyder
SIGGRAPH 2002,July, 2002
37Thanks! Questions?