Renderman User Documentation
Introduction to Volume Shaders: The Fog Shader


One of the more complex visual phenomena eluding computer graphics is atmospheric perspective.

Rendering packages at default render with pin-hole cameras that do not generate atmospheric effects.

Renderman volume shaders and an understanding of RSL allows users to create shading effects influencing an entire scene.

The following documentation illustrates the potential of Renderman's fog volume shader in creating such an effect.

Figure 01: Render without Volume Shader


Figure 01 is a resulting render of a written .rib file with geometry
extending into the background.

The addition of a volume shader can influence the resulting imagery.

A robust volume shader provides various parameters for modification, but even the most simple volume shader - the fog shader - can strongly affect the scene.

Figure 02 is the same scene rendered with an attached fog shader.

 

Figure 02: Render with Simple Fog Shader



Figure 03 is the volume shader placed in the above sequence.

This shader incorporates only two parameters, and it's output influences both color and opacity.

The opacity output is significant for compositing purposes, while color influence creates the fog aesthetic.

Parameter color declares the color of the fog effect. In this case - a grey.

The distance parameter controls the level of influence on the scene.

Figure 03: Simple Fog SL Shader


To apply a volume shader to a scene, using RiSpec, a call must be assigned following the WorldBegin tag within the .rib file - Figure 04.

To test the capabilities of the fog shader, the distance parameter is keyframed over the course of the sequence.

This results in the fading in and out of the fog shader's influence in Figure 02.

The result displays how even the simple volume shader can have a strong influence on the scene.

 

Figure 04: RiSpec Volume Shader Call in .rib



A more robust fog shader provides additional parameters for fine tuning.

Figure 05 illustrates an advanced fog shader with these additional parameters.

This shader substitutes distance for max and min variables (compare: spline / ramp).

Once again, this shader influences both color and opacity.

Figure 05: Fog Shader with Extended Controls



Figure 06: Fog shader keyframed with polarized parameters.

Figure 07: Fog shader with refined keyframes.

Figure 08 applies the fog shader to animated geometry to visualize the effect of an object entering and exiting the fog shader's influence.

Figure 06: Advanced Fog Shader Sequence 01



Note: Sequences involve high noise and jittering.

This is due to low sampleing of the occlusion function. These effects can be remedied with a higher samples value for occlusion.

Figure 07: Advanced Fog Shader Sequence 02



Figure 08: Animated Geometry with Fog Shader