parti_volume

 
 
 

Category: mental ray > Volume

Shader Family: Volume

Output: Color

Fog, clouds, silty water, and similar media scatter some of the light that travels through it,and therefore, these media are said to participate in the light transport. A volume shader is needed to simulate participating media.

The parti_volume shader can simulate homogeneous (uniform density) and non-homogeneous 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 Murky

0.50

-0.46

0.46

Hazy Mie

0.12

-0.50

0.70

Mie

0.19

-0.65

0.91

Name

The name of the shader node displayed in the render tree. Enter any name you like, or leave the default.

mode

When mode is set to 0 (zero), the participating medium fills the entire volume.

When mode is set to 1, there is only participation medium below the given height, and there is clear air or vacuum above.

scatter

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 extinction coefficient is inverse.

extinction

The extinction coefficient of the medium. It determines how much light is absorbed or scattered in the medium. 0 (zero) means clear air or a vacuum. The higher the coefficient, the denser the medium (and the more photon scattering). Note that a high extinction coefficient doesn't allow photons to enter deep into the volume, as they are already scattered after a short distance.

r g1 g2

Controls for scattering.

If both g1 and g2 are zero (the default), isotropic scattering is modeled, and 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:

  • backscattering ( -1 < g < 0)

  • diffuse/isotropic (g = 0)

  • forward scattering ( 0 < g < 1)

    The first lobe is weighted by r and the second lobe by 1 - r.

nonuniform

Determines if the medium is homogeneous (uniform density) or non-homogeneous (cloud-like density variation). Specify a number between 0 and 1.

  • A value of 0 (zero) makes the medium 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

When the mode iparameter s set to 1, this option determines the height above which there is clear air or vacuum.

min_step_len

max_step_len

Determines the step length for ray marching. Usually keep the minimum value at 10 percent of the maximum value. The smaller the maximum 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

Optimizes the sampling of area light sources. It is used if the area light source has the optional lower sampling. 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 (in this case 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 (in this case 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

This parameter is ignored (it is used by the corresponding parti_volume_photon shader).

no_globil_where_direct

Tells the shader not to calculate global illumination in the volume effect but just the direct illumination. This 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

Creates a light list to specifiy which lights should produce the effect. For more information, see Using Light Lists [Direct Illumination].

Creative Commons License Except where otherwise noted, this work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License