Volume by Saber Jlassi
Standard Volume is a physically based volume shader. It provides independent control over volume density, scatter color and transparent color. Blackbody emission is used to render fire and explosions directly from physics simulations.
Each component can be controlled by a volume channel coming from the volume object, with other parameters acting as multipliers on the channel. Optionally the channel can be left empty, and a custom shader like Volume Sample or a procedural texture may be connected instead, to manipulate each component with more control.
However, be warned that the evaluation of a shader network for volume rendering is much more expensive than for surface shading because the shader network is called many times per ray, once per ray march sample. So, in a production environment, it's best to use as few shaders as possible, ideally having just the Standard Volume shader doing all the work.
The images in the examples below use a GI Volume Depth of 8 (defaults to 0). This is useful when rendering volumes such as clouds for which multiple scattering has a large influence on their appearance.
It is recommended that volume shading networks are kept as lean as possible. This is important for render times in the volume context because it is evaluated so often.
The density of the volume, with low density resulting in thin volumes and high density in thick volumes. It acts as a multiplier on the density channel, or if no density channel is specified, may be used to connect a shader like volume sample or a procedural texture.
Density channel to read from the volume object.
The brightness of the volume under illumination. This is the ratio of light that is scattered rather than absorbed, for energy conservation values in the range 0..1 must be used.
The color of the volume under illumination.
scatter_color_channelScatter channel to read from the volume object. This acts as a multiplier on the scatter color, to texture the color of the volume.
The directional bias, or anisotropy, of the scattering. The default value of zero gives isotropic scattering so that light is scattered evenly in all directions. Positive values bias the scattering effect forwards, in the direction of the light, while negative values bias the scattering backward, toward the light. This shader uses the Henyey-Greenstein phase function.
Note that values very close to 1.0 (above 0.95) or -1.0 (below -0.95) will produce scattering that is so directional that it will not be very visible from most angles, so such values are not recommended.
Additional control over the density of the volume, to tint the color of volume shadows and objects seen through the volume.
Additional control over the density of the volume, to control the depth into the volume at which the transparent color is realized.
Transparent color to read from the volume object. It acts as a multiplier to texture the transparent color in the volume.
- None: emit no light.
- Channel: emit light using a specified emission channel, or using a shader connected to the emission rate or color parameters.
- Density: emit light using the density channel, modulated by an optional emission channel.
- Blackbody: emit color and intensity based on temperature, for rendering fire and explosions.
Emission is the rate at which a volume emits light. If a density channel, emission channel or blackbody channel is used for emission, this acts as a multiplier to decrease or increase the emission. Alternatively, if no so such channel is used, a shader like volume sample or a procedural texture may be connected to this parameter to control where light is emitted.
(Emission Mode: Blackbody)
Volumes can only receive indirect lighting from other emissive volumes when the Volume Ray Depth is above 0.
A color to tint (multiply to) the emission.
In Channel emission mode, the emission channel to sample the emission rate from.
When not empty, this channel will be used to sample the emission values for the volume instead of the Emission parameter. The sampling tab has additional parameters to control how data is sampled from volume channels.
When using the Channel emission mode, ensure that the emission attribute is driven by a VDB grid. If it is a fixed parameter value, you may get artifacts.
If a blackbody channel is used, this acts as a multiplier for the blackbody temperature. Alternatively, a shader like volume sample or a procedural texture may be connected to this parameter to control the blackbody temperature.
The multiplier for the temperature from the temperature volume channel. Usually, the temperature is stored in a 0..1 range, and this parameter can be used to scale it to a temperature in Kelvin.
Control the intensity of the blackbody emission. For physically correct results intensity 1 must be used. This can result in extremely bright light, however, and lower values may be used to reduce the intensity.
Connect a noise texture or other shaders here to displace the volume, similar to displacement on surfaces. This can be used to add additional detail to the volume or to warp it. The connected texture will be applied as an object space offset to the volume sampling position, for all volume channels.
Different Noise shaders connected to displacement
Animated noise connected to displacement
When using Displacement, ensure that the Volume Padding of the volume is increased to account for the increased size of the volume.
The voxel interpolation to use when sampling the volume data using named channels.