PhotonMapping
From Odwiki
Photon mapping is one method of performing BackwardsRayTracing. Rather than sending rays from a camera into the scene and then sampling the direct illumination, Photons are sent from the light sources into the scene. The photons bounce off surfaces and eventually get stored in a PhotonMap. The PhotonMap can be used to estimate Caustics.
So, in essence, Photon Mapping is a two pass process, the first pass generates the photon map and the second pass uses the photon map to compute illumination. If only the camera is moving in the scene, then the photon map may be generated once and used for all subsequent frames. Storage
Typically, photon maps are stored in a k-d tree data structure. This allows the nearest K points to be quickly queried for evaluation.
Contents |
Photon Mapping in Mantra
PBR engine
If you're rendering with PBR, much the setup for photon mapping is implicitly defined in the way that PBR works and so there is a easy and more accurate simulation of photons for direct and indirect light. Mostly this boils down to you only really needing to set up two Mantra ROPs - one to generate the photons and one to utilize the photon maps. You are not required to use any Photon Shaders at all since the method for light propagation is built into the BSDF (the PBR lighting model).
Micropolygon and Raytracing engines
To generate a photon map for the non-PBR render pipeline, you need to have an output driver dedicated to photon generation. The Specific tab of the output driver has a toggle which enables photon map generation or not. When the button is enabled, no image will be generated from the output driver, only a photon map. Two separate maps may be generated by this output driver
| Global Photon Map | This map is used to store photons which don't hit any specular surfaces |
| Caustic Photon Map | This map is used to store photons which were reflected or refracted in a specular LightPath. |
Unless a light source has "Photons Contribute To Direct Illumination" turned on, photons which leave the light source and don't bounce off any surfaces will not get added to the Global Photon Map.
The easiest way to access the PhotonMap is to use the VEXGlobalIlluminationSHOP shader. The second tab has parameters to specify the global and caustic photon maps generated in the previous step.
Photon Mapping in RenderMan
TODO
Photon Mapping in MentalRay
TODO



