Graphics Reference
In-Depth Information
Light source
Light source
(b)
Figure 2.12 (a) When photon mapping is used for caustics, photons are only fired through the refractive
object and only recorded where the caustic appears. (b) For global illumination, photons
are fired in all directions and are recorded everywhere.
(a)
In either case, the photon map is initially stored as a list. Once the particle
simulation phase is complete, they are moved to a structure called a k d-tree. This
k d-tree is sometimes what is meant by the “photon map.” The k d-tree not only
compresses the data, but also accelerates lookup of surrounding photons indepen-
dent of the scene geometry. This decoupling of geometry from lighting is one of
the major advantages of photon mapping.
2.4.3 Rendering Using a Photon Map
In the second stage of photon mapping, the rendering stage, the reflected radi-
ance at a point is interpolated from information contained in surrounding photons
contained in the map. The calculation is based on a density estimation in an
approximation sphere around the point to be shaded. The incoming radiance is
regarded as coming from the collection of photons in the sphere ( Figure 2.13 ) ,
which is determined by finding the k photons nearest the sample point for some
fixed k . The sum of these photons, each normalized by the cross-sectional area of
the sphere and scaled by the BRDF value in the appropriate direction, produces
the outgoing radiance:
p = 1 f r ( x , ω p , ω ) ΔΦ p ( x , ω p )
n
L
(
x
, ω )
.
(2.14)
π
r 2
Note that storing the direction as well as its power is necessary for this calculation.
Equation (2.14) may seem a crude approximation compared to the error-driven
approach of irradiance caching, but the results are visually plausible and it has the
advantage of being very fast to compute.
 
Search WWH ::




Custom Search