Volumetric Effects

Although Blender exhibits a very nice Mist option in the World Settings to give your images some nice depth, you might want to create true volumetric effects; mists and clouds and smoke which really looks like they occupy some space.

Figure 1 shows a setup with some columns in a circular pattern, whith some nice material of your choiche for columns and soil and a World defining sky colour.

Figure 1. Columns on a plain.

Figure 2 shows, the relative rendering, whereas Figure 3 there is a rendering with Blender's built-in Mist. Mist setting in this particular case are: Linear Mist, Sta=1, Di=20, Hig=5

Figure 2. A plain rendering.

Figure 3. A rendering with builin Blender Mist.

But we want to create some truly cool, swirling, and, most important non-uniform mist. Blender Built in textures, clouds for example, are intrinsecally 3D, but are rendered only when mapped onto a 2D surface. We will achieve a 'volumetric' like rendering by 'sampling' the texture on a series of mutually parallel planes. Each of our planes will hence exibits a standard Blender texture on its 2D surface, but the global effect will be of a 3D object. This concep will be clearer as the example proceeds.

With the camera in the default position, turn to front view, and add a plane in front of the camera, with its center aligned with the camera wiewing direction. In side view move the plane where you want your volumetric effect to terminate. In our case somewhere beyond the furthest column. Scale the plane so that it encompasses all camera's viewing angle (Figure 4). It is important to have a camera in the default position, that is pointing along the y axis since we need the planes to be orthogonal to the direction of sight. We will anyway be able to move it later on.

Figure 4. The plane setup.

After having checked that we're at frame 1, let's place a Loc keyframe (IKEY). We should now move to frame 100, move the plane much nearer to the camera, and set another Loc Keyframe. Now, in the animation buttons (F7) Press the DupliFrame button.

The 3D window, in side view, will show something like Figure 5. This is not good because planes are denser at the begin and at the end of the sweeep. With the plane still selected change to an IPO window (SHIFT F6). There will be three Loc IPOs, only one of which non-constant. Select it, swithc to EditMode (TAB) and select both control points. Now turn them from smooth to sharp with (VKEY) Figure 6.

Figure 5. The Dupliframed plane.

Figure 6. Reshaping the Dupliframed Plane IPO.

The planes will now look as in Figure 7. Parent the Dupliframed planes to the camera (select the plane, SHIFT select the camera, CTRL P. You have now a series of planes automatically following the camera, always oriented perpendicularly to it. From now on you could move the camera if you so wish.

Figure 7. Reshaping the Dupliframed Plane IPO.

Figure 8. Basic Material settings.

Now we must add the Mist material itself. The material should be Shadeless and cast no shadows to avoid undesired effects. It should have an small Alpha value (Figure 8) A material like this would basically act like Blender's built in mist, hence we would have no advantage in the resulting image. The drawback is that computing 100 transparent layer is very CPU intensive, expecially if one desires the better results of the Unified Renderer.

TipQuick previews
 

You can use the DupOff: NumButton in the Animation Buttons window to turn off some of the planes and hence have a faster, lower quality preview of what you are doing. For the final rendering you will then turn DupOff back to 0.

Pay attention to the Alpha value! the lesser planes you use the thinner will be the mist, so your final rendering will be much more 'Misty' than your previews!

The true interesting stuff comes when you add textures. We will need at least two: One to limit the Mist in the vertical dimension and keep it on the ground; The second to make it non uniform and with some varying hue.

As a first texture Add a Blend Linear texture, with a very simple colorband, going from pure white, Alpha=1 at a position 0.1 to pure white, Alpha=0 at a position 0.9 (Figure 9). Add this as a Alpha only Mul texture (Figure 10). To make our mist consistent as the Camera moves, and the planes follows, we have to set it Global. This will be true also for all other textures and will make the planes sample a fixed 3D volumetric texture. If you are planning an animation you will see a static mist, with respect to the scene, while the camera moves. Whichever other texture setting would show a Mist wich is static with respect to the camera, hence being always the same while the camera moves, which is higly unrealistic.

Figure 9. Basic Material settings.

Figure 10. Basic Material settings.

If you want to anyway have a moving, swirling changing mist you can do so by animating the texture, as will be explained later on.

The Blend texture operates on X and Y directions, so if you want it to span vertically in the Global coordinates you will have to remap it (Figure 10). Please note that the blending from Alpha=1 to the Alpha=0 will occurr from global z=0 to global z=1 unless additional offsets and scalings are added. For our aim the standard settings are OK.

If you now do a rendering, it doesn't matter where your camera, and planes, are. The mist will be thick below z=0, non-existent above z=1 and fading in between. If you're puzzled by this apparent complexity, think of what you would have got with a regular Orco texture and non-parented planes. If you had to move the camera, expecially in animations, the results would become very poor as soon as the planes are not perpendicular to the camera any more. To end up with no mist at all if the camera were to become parallel to the planes!.

The second texture is the one giving the true edge on the built in mist. Add a Cloud texture, make its Noise Size=2, Noise Depth=6 and Hard Noise on (Figure 11). Add colorband to this too, going from pure white with Alpha=1 at Positoion 0 to a pale bluish gray with Alpha = 0.8 at a position of about 0.15, to a pinkish hue with Alpha 0.5 around position 0.2, ending to a pure white, Alpha=0 color at position 0.3. Of course you might want to go to greenish-yellow for swamp mists etc.

Figure 11. Cloud texture settings.

Use this texture on both Col and Alpha as a Mul texture, keeping al other settings to default. If you now render the scene the bases of your columns will be now masked by a cool mist (Figure 12). Please note that the Unified renderer gives much better results here.

Figure 12. Cloud texture settings.

If you are planning an animation and want your Mist to be animated like if it were moved by a wind it is this latter texture you must work on. Add a Material texture IPO, be sure to select the correct texture channel and add some IPO to the OfsX, OfsY and OfsZ properties.