15.6.3 BUILDING THE PHOTON MAPS

When the Preprocess() method is called, particle paths are followed through the scene until the integrator has accumulated the desired number of particle histories to build the photon maps. Three separate photon maps are created: one to store photons that represent the direct illumination, one for indirect lighting, and one for caustics. (The direct illumination photons are used only during this preprocessing step and are freed at the end of this method.) At each intersection of the path with an object, a weighted particle contribution is stored if the map for the corresponding type of illumination is not yet full. This phase of computation is executed in parallel; the concurrently running tasks must therefore ...

Get Physically Based Rendering, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.