VdbVolume
Overview
VdbVolume is a volume shader meant to be used with VdbGeometry. This shader allows modification of attributes of the VDB volume with constant multipliers or map bindings.
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. The default is to use the same number of divisions as the VDB file being rendered.
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
Volume 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.
color_mult
Rgb bindable
default: [ 1, 1, 1 ]
The albedo of the volume
incandescence_gain_mult
Rgb bindable
default: [ 1, 1, 1 ]
A multiplier applied to the volume emission
opacity_gain_mult
Rgb bindable
default: [ 1, 1, 1 ]
A multiplier applied to the volume density
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