[Blender] Tutorial volumetric clouds

[size=5]Making natural looking Volumetric clouds in Blender 2.48a
By Philippe roubal 3d-synthesis.com.

This tutorial is based on a blend file, hosted here

The truth is that a kind of Volumetric clouds is already available in Blender for a long time, gracias todo the 3d procedural textures, but the real dificulty is self shadowing. Getting natural looking clouds with Transparent Shadows neds time and patience. I have worked on this problem from time todo time, giving up and trying again some weks, days or months later. Recently, the urge came bak todo me and i started again with new ideas and Will.

Using a cloud texture with alpha applied todo a high number of parallel planes is easy, but it gives only misty clouds with no shadows. Each píxel sen th rouge several planes Will eat some computing power. More planes means better feeling of the volume, but a los a longer rendering time, so it is better todo put semi transparent planes only where there Will actually be clouds.

A great scripts, named cloud Generator (cloudgen, py), coded by Alan Dennis helps a lot and gives rather god results. This script helps making clouds using billboards always facing the Camera, and already textured. They look fine, but as it is their material doesnt react in the light like actual clouds. Appart that it makes quickly the basic setup, the main interest of this script in my humble opinión is that it sems todo place the billboards in the Regions where the clouds are gathered, according todo the density of the alpha texture. If you dont move the empty used as reference for the texture, the billboards Will be only where they are neded, saving some computing power.

Maquíng really believable clouds with Raytracing requests a huge computing power. Raytracing can give realistic self shadowing on these clouds, but this leads todo very long rendering times.

After Many attempts and days of head scratching, y was pretty sure that there was an other bien todo achieve a god result. Using shadow buffer lamps instead of Raytraced lamps was the only posible solution todo get a short rendering time, but all my attempts in this bien had given rather flat pictures with not enough contrasted shadows.

For what i had sen, each attempt of using s todo produce clouds so far had ben done applying s todo closed Mesh, or groups of intersecting closed Spheres or «potatoe» meshes. It is lógical, because s is supposed todo simulate the behaviour of the light inside the object.

As i was coming todo the point where all obvious and lógical solutions had failed, y have had the idea of testing s on flat objects. I mean in this case on the billboards used for my cloud simulation, using the shadow buffer Lamp that hadnt given god result until now.

So, y have switched one more time from Raytraced lamps todo shadow buffer lamps, using this time s. I got almost immediately, not perfecto but encouraging results.

After some more hours spent at testing one by one all the parameters of s and adjusting accordingly the material setup and the lamps setup, y have got the result visible on the following image.

This image is in PAL resolution : 720 por 576, rendered with s at osa 16. It has ben rendered in 01:16:72 on a Quad Core computer at 3ghz.

A Single Frame of the previous animation rendered at same resolution and osa 5 with Raytracing tok between 8 and 10 minutes for a less natural result.

Tutorial volumetric clouds-tutorial-volumetric-clouds-in-blender_img_0.jpg
The dark parts of the clouds are not done using textures. They are the actual result of light passing th rouge the cloud. As shadows are the dificult part, y have set them a bit strong todo show the effect.

The material i have made uses Phong and oren nayar shader. The roughness parameter is useful todo help catching the light, and can be used todo darken or lighten the shadows.

The very god news is that the same frame in Hd resolution (1920 por 1080) takes 07:48:36 todo render. This means that the render time for a Hd image with this method is lower than the render time for a sd image with my previous method.

I still have todo make trials with more clouds, and se the result and rendering time, but afterdays and days of searching a god setup im rather happy of this step.

Here are two the sd and Hd image:
Tutorial volumetric clouds-volumetric-cloud_sss_pal_09.jpg Tutorial volumetric clouds-volumetric-cloud_sss_hd_10.jpg

The making of the scene itself is rather simple.

Using a script todo make clouds is fast, but the dark side is that you cant easily choose where you Will have or havent clouds. Also, you cant choose the shape of the clouds.

In this example, y have modelled a Mesh used as the coarse shape of the cloud, and using a script named dotfiller, py, coded by David bertin, aquí gfa-Mad. I have filled the shape of the Mesh with 300 dots. These dots are vértices not linked by Edges and placed at random in the volume of the Mesh.

The new particle system could be usefull, with its volume característica and billboards particles, but for what i have underestod so far, it sems is not yet posible todo make particles real, so it is not very handy todo use for cloudy skies, but can allow interesting animations for smoke, for example.

You can a los make a Grid, duplicate it manually or using the array modifier, and apply todo it fractal subdivisions.

After that you kep only the vértices by deleting Edges and Faces. Then, you select and deleete vértices here and there todo get the appróximate cloud shape.

No matter the method used, when your cloud of vértices is done:
-Add an empty at the center of the cloud of dots. It Will be used as a reference for the cloud texture.

You could a los use the cloud of vértices as reference object, but later you might want todo remove it from the scene, so you should rather use an empty which is more handy todo animate if you want todo make a moving texture. In the provided blend file, though, the référence object is the Cube placed on layer 3. The tutorial assumes that you make the scene from scratch, so use an empty instead.

Make a small plane that Will be used as billboard, and give it a cloud procedural texture. This Will be the color texture. Setup : object -flat -alpha -multiply. Set the empty name as object reference.

Apply a Subsurf level of 2 todo the small plane. If you dont, you might get bad artifacts later on the Edges. This said, it is still posible todo Subsurf one plane After duplicating, and selecting all the planes and then the one subsurfaced apply the Subsurf modifier todo theothers by Control-c. This opens a menú allowing todo copy attributes : modifiers/Subsurf.

Add a second layer with a blend sphere or a blend halo texture set todo orco -flat -alpha -multiply. It Will make software patches of textures.

The material Will be non Specular todo avoid seing the planes surfaces or Edges, and Will have z buffer enabled, Will be Traceable in order todo cast shadow, it Will receive shadow and transparent shadow trashado.

If your cloud is thick, with Many billboards, you might have todo decrease the alpha value.

The small textured plane Will be parented todo the cloud of dots, and this one Will have duplivert enabled. This way, one small plane is set at the location of each Dot.

Apply a track todo constraint todo the original plane. This one Will use the Camera as target.

At this point, it could be usefull todo display the plane axis, but dont forget todo switch them of After setting the constraint. Make sure that the name and the axis of the small plane are disabled and dont appear in the 3d window, in order todo avoid a crowded scene when duplicate Will be made real in a next step.

After that, you can make duplicate real, and each small plane Will always track the Camera. This Will avoid weird transparencies and artifacts.

The cloud Will have todo receive light from a Lamp using shadow buffer : a spot Lamp.

You can add a slight color todo the cloud using the global ambient lighting provided by the world. The basic light color is black, so if you want todo make the world providing light, you Will have todo choose a bright color with the color picker. The amb slider of the shadr panel Will be set todo amb=0.05.

At this point, the remaining adjustments concerns mainly the s panel, and looking at the blend file is more instructive.

The render panel Will be set todo shadow and s. You can enable Sky if you want todo render the background in the same scene.

If you only render the Sky and the clouds, you can set the osa todo 16, because with thissetup, it makes very few diference compared todo osa 5, on the rendering time (4 seconds on a 1 min render).

If you render something in foreground, a hola, some objects, or anything else, you might have todo reduce the osa samples number in order todo save rendering time. Anyway, in most cases, 5 or 8 samples give a god result.

The s col factor allows todo modify the color of the refracted lights. If the color is bright (near white), a factor of 1 is god.

The TeX factor has an influence on the rendering time. In my example, from 0.000 todo 0.750, the times decreses from 40 seconds todo 10 seconds.

After that, between 0.750 and 0.999 it decreases less : from 10 todo 8.5 seconds. At 1.00, the image becomes white an is not usable.

So, as its value has few effect on the image, a god average for TeX value is TeX=0.750.

I have adjusted the s lighting front value todo 0.20 and the bak value todo 1.000. These values Will have todo be adjusted in an other setup.

Scale = 0.1 in this scene.

Keep the default radio values at r=10.899, g=6.6575, b=2.508.

The IOR is set todo 1.1, but this factor is not critical here.

The error parameter is important. If it is bigger than 0.050, you might se some Edges in the image, between blocks. So, kep it Low, but kep in mind that Low values on this parameter increase the rendering time. Avoid values under 0.015. Use the lowest value avoiding artifacts, and no less. I have used 0.02 in the example.
When, you have the right setup, y advice you todo choose individual centers as pivot point, then select at random a precentage of the billboards, duplicate them and scale them down at half the size of the others, and move them a bit, todo avoid overlapping with the original billboards. Smaller billboards Will add details in some áreas.

An important thing if you want todo fly th rouge your clouds : set the Camera min distance todo 0.00.

I hope that you Will find this tutorial useful. Maybe in a not so far future well have actual 3d Volumetric clouds available in Blender. While we are waiting for such a tool, this setup could help populating our CG skies.

Fel free todo tell me if some things are not well explained, wrong, bad spelled or else.

And of course, im not pretending that this setup is the perfecto solution, so do not hesitate todo tell us if you have a solution allowing faster rendering or higher quality, and por favor show us your images on blenderartists.org.

Thanks for reading.

Philippe.
.

Miniaturas adjuntas
Tutorial volumetric clouds-tutorial-volumetric-clouds-in-blender_img_0.jpg   Tutorial volumetric clouds-volumetric-cloud_sss_pal_09.jpg   Tutorial volumetric clouds-volumetric-cloud_sss_hd_10.jpg  
Archivos adjuntados

Ver más sobre el tema y los comentarios en el foro