Photon tracing creates a photon map (see Photon maps), which is used by mental ray for Maya to render global illumination and caustics.
Photons work as follows:
To turn on photon tracing, see Turn on photon emission for a light source.
Photons are stored only if the following conditions are met:
All Maya materials (Lambert, Blinn, and so on) store photons, as long as the Diffuse attribute is not set to 0.
Some custom mental ray for Maya shaders do not store photons
The first surface hit, the illumination of which is handles by direct (not indirect) illumination, is not stored in the map.
Photons have both a direction and a position; directional lights have only a direction, so mental ray for Maya can’t determine the position of photons. As a result, too many photons are emitted but not recorded in the photon map, rendering resources are wasted, and artifacts can appear.
For general information about photon tracing, see Photon maps.
Some photon shader parameters work a little differently than their Maya counterparts. Besides carrying color (or other relevant) information, some parameters also determine the probabilities of how photons interact with objects.
These probabilities (P) are computed as follows:
P3 = P(transmission) = INTENSITY(transparency) P(diffuse transmission) = translucence P(specular transmission) = 1 - translucence P2 = P(specular reflection) = reflectivity * INTENSITY(specularColor) P1 = P(diffuse reflection) = diffuse * INTENSITY(color) * (1 - INTENSITY(transparency)) P0 = P(absorption) = absorbs * (2.0 - P1 - P2 - P3)
The interaction with the highest P-value is most likely to be chosen. So, the ratios of the P-values determine what fraction of the incident photons are refracted (transmitted), reflected, and absorbed, respectively. The probabilities match the Maya materials in that derivation from Maya will give satisfactory results.
Note first that photons are only stored when hitting a diffuse surface. So if P1 is zero for a specific instance, no photons are stored. To improve performance, you should disable the Caustic and Global Illumination.
Translucence determines what fraction of all refracted (transmitted) photons are diffusely transmitted and translucenceFocus controls the diffusity.
Absorption takes place only if the intensity of each color involved is less than one and Diffuse and Reflectivity are within the prescribed range.
If the probability for specular reflection P2 is greater than zero, either a non-zero Shinyness (isotropic), or non-zero spreadX and spreadY (anisotropic) must be specified.
Diffuse green reflection with red diffuse transmission
absorbs on diffuse 1.5 color 0.0 1.0 0.0 transparency 1.0 0.0 0.0 translucence 1.0 1/6 diffuse transmission 1/6 diffuse reflection 2/3 absorption
Full specular refraction (caustics)
refractions on refractiveIndex 1.5 transparency 0.9 0.9 1.0 1/1 specular transmission
Diffuse green reflection with specular isotropic blue reflection
reflectivity 0.8 specularColor 0.7 0.7 1.0 whiteness 1.0 1.0 1.0 shinyness 20.0 diffuse 0.2 color 0.4 1.0 0.4 3/19 diffuse reflection 16/19 specular reflection