home about gallery publications education links contact


..::volumetric style clouds::..

As 3ds max 7 does not have a native volumetric cloud and smoke system, we are going to have to do a bit of a workaround to generate the desired result. To be able to do this, we should really have a look at some actual clouds so that our reconstruction is effective. There are several factors which affect the scene – the cloud distribution, material, lighting and additional environmental effects. To make life easier for ourselves, we will distribute the clouds using a procedural texture with each cloud puff being a particle. This is quite straight-forward, however we will need to create two separate systems or branches within a single system to create two main sets of cloud particles, namely the cloud layers (three of them) and large billowing cloud stacks which will emit from the layers we will introduce. This may sound complex, but it is a pretty basic system to create in Particle Flow. The main meat comes in the materials where we have to try to simulate the volumetric cloud puff effect. This is quite tricky as we will have to blend multiple map types together; a simple Noise map will be used to generate the texture of the cloud, and a Falloff map used to remove any harsh edges of the geometry we will use for our cloud puff particles. The hardest thing to create is the effect of backlit clouds as we will have a halo effect around the edge of the cloud where there is no illumination. To create this effect we will use a Translucency shader as we can add additional illumination of the material in shaded areas, and then clamp the translucency to the outer edge by using the original Noise map (which generates the cloud shape) with a clamped-off version to mask out the internal parts of the cloud, suggesting density.

If you want a more realistic distribution of particles, then instead of using a procedural map to distribute them over our scene, then try taking a wide angled vertical photo of clouds and then tweak it in Photoshop to make all of the sky black and the clouds white(r). This map can then be loaded back into max to be used to distribute the particles.

It should be noted that due to the particle type used in this paperthe render times will be quite high as there will be multiple overlaid transparent faces which the renderer will have a tough time with. For a quicker render, see the Quick Tip at the bottom of this paper.

Enlarge Screenshot
Open the cloud_start.max scene included in the resources zip file below. Here we have a basic scene setup with a Geosphere to simulate the sky, multiple instanced lights to suggest the sun (so we have some side illumination on the clouds) and additional environment fogging which is controlled by settings contained within the camera.
Enlarge Screenshot
The Geosphere is scaled using an Xform modifier so that the UVW Map modifier assigned to it is not scaled. The UVW Map modifier’s Gizmo is orientated so that it points to the sun light by using the rotation controller of a dummy which is set to “Look At” a point helper which is linked to the central Sun light…
Enlarge Screenshot
this is because we cannot directly assign a Look At controller to the Gizmo so it is instanced from the Dummy object’s rotation controller. This results in the mapped gradient in the Sky material assigned to the Geosphere always pointing to the light so that if we decide to reposition the light the gradient will always follow suit.
Enlarge Screenshot
We will start our construction by creating three plane objects which will have a greyscale smoke material assigned to distribute the particles. In the Top Viewport, create a Plane object with a Length and Width of 16000 units and label it Cloud Plane Emitter Middle. In the Front Viewport, instance this plane vertically down about 1800 units and label it Cloud Plane Emitter Bottom and vertically upwards about 1800 units and label it Cloud Plane Emitter Top.
Enlarge Screenshot
Open the Material Editor and label a new material Cloud Plane Emitter Bottom. Add an Output map to the Diffuse slot and drop in a Smoke map into the Output Map’s Map slot. Set the Source to Explicit Map Channel. Set the Size to 0.5, Iterations to 20, Exponent to 1 and the Colour 2 swatch to white. Back in the Output map, clamp off the Smoke map’s colours by designing the Colour Map curve as illustrated.
Enlarge Screenshot
Copy this material twice and label them Cloud Plane Emitter Middle and Cloud Plane Emitter Top. In the former, go into its Smoke map and set the Phase to 1, and set the Phase in the second copy to 2. Assign these materials to their corresponding objects in the scene. Select all three objects in the scene, right-click and select Properties. Turn off Renderable so they won’t be rendered.
Enlarge Screenshot
We are going to be using instanced geometry for our particle type as it gives us more control over mesh detail, therefore we can tweak the amount of Segments in this object which will be passed through our particle system. In the Top Viewport, create a Geosphere with a Radius of 30 and 2 Segments. Label this object Cloud Puff.
Enlarge Screenshot
To generate some random distribution of the cloud particles, we will next introduce a Wind Space Warp to the scene with a substantial amount of turbulence. In the Top Viewport, create a Wind Space Warp and set its Strength to 2, Turbulence to 10, Frequency to 2 and Scale to 0.12. in the Front Viewport, rotate the Space Warp 40 degrees clockwise so that any particles are distributed randomly along the direction of the Space Warp’s icon.
Enlarge Screenshot
Next we will create the basic particle system before tailoring it for our needs. In the Top Viewport, create a Particle Flow system. So we see exactly what we get at render time, set the Viewport Quantity Multiplier to 100 and the Render Integration Step to Frame as there aren’t going to be that many particles in our scene for our system to be bogged down.
Enlarge Screenshot
Open Particle View. Rename Event01 to Cloud Stack Birth and remove all operators from the event apart from the Birth & Display operators . In this operator, set the Emit Start and Emit Stop to -20 and the Amount to 5. This is so that any distribution of particles occurs before we join the scene at frame 0. Drop the Display operator in the root event and set it to Geometry. Add a Position Object operator and add the three cloud emitter objects from the scene.
Enlarge Screenshot
Enable Surface Offset, set the Min amount to -200 and Max to 300. Finally, enable Density By Material which uses the greyscale material to distribute the particles. Add a Shape Instance operator and add the Cloud Puff object to this operator. Add a Scale operator to the event. Disable Constrain Proportions in the Scale Factor set and set the X and Y factors to 10000 and Z to 4000. Set the Scale variation to 1000 for all axes.
Enlarge Screenshot
The Scaling squishes the instanced geometry randomly. Add a Spawn test to the event to create additional particles from these parent particles. Set the Offspring to 30 with 50 Variation. Instance the existing Scale operator to the canvas to create a new event, label the event Cloud Stack Distribution and wire the input of this event to the output of the Spawn test.
Enlarge Screenshot
Add a Speed operator to the new event and set its Speed to 1.5 and Direction to Random 3D. Add a Force operator, add the Wind Space Warp to it and set its Influence to 5000. To ensure that these particles don’t travel off to infinity, we will kill their motion after a short while. Add an Age test to the event and set its Test Value and Variation to 10.
Enlarge Screenshot
Drag out a Speed operator to the canvas to create a new event, label the event Speed Killer and wire its input to the output of the Age test. This therefore stops all particle motion after 10 frames with a variation of 10 frames. Finally, add a Material Static operator to the root node so we can add our cloud material to the entire system later on. Next we will create the cloud layers.
Enlarge Screenshot
Instance the Cloud Stack Birth event to create a new event, label it Cloud Layers Birth and wire its input to the Output of the PF Source. Disable the Spawn test to speed up updates. Make the new Birth operator unique and set its Amount to 1500. Make the Scale and Spawn events unique. In the Scale operator, set the X & Y Scale Factor settings to 4000 and the Z Factor to 1500, with the Variation set to 1500 for all axes.
Enlarge Screenshot
In the Spawn test, set the Spawnable% setting to 10 and offspring to 5. Instance the Cloud Stack Distribution event and wire the Output of the new Spawn test as illustrated. Remove the Speed & Scale operators. Make the new Force unique and set its influence to 1000. Instance the Scale operator from the Cloud Layers Birth event to this event. Finally, wire the output as illustrated & re-enable the Spawn test.
Enlarge Screenshot
Open the Material Editor and label a new material Cloud Puff. We are going to be using a Translucent shader to simulate backlighting and transmission of light through the cloud. Set the shader type to Translucent Shader and set the Diffuse colour to white. Enable Self Illumination so we can introduce additional maps to affect its intensity and colour.
Enlarge Screenshot
We will start out with the Bump map as this will drive the shape of our cloud puff. Add a Noise map to the Bump map slot and label it Cloud Bump. Set its Noise Type to Turbulence and set its Size to 1600. Set the Levels to 10 to add more detail to the noise. Swap the colour swatches so that the bump is bulging out the right way. Back at the top level of the material, amend the Bump amount to 20 so that it is more subtle.
Enlarge Screenshot
Next we will remove the harsh edges of the material swatch sample by amending the opacity of the material. Add a Falloff map to the material’s Opacity slot and label it Cloud Opacity. Swap the Front & Side colours so that the front is white (opaque) and side is black (transparent). Amend the Mix curve as illustrated so that we clamp off the opacity by bringing in the black transparent area.
Enlarge Screenshot
Now we’ll add some additional self illumination effects by intensifying the illumination of the cloud on the perpendicular of the lit side only. In the Self Illumination slot, add a Falloff map and label it Cloud Self Illumination Lit Mask and set its Falloff Type to Shadow / Light. Add another Falloff map to this map’s Lit slot and label it Cloud Self Illumination Perpendicular.
Enlarge Screenshot
The last thing we need to add to our material is the backlit effect. As mentioned in the introduction section, we will have to mask out parts of the material so that the entire “dark side” is not affected by the translucent effect, only the outside of the masked Noise map. Add a Mix Map to the Translucent Colour slot and label it Cloud Backlit. Set the Colour 2 swatch to RGB 150,150,150.
Enlarge Screenshot
This Mix map (the mixing of the two colours) will be driven by a masked version of the map used in the Bump slot, however due to the way that the translucency works; we can still have this effect on transparent parts of the material, so we therefore need to mask these areas out…
Enlarge Screenshot
In the Mix Amount slot, add a Mask map and label it Cloud Backlit Control. Instance the Cloud Opacity falloff map to the Cloud Backlit Control mask map’s Mask slot. To create the outline effect we now need to mask out the internal “dense” area of the Noise map. Add another Mask map to the Cloud Backlit Control map’s Map slot and label it Cloud Backlit Outline.
Enlarge Screenshot
Instance the Cloud Bump map into this new Mask map’s Map slot. Copy this map (not instance) into the Mask map’s Mask slot and label it Cloud Backlit Density Mask. Amend the High setting to 0.6 and Low to 0.2 to clamp off the colours in the map, thereby intensifying them. Open up Particle View and instance the entire Cloud Puff material to the slot in the Material Static operator. Finally, hide the distribution and source particle geometry. If you find that it takes too long to render due to the amount of transparency in the scene, try reducing the particle count or amount of iterations in the particle source geometry.
Download the max file! Zip file to accompany

..::additional tip::..

Try replacing the particle geometry with facing particles and use cloud sprites for a quicker render due to less transparent geometry having to be calculated!

Initially published: 3D World magazine, Issue 65, June 2005.

Copyright © Pete Draper, June 2005. Reproduction without permission prohibited.

www.xenomorphic.co.uk