Volume Effects

 
 
 

| Colors | Fractal | Falloff | Proximity | Animation | Marching | Bounding Box | Scattering | Lights | Render Tree Usage

Category: Volume

Shader Family: Volume

Output: Color

A ray marcher coupled with a fractal density function. Ray marching determines the look of the smoke by "marching," or stepping, along each ray cast during a render. As it marches along the ray, it captures information about the density of the smoke, which is defined by the light's volume, and returns the information to the mental ray renderer.

The ray marcher simulates a cloud of small particles. Each ray that passes through the volume is broken down into steps, and at each step point the density function is evaluated. The density function returns separate R, G, and B components, which represent the individual densities of particles scattering only the respective color components.

The renderer will slow down considerably if you don't take the following into consideration:

Colors

Color 0

Makes the fractal result in a scalar that is used to mix between two colors. This is the former of those colors and represents a scalar value of 1.

Color 1

Defines the latter of the two colors, at scalar value 2.

Fractal

Size

Scales the time. The time unit is a second, so that in 1 second the fractal will have moved 1 unit in the fourth dimension. Setting this to 2 makes the fractal change twice as fast.

Amplitude

Defines the amplitude of the first frequency component of the fractal. The total amplitude can exceed this.

Offset

Defines the offset of the fractal's 0. Usually the fractal function starts at a value of 0 and then has an equal likelihood of becoming positive or negative. When = 0.5, the fractal will fluctuate about that point, growing with equal odds either toward Color 0 or Color 1. Note that the fractal will never exceed 1 or go below 0.

Threshold

When the fractal is below this value, it is clipped to Color 0. This is useful to create "islands" in the pattern.

Diffusion

Controls the overall diffusion of the fractal effect. A low value will create a high-contrast effect.

Noise Type

Lets you choose between two noise functions to build the fractal.

Absolute

Uses the absolute value of the noise for the fractal. This creates interesting discontinuities that create a turbulence effect. A side effect is that the fractal value is always positive.

Maximum Iterations

Defines the maximum number of noise iterations. It works with the Minimum Level in defining the complexity of the fractal. The more constraining of the two limits is used.

Minimum Level

Defines the minimum amplitude at which iteration will occur. It is used to control how often the shader calls the noise function. A value of 0.1 means that noise of amplitude less than 0.1 will not be added to the fractal, and iteration will stop there.

Decay

Defines the amplitude decay of the fractal iterations. It is defined as the ratio of the amplitude as the frequency doubles. So, if the Freq. mult (see next parameter) is 2, the amplitude of every subsequent iteration is multiplied by this value.

Frequency Multiplier

Defines the frequency multiplier for subsequent iterations. Frequency is really just the inverse of scale. Doubling frequency is the same as scaling down by a factor of 0.5; therefore, every subsequent fractal is scaled by the value 1/Frequency.

Falloff

Falloff is when the density function is made to return an increasing amount of black according to some distance. A density function of black means that the density in the ray marcher is 0. This is useful for creating layered fog when you want the density to grow toward 0 as you approach some height over ground.

Falloff

When checked, the falloff is not calculated.

Y

Specifies that the fractal falls down to black as the Y coordinate grows.

Radius

Specifies that the fractal falls down to black as the radius from the center grows.

Distance

Defines the distance (in Y or radial direction) after which the fractal will become completely black.

Bias

Biases the distance used to compute falloff.

At 0.5, the falloff will be linear with distance;

when close to 0, the falloff won't be noticeable until very close to the distance limit; when close to 1, most of the falloff will occur right at the beginning.

Proximity

On

Switches on proximity calculations.

Cone Angle

For correct proximity calculations, enter the angle of the spotlight you are modifying. For a point light that shines in all directions, use 360.

Intensity Scale

Controls the overall intensity of the lights.

Animation

Use Time

Switches on the animation.

Time Scale

Defines the scale to be used when animating the volume effect over time.

Marching

Step Size

Defines the maximum length of the steps taken during ray marching.

This parameter does not have to be fixed, as each point may be randomly jittered. Furthermore, according to a certain contrast limit, each step may be subdivided up to a certain point. This makes the ray marcher able to focus on features such as edges or umbra boundaries.

Maximum Subdivision

Defines the maximum number of recursions made during ray marching.

Maximum Difference

Defines the difference in density or intensity at which a recursive subdivision of the marching step is made.

Jitter

Defines the amount that each sample point is randomly permeated from its calculated position. At 0 there is no jitter; at 1, the point is jittered so much it may touch its neighbor. This can be used to hide spatial aliasing artifact and replace them with noise.

Bounding Box

Always Honor

If the shader is being applied to an object (volume shader), this parameter selects whether to honor the box or not. For a global shader, it is always honored. If infinite rays are encountered, the far side of the box is used to truncate.

Minimum, Maximum X

Defines the X parameters of the boundary box.

Minimum, Maximum Y

Defines the Y parameters of the boundary box.

Minimum, Maximum Z

Defines the Z parameters of the boundary box.

Scattering

Ambience

Simulates an ambient light source illuminating the cloud.

Absorption

Controls the amount of light that falls on the particles is absorbed. For air or steam, keep this at 0; for dark smoke or soot, make it higher (about 1).

Asymmetry

Controls the scattering behavior of the shader. At 0, the same amount of light is scattered back as well as forward; this is the case with small particles, such as air. Higher values make the scattering ever more forward biased, as with larger particles such as smoke or dust.

Uniform

Makes the light scattering uniform in all directions, much as with the ambient light that follows. However, light lookup is still performed, and self shadowing may occur (see Volume Effects).

If you select Scattering Lights (uniform_scatt), the ray marcher uses them to determine light scattering at that point. Optical depth is accumulated and used to calculate the occlusion of both scattered and transmitted light.

Density Scale

Scales the density of the cloud. It is an overall scaling factor: if the cloud/hypertexture appears too dense, you can lower this value instead of having to meddle with the density function.

Volumic Density

When the volume shader is applied to an object, this parameter makes the density automatically change according to the scaling of the object. For example, if you scale the object down ten times in the XYZ axes, the density of the texture will increase a thousandfold.

Transparent

Makes the texture invisible; i.e., it doesn't block light at all, and the shader becomes a glowing transparent gas, much like neon.

Lights

If you have scattered lights, it slows down the rendering somewhat because each light lookup can be quite time consuming, particularly if you've selected an area light. If you select the same light as both scatter light and shadow light, each light call will result in a ray marching from the current position to the light -- so rendering time may be almost squared! Do this only if you have either a large step size or you have a very dense material (hypertexture).

NoteThe self shadow is calculated for all the distance to the light, even if the light is outside the bounding volume. Therefore, volumetric lights really should be within the bounding volume.

Lights

Scatter Lights

Lets you define a scatter light in your scene that will be used to compute the fast lens effect.

For more information, see Using Light Lists [Direct Illumination].

Shadow Lights

Lets you define a shadow light in your scene that will be used to compute the fast lens effect.

For more information, see Using Light Lists [Direct Illumination].

Render Tree Usage

To apply this volume effect to an object (as opposed to a scene), connect this shader to the Volume input of the object's material node. Volume shaders cannot be expanded or built upon in the render tree.

Creative Commons License Except where otherwise noted, this work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License