Participating Media
Fog, clouds, silty water, and similar media scatter some of
the light that travels through it. In other words, these media
participate in the light transport (see [Jensen 98]). A volume
shader is needed to simulate participating media.
Volume Shader
The volume shader parti_volume can simulate homogeneous
(uniform density) and nonhomogeneous participating media with
isotropic (diffuse) or anisotropic scattering.
parti_volume and
parti_volume_photon use a two-lobed
scattering model, which means that light scatters both forward
and back in the incoming light direction. This scattering model
is invented by Ch. Schlick and can model real scattering from
dust, mist, rain-drops, etc.
Any medium (other than a vacuum) is assumed to contain
suspended particles which scatter light traveling through it.
Scattering plays an important role in the shading of volumes, and
it is the size of the particles in relation to the wavelength of
light which determines the type of scattering. If the particle
radii are much smaller than the wavelength of light, there is no
discernible scattering and the light is absorbed. Particles only
slightly smaller than the wavelength of light produce what is
known as Rayleigh scattering (cigarette smoke and dust).
Particles roughly the same size as the wavelength of light give
rise to Mie scattering (water droplets or fog). The Mie model can
account for both sparse and dense particle densities, referred to
as Hazy Mie and Murky Mie respectively. When the particle size is
much larger than the wavelength of light, geometric optics comes
into effect (normal solid surfaces). Glassner suggests the
following values:
function | r | g1 | g2
|
Rayleigh | 0.50 | -0.46 | 0.46
|
Hazy Mie | 0.12 | -0.50 | 0.70
|
Murky Mie | 0.19 | -0.65 | 0.91
|
parti_volume
color "parti_volume" (
integer "mode",
color "scatter",
scalar "extinction",
scalar "r",
scalar "g1",
scalar "g2",
scalar "nonuniform",
scalar "height",
scalar "min_step_len",
scalar "max_step_len",
scalar "light_dist",
integer "min_level",
boolean "no_globil_where_direct",
array light "lights")
- mode
- in mode 0, the participating medium fills the
entire volume. In mode 1, there is only participation medium
below the given height, and there is clear air or vacuum above.
- scatter
- is the color of the scattering medium. This determines the
color of the direct and 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. Its dependency with the extintion coefficient is inverse.
- extinction
- is the extinction coefficient of the medium.
It determines how much light is absorbed or scattered in the
medium. 0 means clear air or vacuum. The higher the coefficient,
the denser the medium (and the more photon scattering). Note that a high extinction
coefficient doesnt allow photons to enter deep into the volume, as
they are already scattered after a short distance.
- r
g1
g2 - control scattering. If both
g1 and g2 are zero (the default), isotropic scattering is
modeled: all scattering directions have equal probability. This
is sometimes also called diffuse scattering. Anisotropic
reflection is modeled by a two-lobed scattering model. Each lobe
can be either backscattering ( -1 < g <
0), diffuse (isotropic, g = 0), or forward scattering
( 0 < g <
1). The first lobe is weighted by r, the second lobe
by 1 - r.
- nonuniform
- determines if the medium is homogeneous
(uniform density) or nonhomogeneous (cloud-like density
variation). It is a number between 0 and 1. A value of 0 makes
the medium is completely homogeneous and depends only on the
extinction parameter. A value of 1 creates a cloud-like Blinn
density variation. Values between 0 and 1 give a mix between the
two extremes.
- height
- determines the height above which there is clear
air or vacuum if the mode parameter is 1.
- min_step_len
max_step_len - are used to determine the
step length for ray marching. Usually keep the min value at 10 percent
of max. The smaller the max is, the more accurately, though slowly,
the volume steps will be sampled for visibility. The same parameter
is used in
parti_volume_photon
for volume photon lookup.
- light_dist
- is used for optimization of the sampling of
area light sources. It is used if the area light source has the
optional lower sampling, as in for example
rectangle 0.5 0.0 0.0 0.0 0.0 0.5 10 10 3 2 2
- For efficiency, parti_volume always uses the lower
number of samples (here 2 2). This is usually sufficient since
the direct illumination is computed at many points along each ray
during ray marching. However, the higher number of samples (here
10 10) should be used near an area light source. The light_dist
parameter determines how far away from a light source the higher
number of samples have to be used.
- min_level
- is ignored (it is used by the corresponding
volume photon shader).
- no_globil_where_direct
- tells the shader to not calculate
global illumination in the volume effect but just the direct
illumination. The parameter is for optimization if such contribution
is not required. When set to 1 (on) the parameters relative to the
directionality of the scattering effect, r, g1, and
g2 are not taken into account for the indirect illumination,
they are however evaluated for direct illumination.
- lights
- is an array of light instances.
If no lights are specified then the light list
in the geometry instance is used. If no instance light list is specified
then all lights in the scene are used.
Transparent Material
Deprecated This is a material shader for a helper
enclosing surface of a participating medium or volume that is not a mental ray
hull object. It simply continues to trace the incoming ray in the
same direction without any interaction with the current object. Such a volume
container should be invisible itself.
transmat
color "transmat" ()
There are no parameters.
Copyright (©) 1986-2009 by
mental images GmbH