BaseVolume

Overview

BaseVolume is a volume shader meant to be applied to a water tight mesh. The volume is homogenous by default but can be made heterogenous by binding maps to any of the attributes.

You can apply map shaders to any attribute of a volume shader, such as:

  • anisotropy
  • emission
  • color
  • density

Map bindings are evaluated and baked into a precomputed grid for fast lookups during rendering. The resolution of the grid is based on the attributes bake_resolution_mode, bake_divisions and bake_voxel_size. See the attribute documentation for details.

There are some caveats to binding maps to volume shader attributes:

  • Evaluating a map (baked grid) is slower than evaluating a constant value. MCRT will take longer to converge.
  • Memory usage is increased due to the baked attribute grid.
  • Only 3D position maps can be bound to the attributes. 2D surface data (texture coordinates, normals, etc) do not work with volumes.

Attribute Reference

Attenuation Properties attributes

attenuation_color

Rgb bindable
default: [ 1, 1, 1 ]

A color to tint (multiply to) the attenuation. Technically the product of attenuation color and intensity is the attenuation (extinction) coefficient.(Note the inverse behavior of color with this parameter.)

attenuation_color: (0,0,0) | (1,1,1)

attenuation_colors

RgbVector
default: [[ 1, 1, 1 ], [ 0, 0, 0 ]]

No documentation available

attenuation_distances

FloatVector
default: {}

No documentation available

attenuation_factor

Float bindable
default: 1.0

Identical in behavior to attenuation_intensity but provided as a second means to control attenuation, intended for use during lighting as a per-shot or per-sequence adjustment.

attenuation_factor: 0 | 1

attenuation_intensity

Float bindable
default: 1.0

The rate at which the light traversing a volume is attenuated. The attenuation (extinction) coefficient is the product of attenuation_color, attenuation_intensity, and attenuation_factor

attenuation_intensity: 0 | 1

attenuation_interpolations

IntVector
default: {}

No documentation available

attenuation_max_depth

Float bindable
default: 2.0

Represents the maximum ray depth, or the longest visible distance a ray has to travel through the volume. This sets the upper bound for the ramp.

attenuation_min_depth

Float bindable
default: 1.0

Represents the minimum ray depth, or the shortest visible distance a ray has to travel through the volume. This sets the lower bound for the ramp.

invert_attenuation_color

Bool
default: False

Invert the input attenuation color(s).

match_diffuse

Bool
default: False

Use the same color(s) for attenuation that is/are being used for diffuse.

use_attenuation_ramp

Bool
default: False

Use a ramp to define different attenuation colors depending on the depth of the volume.

Density Properties attributes

densities

FloatVector
default: {}

No documentation available

density_distances

FloatVector
default: {}

No documentation available

density_interpolations

IntVector
default: {}

No documentation available

density_max_depth

Float bindable
default: 2.0

Represents the maximum ray depth, or the longest visible distance a ray has to travel through the volume. This sets the upper bound for the ramp.

density_min_depth

Float bindable
default: 1.0

Represents the minimum ray depth, or the shortest visible distance a ray has to travel through the volume. This sets the lower bound for the ramp.

Scattering Properties attributes

anisotropy

Float bindable
default: 0.0

Value in the interval [-1,1] that defines how foward (1) or backward (-1) scattering the volume is. A value of 0.0 indicates an isotropic volume.

anisotropy: -1 | 1 (backlit)

diffuse_color

Rgb bindable
default: [ 1, 1, 1 ]

Reflectance color of the volume. Technically this is called scattering albedo, which is the scattering coefficient divided by the extinction coefficient.

diffuse_color: (0,0,0) | (1,1,1)

diffuse_colors

RgbVector
default: [[ 1, 1, 1 ], [ 0, 0, 0 ]]

No documentation available

diffuse_distances

FloatVector
default: {}

No documentation available

diffuse_interpolations

IntVector
default: {}

No documentation available

diffuse_max_depth

Float bindable
default: 2.0

Represents the maximum ray depth, or the longest visible distance a ray has to travel through the volume. This sets the upper bound for the ramp.

diffuse_min_depth

Float bindable
default: 1.0

Represents the minimum ray depth, or the shortest visible distance a ray has to travel through the volume. This sets the lower bound for the ramp.

use_diffuse_ramp

Bool
default: False

Use a ramp to define different diffuse colors depending on the depth of the volume.

Volume attributes

emission_color

Rgb bindable
default: [ 0, 0, 0 ]

A color multiplier for the emission. The product of emission color and intensity is the emission coefficient

emission_color: (0,0,0) | (1,1,1)

emission_intensity

Float bindable
default: 1.0

The rate at which a volume emits light at a given point. The product of emission color and intensity is the emission coefficient.

emission_intensity: 0 | 1

surface_opacity_threshold

Float
default: 0.5

Accumulated opacity that's considered the 'surface' for computing surface position and Z

Volume Baking attributes

bake_divisions

Int
default: 100

Divide widest axis by this many divisions

bake_resolution_mode

Int enum
  0 = “default” (default)
  1 = “divisions”
  2 = “voxel size”

Method to specify grid resolution of baked density grid. Choices are:
  "default": For shaders that are bound to vdb volumes, use vdb resolution.
      For shaders that are bounds to mesh geometries use 100 divisions
  "divisions": Specify number of divisions.
  "voxel size": Specify voxel size.

bake_voxel_size

Float
default: 10.0

Size of voxel in world space

General attributes

label

String
default:

label used in light aovs