Learn the science of clouds with Houdini
Create realistic cumulus clouds
In issue 116’s atmospherics tutorial we learned some basic scientific aspects of atmospherics. one kind of phenomena was intentionally missing from that because this step-by-step is all about them: clouds. There are many kinds of clouds but we have chosen the most common one, the cumulus, as the subject of our study.
while we now use houdini not just for experiments but also for asset creation, in the end we can have a versatile cumulus generator pipeline to create small clouds or a hero thunderstorm formation. houdini has a procedural cloud toolset but our approach involves dynamics because we want to achieve a higher level of realism with the opportunity for timelapse animation or to achieve a more natural shot continuity. This tutorial isn’t intended to be extremely accurate from a scientific viewpoint but the 15 steps can be seen as an overview. if you’re interested, you’ll find additional materials on the author’s artstation profile at artstation.com/scivfx.
Observe cloud dynamics during spring in the northern hemisphere, we have more of a chance to observe cumulus clouds. it’s worth observing them from above if we fly. webcams with good sky views can also help us, especially if we utilise a time-lapse video – this can be our secret weapon for dynamics observation. however, on a hotter day, the way that these clouds are developing can also be visible to the naked eye. however, as these clouds are volumetric phenomena, we can’t exactly distinguish shapes from light and shadow effects. it’s also worth observing how clouds can affect their environment. discover which parts of the cloud are darker than the sky and by how much over on step 9.
Shape of clouds clouds are classified on the basis of two criteria: shape and height. Those at high altitude are cirrus, cirrostratus or cirrocumulus. stratus clouds are the result of slower, more stable processes, thus their shapes are homogeneous and flat. on the other hand, cumulus clouds form in an unstable and/or turbulent environment, so they get their fluffy shape. it’s the same with mid-altitude clouds, altostratus and altocumulus. our concern is with the more dynamic low-level clouds, which are cumulus clouds. however, every cloud is unique, so there are in-between categories like stratocumulus, and also different varieties like altocumulus lenticularis.
Pressure, temperature, density These are the three properties of air that we should keep in mind during this project. while gravity keeps air molecules stuck to earth, this gradually lessens the higher up we go as every molecule pushes the ones below towards the planet’s surface. however, this severe kinetic movement doesn’t allow them to lie down on the surface as liquid water does. The temperatures, pressures and densities are all interrelated. indeed, it’s the same as changing the readout of your bathroom scale by pulling yourself up, bouncing, or dancing on it with somebody else.
Evaporation and condensation air’s water content comes from surface evaporation, fuelled directly by the energy of the sun, or indirectly by the wind, transpiration of plants or wave splashes from the ocean. if the water is in the vapour state, it’s basically invisible and needs a condition to condense and get the water content to be naturally visible. cumulus clouds do this with localised convective lifting – the uneven surface heats up the air above unevenly, so the warmer areas start to rise because they expand more and the density gets lower. as they lift, the pressure and temperature lower and the water vapour molecules bounce less frequently, so they start to stick together. To form considerably sized water droplets, they also need surfaces – the condensation nuclei.
Cloud base as we observe real cumulus clouds, we can clearly see this height: these fluffy clouds have flat bottoms, which are the lifting condensation levels. The temperature decrease is the result of the lower pressure at this height. instead of exact scientific simulation, we can simplify things to get more control. Thus, instead of simulating the air mass from the ground, it’s better to use a polygrid at the intended height of our cloud base. it’s recommended to use real-world units, so around 1,000 houdini units (metres) is a good start. we can paint all the initial physical properties on it, like temperature, humidity and velocity, or use a fluid source with animated textures.
Pyro solver a large cumulonimbus, the matured thunderstorm version of the cumulus, is like an extremely slowed down atomic bomb in terms of shape, thermodynamics and the amount of the energy involved. Thus we can use the pyro solver in houdini to simulate a birth of a cloud. The most important parameter is the buoyancy, which we should set carefully. it is best to switch off all features at the beginning and then turn them on one by one, or use separate microsolvers. our temperature and humidity source can be a particle system emitted from the ground with wind and turbulence to be a bit more scientific and get a more chaotic spread.
Latent heat and others This is an extra boost for the uplifting force – as the water condenses, the energy stored at the time of the evaporation releases. other factors also affect the energy balance, like the absorption of the sunlight. even if just the few per cent of the radiation gets absorbed, this is significant and so we should use the heat/ burn feature of the pyro solver to mimic these extra effects above the cloud base. in this case, the water vapour is the fuel, latent heat is the heat and condensation is burn. we should switch on the advect fuel on the combustion/fuel tab to lift the water vapour with the heat.
08 Complexity of cloud optics as we already know how complex the scattering of light by water droplets is, we should make an effective lighting setup that is based on science but with simplifications and artistic control. we should trust in our senses and experiences and rely on observations to compensate the unachievable computing needs for brute force simulation. in clouds, it’s not just the scattering of the incoming light that is complicated, but the indirect light events are orders of magnitude more complicated than in a usual final render setup. additionally, the multiple scattering makes clouds very white, so single scattering is just a small part of the albedo of these clouds. in cumulus clouds, there are water droplets that are usually small enough for light diffraction that add a bit of additional complexity. 09
Visual illusions clouds can have very bright and very dark areas, and these areas have additional details with much less dynamic range. as a result, the simultaneous perception of the brightest areas with the details in the darkest is quite a hard task. our eyes can deal with these very well but they will enhance them in order to be able to do so. actually, this enhancement is similar to those involved in hdr to Ldr conversions – a big radius sharpen/unsharpen mask or an inverted glow – it’s just less obvious. Photochemical film development also has similar side effects by its nature and it’s also an integral part of many painters’ works. it’s important to keep in mind that the smallest intensity change can have a significant visual impact on our image, especially in the mid-tone and dark areas. we should be very careful to set the scene’s linear intensities and colours, as well as the shading parameters. 10
Forward scattering versus multiple scattering forward scattering is crucial for realism as we learned in issue 116, but the countless photon bounces inside a cloud are just as important. using houdini’s cop nodes, we can understand some basic concepts. we lay down schematic cloud roto shapes on this hdr image and use blur nodes to do the scattering. for single scattering, blend two of them to get an acceptable result. for multiple scattering, we use the Loop cop node. as we dive inside, we can add a blur with some opacity. The iterations parameter of the Loop node is the depth of scattering in this case. as we compare the two shapes, we can clearly see the most important difference: the gradient with the single scattering – which has just the simplified forward scattering lobe – is much steeper than the multiple one, which is flattened out by the looped blur. around the sun, the edge with single scattering is brighter. however, the inner part conducts the light further, just as real clouds do. 11
Basic light composition for fast results, use solid objects instead of volumes, and the most effective way is to convert our volume object to a polygon. use a diffuse white shader or a subsurface scattering one to set up the sunlight and skylight. The reflections from the ground are also important, and all of these are included in houdini’s sky system. we can also use an hdr environment, with the bottom part projected onto a ground plane. it’s important to include a draft version of the effects of multiple scattering from the beginning, but with an emission colour or a fast subsurface scattering to alter the mood a lot, making it preferable for artistic decisions.
12 Volume shader tweaks after we switch back to volume object, we use houdini’s pyro shader material node because it has some nice built-in features like procedural textures. however, after we switch off all emission-related effects, we should tweak the node network inside to get a physically plausible phase function. Pyro shader core has a simple phase function but we can duplicate it and use a layer mix node. The first phase should be very close to 1, like 0.98; the other can be a bit above half. if you prefer to use more low-level shading nodes, you can tweak a Volume shader core node instead and mix just the phase functions inside it. we can’t get scientifically accurate results with these as the phase function in real clouds is much more complex and depends on droplet size, which is beyond our scope now. 13
Indirect lighting with Mantra’s brute force features, the rendering of multiple scattering in clouds can be extremely slow. we need as many light bounces as possible for multiple scattering to simulate the light conducting effects of the real clouds. however, the spatial accuracy isn’t so important for the indirect lighting, thus we can use the Gi Light node in houdini to simulate and store a photon map. it’s a bit hard to understand, but we will utilise it with the direct Global Photon Map setting, which means using a photon map only. The indirect… setting means utilising a photon map calculation first, then a final gathering calculation when it comes to rendering, which is still slow for us. we can actually take advantage of the inaccuracy of the photon map with the direct… setting. if we set the filtering value to a high one, either the prefilter or the filter, which is the on-the-fly version, the effect is the same. This spatially blurs the lighting effects of the precalculated photons, adding further realism and compensating for the depth limits of the photon simulation. 14
Comp during the 3d look-dev, there is a point when we can’t get better results with the new iterations or it gets less good. This is the point when it’s recommended to render out as much aov as possible and tweak the image further in 2d. we can add slight blur nodes for additional scattering effects and also colour grade aovs differently, and balance them to get convincing results. for aerial perspective effects, we can use the depth aov as a mask, firstly for a multiply node with a red or amber colour, then for an add node with a less saturated blueish hue. This is a cheap simulation of the scattering of the atmosphere. at the end, it’s important to add the usual comp steps – like fringe, glare, glow and grain – and use proper colour management. however, the best thing to do is to do slap comps from the beginning, and not to compensate the lack of lens effects with lighting and shading. 15
Scientific conclusion There have been great examples in recent years of scientifically based approaches helping artists achieve high quality and realistic clouds both in VFX and animation films. in The Good Dinosaur, Pixar Tds and artists created a pipeline that was based on real cloud satellite maps, simulations and accurately shaded but art-directable cloud assets. in Attraction, Main road Post artists also used houdini to simulate cumulus clouds and used custom-phase function shading for realistic cloudy backgrounds in the full cg jet fighter scenes.