Transcript [talk]

Fast Global-Illumination
on Dynamic Height Fields
Derek Nowrouzezahrai
University of Toronto
John Snyder
Microsoft Research
Related Work
• static geometry [Sloan02; Ng04; …]
• dynamic geometry [Bunnell05, Ren06, Sloan07, Ritschel08]
3
Related Work
• screen-space shading [Shanmugam07;Ritschel09…]
– ignores view-occluded blockers
[Dimitrov08]
• horizon mapping [Max88; …]
– precomputation for hard shadows on static geometry
[Sloan&Cohen00]
4
Related Work
• fast soft-shadowing on dynamic height fields [SN08]
5
Goals
• all of [SN08] as well as
– dynamic indirect illumination
– glossy effects (direct and indirect)
6
Goals
[SN08]
Our results
7
Goals
• unified formulation for direct- and indirect-illumination
• diffuse and glossy bounces
• environmental + directional lighting
• dynamic geometry (not precomputed)
• real-time performance
• simple implementation
• limitation: geometry is a height field
• applications:
– terrain rendering (flight simulators, games, mapping/navigation)
– data visualization
8
Summary of Main Ideas
1.
approximate visibility & incident radiance w/ multi-resolution
-
create height and shading pyramids
sample from pyramid levels
pre-filter data
2.
compute visibility and radiance at discrete azimuthal directions
3.
determine final spherical visibility and incident radiance
9
Azimuthal Swaths [SN08]
• for smaller area (key) light sources:
– restrict azimuthal extent and use m = 3
 get sharper shadows
 acts as a geometric mask
 only sample where necessary
– env lights and incident radiance:
– complete swath and use m = 32
10
Definitions and Notation
blocking angle: (t)
angle p makes at t along 
incident radiance: u(t)
incident radiance at t towards p along 
u(t)
(t)
Sample  and u at all points t along direction .
11
Calculating the Max Blocking Angle
max
12
Calculating the Max Blocking Angle
t
Calculating the Max Blocking Angle
t
Calculating the Max Blocking Angle
t
Calculating the Max Blocking Angle
t
16
Calculating the Max Blocking Angle
t
Calculating the Max Blocking Angle
t
Calculating the Max Blocking Angle
t
Calculating the Max Blocking Angle
t
Calculating the Max Blocking Angle
max
t
21
Calculating the Incident Radiance

Which points on the height field contribute indirect radiance?
22
Calculating the Incident Radiance

Which points on the height field contribute indirect radiance?
Calculating the Incident Radiance

Which points on the height field contribute indirect radiance?
Calculating the Incident Radiance

Which points on the height field contribute indirect radiance?
Calculating the Incident Radiance

Which points on the height field contribute indirect radiance?
Calculating the Incident Radiance

Which points on the height field contribute indirect radiance?
Calculating the Incident Radiance

Which points on the height field contribute indirect radiance?
Calculating the Incident Radiance

Which points on the height field contribute indirect radiance?
Calculating the Incident Radiance

Which points on the height field contribute indirect radiance?
Calculating the Incident Radiance

Which points on the height field contribute indirect radiance?
Calculating the Incident Radiance

Which points on the height field contribute indirect radiance?
The set of points with monotonically increasing blocking angles.
We call this the casting set.
32
Brute Force Sampling – Pitfall…
Problem: aliasing – need many samples in t.
Solution: prefilter data, apply multi-scale sampling.
33
Multi-Resolution Height Sampling
fi
height pyramid level i
sampling distance for level i
Sample coarser levels further from x.
fi
fi-1
τi
fi-2
τi-1
τi-2
fi-3
τi-3
34
Multi-Resolution Radiance Sampling
u (i )  ui ( i )
ui
multi-scale incident radiance samples
radiance pyramid (for the previous bounce)
blocking angle at  i
i
Sample coarser levels further from x.
ui
ui-1
τi
ui-2
τi-1
τi-2
ui-3
τi-3
35
Summary of Main Ideas
1.
approximate visibility & incident radiance w/ multi-resolution
2.
compute visibility and radiance at discrete azimuthal directions
-
3.
analytic visibility and incident radiance
use normalized Legendre polynomials (NLPs)
determine final spherical visibility and incident radiance
36
Analytic Occlusion Elevation Function
• we start with the binary occlusion function:
 1, if   
v (;  )  
0, otherwise
v ( )
0
σ
1
and represent it analytically in the Normalized Legendre
Polynomial (NLP) basis:
37
Analytic Visibility and IR
• can represent visibility and incident radiance in NLP with v
v ( / 2)
v (max )
max
• visibility 1 binary function with 1 transition
from 0 to 1 @ max as  increases
1
-
u(t0 )v ((t0 ))
1
=
• incident radiance  piece-wise constant,
RGB function of elevation
+
v() 
max
+
u(t1 )v ((t1 ))  v ((t0 )) 
=
u(t2 )v ((t2 ))  v ((t1 )) 
0
u()
u(t2 )
u(t1 )
u (t0 )
38
Summary of Main Ideas
1.
approximate visibility & incident radiance w/ multi-resolution
2.
compute visibility and radiance at discrete azimuthal directions
3.
determine final spherical visibility and incident radiance
-
NLPSH blending & projection
fast shading pipeline
39
From Sampled NLP to Full SH
• given (2 x m) NLP vectors
• need full spherical functions (represented in SH)
• interpolate between azimuthal samples
+
project resulting spherical function into SH
• requires only 1 pre-computed matrix!
• matrix acts on NLP coefficients at edges of each swath
• rotate & sum across swaths for final SH
All operations performed in a single GPGPU shader. See
supplemental material for full source code.
40
Global Illumination Shading with SH
• at each shading point:
v &u
V &U
compute m azimuthal visibility + incident radiance NLP vectors
interpolate & project into SH. Rotate & sum across directions
Nxor R x
f(Nx )
or
BRDF: clamped cosine and/or Phong lobe
f(R x )
L
external lighting environment
41
Global Illumination Shading with SH
Direct Illumination:
BRDF x Visibility SH Product
Tx  Vx  f ( Nx )
and take inner product with lighting
Tx , L
Indirect Illumination:
BRDF take inner product with
Incident Radiance
f ( Nx ), U
42
Comparison to Ground Truth
m = 32
ground truth
43
Memory Usage
• we typically sub-sample visibility & IR
• shade with full-resolution geometry & normals
HF resolution
pyramid levels
256 x 256
memory requirements
no sub-sampling
2x sub-sampling
33
17.4 MB
4.5 MB
37
76 MB
20 MB
41
336 MB
88 MB
45
1.4 GB
360 MB
(130k triangles)
512 x 512
(522k triangles)
1024 x 1024
(2.1M triangles)
2048 x 2048
(8.4M triangles)
44
Measured Performance
HF resolution
256 x 256
(130k triangles)
512 x 512
(522k triangles)
1024 x 1024
(2.1M triangles)
FPS (nVidia GTX 285)
no ss
2x ss
4x ss
50
125
229
12
36
73
3
8
19
45
Results
47
Results
48
Conclusions
• multi-resolution sampling of:
• visibility
• incident radiance
• compact, analytic representation of:
• elevation-only functions
• SH interpolation and projection operators
• simple GPU implementation
• real-time up to 512x512 dynamic HFs
• can sub-sample visibility and incident radiance
• performance independent of geometric content
49
Future Work
• combine with dynamic shadow casters
– via [Ren06;Sloan07] (sphere set blocker approximation)
• apply to image-space global illumination frameworks
• generalize geometry
– local height field displacements
– tiled height field representations
50
We acknowledge the helpful suggestions of
the anonymous reviewers.
Thanks! Any questions?