Title: Photon-driven Irradiance Cache
1Photon-driven Irradiance Cache
- J. Brouillat P. Gautron K. Bouatouch
- INRIA Rennes University of Rennes1
2Motivations
? Photon-Driven Irradiance Cache
- Global Illumination in scenes with complex light
interactions - Indirect diffuse component is very important for
the overall aspect of final rendering - Multiples bounces, any lighting, large scenes
(architectural design, walkthrough) - Interactive or view-independent
- Fast preview of good quality
3Previous work
? Photon-Driven Irradiance Cache
- Mesh-based
- Radiosity Lightmaps Goral et al. 84 compute
a solution for the whole scene at once, can be
interactively displayed, Discontinuity meshing
Lischinski 92 - Point-based
- Irradiance Cache Ward et al. 88 Irradiance is
sparsely sampled over surfaces - Radiance cache splatting Gautron et al. 05
interactive display of an irradiance cache - Photon mapping Jensen 96 divides light flux
into photons - Complex lighting, very large scenes Christensen
et al. 04 - Final gathering combined with irradiance cache
4Previous work
? Photon-Driven Irradiance Cache
- Point-based (continued)
- Instant radiosity Keller 97 approximate
indirect lighting using several virtual
point-light sources (VPLs) - Many-light sources problem Lightcuts Walter et
al. 05, Matrix Row-Column Sampling Hasan et al.
07 - Incremental Instant Radiosity Laine et al. 07
interactive, limited to one bounce interactions - Metropolis Instant Radiosity Segovia et al. 07
reduce the number of VPLs used, view dependent - Direct-to-indirect transfer Hasan et al. 06
samples surface with points, precompute
contribution of these points to final image - Dynamic lights, fixed scene/viewpoint
- High-quality interactive relighting , large
precomputation time (hours) - Meshless Hierarchical basis Lehtinen et al. 08
- Dynamic lights and viewpoint, long precomputation
time.
5Our approach
? Photon-Driven Irradiance Cache ? Our algorithm
- Point-based short precomputation time view
independency - How combination of photon maps and irradiance
cache - Photon map
- Elegant method, widely used
- Any kind of light sources, multiple bounces,
highly dense environments, large scenes - Irradiance caching
- Interactive display, compact representation, no
surface parameterization - Compute a view-independent irradiance cache from
a photon map - Advantages
- Fast view-independent preview of photon map
simulations - Uses GPUs (splatting)
- Easy to implement
6More precisely
? Photon-Driven Irradiance Cache ? Our algorithm
- Photon Mapping
- () View-independent lighting simulation
(scattering photons) - (-) Rendering is either noisy or costly (final
gathering), and view-dependent - Irradiance Cache
- () Interactive rendering of the cache for static
scene, high quality - (-) View dependent new records have to be
created when walking through unexplored parts of
the scene. Records cover the whole scene many
viewpoints - Our approach
- We first compute a coarse irradiance cache from a
photon map - Covers the whole scene view independent
- No additional rays to be cast
- Interactive fast preview of the photon map
solution - This coarse cache can be refined using final
gathering - Reduce the number of rays cast, using visibility
information from the photon paths
7Irradiance cache data structure
? Photon-Driven Irradiance Cache ? Irradiance
cache
- Irradiance cache set of records
- A record
- Position (vector)
- Harmonic mean distance, DH, from record to other
objects of the scene (scalar) - Irradiance value (vector)
- Irradiance gradient (vector)
- Deduce these values from a photon map
8Algorithm overview
? Photon-Driven Irradiance Cache
- 1st pass
- Building a classical photon map
- 2nd pass, from the photon map
- Deduce position of irradiance records and
harmonic mean distance - Compute coarse irradiance values for each record
- Coarse irradiance cache can be used for
interactive (pre-)vizualisation - 3rd pass
- Refine irradiance values associated with each
record using final gathering, compute gradients - Can be done in parallel with previzualisation
- Refine first the visible records
9First Pass Photon map
? Photon-Driven Irradiance Cache ? First pass
- Scattering the photon across the scene
- We fix a minimal number of bounces, then use
Russian Roulette
direct lighting
photon map 250k photons
10Second Pass Irradiance record positions
? Photon-Driven Irradiance Cache ? Second pass
- We want the cache to cover most part of the scene
(avoid cache misses) - Records need to be created at each point where
incident irradiance is not null - Photon represents incident light
- We use photon positions as candidates for
records - As we process each photon position, we have to
decide whether to create a new record or not.
11Irradiance record positions
? Photon-Driven Irradiance Cache ? Second pass
- We start with an empty cache
- The record A is created at photon a position
- This record have a zone of influence
- Inside this zone, the irradiance stored in the
record A will be used for interpolation. - Its data structure is augmented with a new field
giving a list of all the photons within its zone
of influence (kd-tree query)
1
12Irradiance record positions
? Photon-Driven Irradiance Cache ? Second pass
- Photon b lies inside the zone of influence of a
previous created record - No need to create a new record at b position
- How do we know it ?
- In classical irradiance caching, the records are
stored in an octree - Octree query provide the neighborhood of b
- Millions of photons too costly
- Our approach avoids any octree query
- How new field in the photon data structure
- wc cumulative contribution of neighbour records,
updated at the creation of each record
2
13Irradiance record positions
? Photon-Driven Irradiance Cache ? Second pass
- Decision on creating a new record or not relies
on wc - For photon c, wc is less than a given threshold
not enough records around it - Then a new record C is created at photon position
- wc field of all the photons lying in the zone of
influence of C is updated
3
14Harmonic mean distance estimation
? Photon-Driven Irradiance Cache ? Second pass
- Irradiance records need to carry DH, the harmonic
mean distance to objects of the scene - DH is used to determine the size of the zone of
influence of the record - Bad estimation leads to artifacts during rendering
15Harmonic mean distance estimation
? Photon-Driven Irradiance Cache ? Second pass
1
- Usually done by casting rays towards the scene
- We want to deduce DH from the photon maps without
additional ray casting
16Harmonic mean distance estimation
? Photon-Driven Irradiance Cache ? Second pass
2
- Photons store information about the distance
between subsequent hit points - Photons close to a record K give us information
about visibility around K
17Harmonic mean distance estimation
? Photon-Driven Irradiance Cache ? Second pass
- By reprojection, we estimate visibility around K
without casting rays - This may miss some occluders, and introduce
errors - We use only photons close to K
- inside the zone of influence
- Neighbour clamping Krivanek et al. 06
- Reduction of DH based on neighbour records
(borders,)
3
18Estimating irradiance from photon map
? Photon-Driven Irradiance Cache ? Second pass
- We estimate incoming irradiance at record
positions with density estimation - Usually, search for the n-nearest neighbours
photons in a kd-tree - Automatic adaptation with actual density of
photon at P - n can be seen as a trade off between noise and
blur in the final image
n ?
P
Irradiance at P sum of flux carried by n
photons divided by area A
19Estimating irradiance from photon map
? Photon-Driven Irradiance Cache ? Second pass
- Records with large zone of influence may have
high visual importance on the final rendered
images - Blur is visually more pleasant than noise, for
previews - We want n vary depending on the size of the zone
of influence - To this end, we use a range-search approach
- Search for the nearest photon lying in the zone
of influence
r
P
r a.DH
20Coarse irradiance cache
? Photon-Driven Irradiance Cache ? Second pass ?
Results
- 250 k photons, 4 bounces
- PM 0.8 sec
- Cache Generation 1,20 sec
- Irradiance values
- Still some noise
- no gradients
- Interactive visualization
- Fast preview of global illumination solution from
a photon map
21Third Pass Refining the cache
? Photon-Driven Irradiance Cache ? Third pass
- We would like to refine the coarse cache
- More accurate estimation of irradiance for each
record - Compute irradiance gradients
- We use gradients from Krivanek et al. 05
- dividing the hemisphere into cells and by casting
rays (final gathering) - We want to save rays thanks to information
contained in the photon map
22Refining the cache
? Photon-Driven Irradiance Cache ? Third pass
- Like DH estimation, reuse visibility information
from photons - Photons are linked along a path
- Instantly retrieve the photon corresponding to
last hit point - Assign each last-hit-point-photon to a cell of
the hemisphere.
1
23Refining the cache
? Photon-Driven Irradiance Cache ? Third pass
- Photons have been assigned a cumulative
irradiance value at the end of the 2nd pass - If a cell has been assigned a photon
- Fast estimation of incident radiance
- No ray cast
2
24Refining the cache
? Photon-Driven Irradiance Cache ? Third pass
- Cast rays through non already assigned cells
- Incident radiance along the ray
- search for the nearest photon at intersection
point - Compute irradiance and gradients
- Possible to refine DH
- Consequence creation of new records
3
25Results
? Photon-Driven Irradiance Cache ? Third pass ?
Results
- Cornell Box (32 poly.)
- 250 k photons, 4 bounces
- Total time 6.7 sec
- PM 0.8 sec
- Cache Generation 1,20 sec
- Refinement 4.6 sec
- 39 saved rays (compared to brute force final
gathering per record) - visualization 40 fps
Results gathered on a Pentium4 3.8 Ghz computer,
2GB RAM, NVidia GeForce 7800 GTX 512MB
26Results
? Photon-Driven Irradiance Cache ? Third pass ?
Results
- Sibenik Cathedral (80k poly.)
- 4 M photons, 9 bounces
- Total time 204 sec
- PM 30 sec
- Cache Generation 12 sec
- Refinement 162 sec
- 46 saved rays
- Visualization 5 fps
Results gathered on a Pentium4 3.8 Ghz computer,
2GB RAM, NVidia GeForce 7800 GTX 512MB
27Fast preview comparison
? Photon-Driven Irradiance Cache ? Comparisons
- End of 2nd pass
- View-independent 28.3 11.9 sec
- View-dependent 28.3 1.5 sec
- End of 3rd pass
- View-independent 28.3 174 sec
- View-dependent 28.3 26 sec
28Refined cache comparison
? Photon-Driven Irradiance Cache ? Comparisons
- Stochastic ray tracing
- 900 rays / pixel 1300 sec
- View dependent
- Photon-driven Irradiance Cache
- 7 sec, view independent
- Interactive visualization
29Refined cache comparison
? Photon-Driven Irradiance Cache ? Comparisons
- Stochastic ray tracing
- 900 rays / pixel 3hour
- View dependent
- Photon-driven Irradiance Cache
- 204 sec, view independent
- Interactive visualization
30Conclusion
? Photon-Driven Irradiance Cache
- Combination of photon maps and irradiance cache
- Compute an irradiance cache from a photon map
- Fast view-independent preview of photon map
simulations - High-quality after refinement
- Easy to implement
- Future works
- Parallelization of irradiance cache creation
- Glossy surfaces, using a radiance cache Krivanek
et al. 05 - Out-of-core aspects (very large scenes)
31Questions?
? Photon-Driven Irradiance Cache
Fin
32Our approach
? Photon-Driven Irradiance Cache ? Our algorithm
- Point-based short precomputation time view
independency - How combination of photon maps and irradiance
cache - Photon map
- Elegant method, widely used
- Any kind of light sources, multiple bounces,
highly dense environments, large scenes - Irradiance caching
- Interactive display, compact representation, no
surface parameterization - Compute a view-independent irradiance cache from
a photon map - Advantages
- Fast view-independent preview of photon map
simulations - Uses GPUs (splatting)
- Easy to implement
33More precisely
? Photon-Driven Irradiance Cache ? Our algorithm
- Photon Mapping
- () View-independent lighting simulation
(scattering photons) - (-) Rendering is either noisy or costly (final
gathering), and view-dependent - Irradiance Cache
- () Interactive rendering of the cache for static
scene, high quality - (-) View dependent new records have to be
created when walking through unexplored parts of
the scene. Records cover the whole scene many
viewpoints - Our approach
- We first compute a coarse irradiance cache from a
photon map - Covers the whole scene view independent
- No additional rays to be cast
- Interactive fast preview of the photon map
solution - This coarse cache can be refined using final
gathering - Reduce the number of rays cast, using visibility
information from the photon paths
34Estimating irradiance from photon map
? Photon-Driven Irradiance Cache ? Second pass
- Boundary bias error in estimation of area A
- Over estimation around geometry boundaries
- Under estimation on curved surfaces
- Light leaks
- Since were doing much less density estimations,
we can use techniques to compute a more accurate
approximation of A - Convex hull Jensen01, OctoBoxes, Geometry
feelers Tobler et al. 06,
convex hull
35Direct visualization of photon map
? Photon-Driven Irradiance Cache ? Second pass ?
Comparison
- ? Our method
- ? 250k photons
- ? 2 sec
- ? View independent
- ? Interactive display
- ? 12 DE / record
- ? Photon Mapping
- ? 250k photons
- ? n 32
- ? 4 sec
- ? View dependent
- ? 1 DE / pixel
- ? Photon Mapping
- ? 50k photons
- ? n 128
- ? 4 sec
- ? View dependent
- ? 1 DE / pixel
- ? Christensen 99 caching
- ? 50k photons
- ? n 128
- ? 1,25 2.5 sec
- ? View dependent
- ? 1 DE / photon