Participating media#

Piecewise medium (piecewise)#

Parameter

Type

Description

Flags

albedo

float, spectrum or volume

Single-scattering albedo of the medium. Default: 0.75

P,

sigma_t

float, spectrum or volume

Extinction coefficient in inverse scene units. The supplied grid must be of shape [1,1,n]. Default: 1.0

P,

scale

float

Optional scale factor that will be applied to the extinction parameter. It is provided for convenience when accommodating data based on different units, or to simply tweak the density of the medium. Default: 1.0

P

sample_emitters

boolean

Flag to specify whether shadow rays should be cast from inside the volume. If the medium is enclosed in a dielectric boundary, shadow rays are ineffective and turning them off will significantly reduce render time. This can reduce render time up to 50% when rendering objects with subsurface scattering. Default: true

(Nested plugin)

phase

A nested phase function that describes the directional scattering properties of the medium. When none is specified, the renderer will automatically use an instance of isotropic.

P,

ddis_threshold

float

Specifies the probability to importance sample the phase using the emitter as incident direction. Set to a negative value to disable. (Default: 0.1)

This plugin provides a 1D heterogeneous medium implementation (plane-parallel geometry), which acquires its data from nested volume instances. These can be constant, use a procedural function, or fetch data from disk, e.g. using a 3D grid, as long as the underlying grid has the shape [1,1,N], with N the number of layers on the vertical (z) axis.

The medium is parametrized by the single-scattering albedo and the extinction coefficient \(\sigma_t\). The extinction coefficient should be provided in inverse scene units. For instance, when a world-space distance of 1 unit corresponds to 1 metre, the extinction coefficient should have units of inverse meters. For convenience, the scale parameter can be used to correct the units. For instance, when the scene is in meters and the coefficients are in inverse millimetres, set scale to 1000.

Both the albedo and the extinction coefficient can either be constant or textured, and both parameters are allowed to be spectrally varying.

<!-- Declare a piecewise participating medium named 'smoke' -->
<medium type="piecewise" id="smoke">
    <!-- Acquire extinction values from an external data file -->
    <volume name="sigma_t" type="gridvolume">
        <string name="filename" value="frame_0150.vol"/>
    </volume>

    <!-- The albedo is constant and set to 0.9 -->
    <float name="albedo" value="0.9"/>

    <!-- Use an isotropic phase function -->
    <phase type="isotropic"/>

    <!-- Scale the density values as desired -->
    <float name="scale" value="200"/>
</medium>

<!-- Attach the index-matched medium to a shape in the scene -->
<shape type="obj">
    <!-- Load an OBJ file, which contains a mesh version
         of the axis-aligned box of the volume data file -->
    <string name="filename" value="bounds.obj"/>

    <!-- Reference the medium by ID -->
    <ref name="interior" id="smoke"/>
    <!-- If desired, this shape could also declare
        a BSDF to create an index-mismatched
        transition, e.g.
        <bsdf type="dielectric"/>
    -->
</shape>

Heterogeneous medium (Earth Observation) (eoheterogeneous)#

Parameter

Type

Description

Flags

albedo

float, spectrum or volume

Single-scattering albedo of the medium (Default: 0.75).

P,

sigma_t

float, spectrum or volume

Extinction coefficient in inverse scene units (Default: 1).

P,

scale

float

Optional scale factor that will be applied to the extinction parameter. It is provided for convenience when accommodating data based on different units, or to simply tweak the density of the medium. (Default: 1)

P

sample_emitters

boolean

Flag to specify whether shadow rays should be cast from inside the volume (Default: true) If the medium is enclosed in a dielectric boundary, shadow rays are ineffective and turning them off will significantly reduce render time. This can reduce render time up to 50% when rendering objects with subsurface scattering.

(Nested plugin)

phase

A nested phase function that describes the directional scattering properties of the medium. When none is specified, the renderer will automatically use an instance of isotropic.

P,

ddis_threshold

float

Specifies the probability to importance sample the phase using the emitter as incident direction. Set to a negative value to disable. (Default: 0.1)

aabb_min, aabb_max

point

Optional override to the medium bounding box. Uses the bounding box of the sigma_t volume by default.

This plugin provides a flexible heterogeneous medium implementation, which acquires its data from nested volume instances. These can be constant, use a procedural function, or fetch data from disk, e.g. using a 3D grid.

This plugin is identical to the ``heterogeneous ` plugin but accepts additional parameters to set the medium’s bounding box. It is possible to set volumes that span a portion of the medium’s bbox, and thus exploit wrapping mechanism, e.g. periodic boundaries, outside this portion.

The medium is parametrized by the single scattering albedo and the extinction coefficient \(\sigma_t\). The extinction coefficient should be provided in inverse scene units. For instance, when a world-space distance of 1 unit corresponds to a meter, the extinction coefficient should have units of inverse meters. For convenience, the scale parameter can be used to correct the units. For instance, when the scene is in meters and the coefficients are in inverse millimeters, set scale to 1000.

Both the albedo and the extinction coefficient can either be constant or textured, and both parameters are allowed to be spectrally varying.