home << prev next >> contents  


Photon Tracing in Participating Media

In order to compute volume caustics and global illumination in participating media, the media need volume photon shaders. A volume photon shader will usually have the same name as the corresponding volume shader, but with " _photon" appended. Details on photon tracing in volumes can be found in the mental ray manual.

Volume Photon Shader: parti_volume_photon

parti_volume_photon is the volume photon shader that matches parti_volume. It has the same parameters.

    color "parti_volume_photon" (
            integer     "mode",
            color       "scatter",
            scalar      "extinction",
            scalar      "r",
            scalar      "g1",
            scalar      "g2",
            scalar      "height",
            scalar      "nonuniform",
            scalar      "min_step_len",
            scalar      "max_step_len",
            scalar      "light_dist",
            integer     "min_level",
            boolean     "no_globil_where_direct",
            array light "lights")

scatter is the color of the scattering medium. This determines the color of the indirect light that is scattered by the medium. It also acts as a multiplier of the photon energy for the photons in the photon volume map. Note that in mental ray there are three data structures where photon can stored: the GI, the caustics and the volume photon photon map, the first two can be independently color corrected.

min_level is the minimum refraction level at which photons are stored. This is handled differently for caustic and GI photons. For GI photons the maximum level is set with the global option photon_refraction_depth. Caustics photons storage is very different. It depends on more variables. First the global option photon autovolume can be set or not. If it is not set then caustic photons are only stored after at least one refraction or reflection. If it is set, and the light source is inside the volume then caustic photons can be stored. If the light source is outside the volume, then caustic photons are only stored after at least one refraction or reflection.

light_dist, no_globil_where_direct, and lights are ignored since there is no direct illumination in the photon shader.

All other parameters, especially extinction, need to be identical to the parameters of parti_volume, this to preserve consistency in the algorithm.

Material Shader: transmat

This is a material shader for a helper surface of a participating medium. It simply traces a ray further in the direction it came from. Helper objects are used to enclose volume effects such as participating media implemented as volume shaders, without being visible themselves.

      color "transmat" ()
  

There are no parameters.

Photon Shader: transmat_photon

transmat_photon is the material photon shader that matches transmat. It has the same parameters. It simply traces a photon further in the direction it came from.

    color "transmat_photon" ()

There are no parameters.

home << prev next >> contents  


Copyright (©) 1986-2006 by mental images GmbH