PxrVolume
PxrVolume

PxrVolume is a material that can be used to render a wide range of participating media. Its scattering model uses the Henyey-Greenstein phase function commonly used for anisotropic media; it can also efficiently handle isotropic scattering. Both heterogeneous and homogeneous volumes are handled, as well as multiple scattering effects.
Users of PxrVolume should be aware of the difference between homogeneous volumes and heterogeneous volumes: homogenous volumes have constant density and color, both of which can easily be represented by a single float (for density) or single color value. Heterogeneous volumes can have varying density and/or color, typically determined via textures or from primvar data associated with e.g. OpenVDB. PxrVolume is particularly optimized for homogeneous volumes. Any use of a connection on the Density or Diffuse Color knobs will make the volume heterogeneous, and such volumes are typically much slower (and noisier) to render than homogeneous volumes.
A note on ShadingRate: for RiVolumes, the memory used in automatically computing density bounds is controlled by ShadingRate (please refer to the discussion below about the Max Density parameter). The default ShadingRate setting of 1 is typically enough. For large resolution renders or sparse volumes, the trade-off between memory used and time spent computing bounds versus time saved by having automatic bounding may be less useful. Higher ShadingRates may be beneficial in these cases.
PxrVolume can be attached to any closed, watertight surface, and not just RiVolume, with certain caveats:
- works great for homogeneous volumes (as mentioned above)
- works fine for heterogeneous volumes as long as no 3D primvars are needed, other than builtins. If other 3D primvars are needed in the execution of the pattern graph, RiVolume must be used (since surfaces cannot be used as a source of 3D primvars).
- volumes must be modeled so that their envelopes are not coincident with other geometry, including other volumes. This restriction does not fully apply to RiVolume: RiVolume may share coincident faces with other RiVolumes and may be coincident with other geometry.
- the camera cannot be placed inside an arbitrary surface, only inside a RiVolume
- lights cannot be placed inside an arbitrary surface when using bidirectional path tracing, only inside a RiVolume
Parameters
Diffuse Color
|
![]() Red, Green, and Blue diffuseColors, from left to right |
Emit Color The emissive color of the volume. This is useful for modeling effects such as phosphorescent fog or fire. Default is black (0,0,0), i.e. the volume will not emit light. |
![]() Red, Green, and Blue emitColors, from left to right |
Density Color
|
![]() densityColor of [1 0.5 0.5], [0.5 1.0 0.5] and [0.5 0.5 1.0], from left to right |
Density Color PrimVar A primvar from the geometry which overrides the density color of the volume, unset by default. Setting this overrides the densityColor input, and is more efficient than simply using a PxrPrimVar pattern connection. |
|
Density Float
|
![]() densityFloat of 2.0, 0.5, and 0.25, from left to right |
Density Float PrimVar A primvar from the geometry which overrides the density float of the volume, unset by default. Setting this overrides the densityFloat input, and is more efficient than simply using a PxrPrimVar pattern connection. |
|
Anisotropy
|
![]() anisotropy of -0.8, 0, and 0.8, from left to right. Rendered using VCM with path length 4, multiscatter turned on |
Max Density
|
Multi Scatter
|
![]() Left column: multi scatter off. Right column: multi scatter on. |
Equiangular Weight Sets the probability of equiangular sampling being used instead of density sampling. Equiangular sampling improves the convergence of volumes close to light sources, while density sampling can be a better technique when dealing with volumes with dense or highly varying density. The default value of 0.5 means both techniques will be used equally and combined with multiple importance sampling. If the volumes are dense and far away from light sources then decreasing the equiangular weight may result in better convergence. |
Samples This setting controls sample quality for single scatter volumes. Increasing this value can improve convergence of volumes at the cost of render time. However, the trade-off in scenes with other objects is that the volume will sample more without increasing costs elsewhere in the image and may improve your results. |