---- DATABASE ERROR ----

Quick And Dirty: Good Enough Clouds

by Mike Kost

Introduction

Clouds are one of the trickier environment objects to render well in Povray. Convincing clouds require media effects and long rendering times, which is annoying when clouds are not a primary component of the rendering. Sometimes good enough is, well, good enough. This Quick and Dirty tutorial will show how to get some "good enough" clouds using Povray 3.6.

When Is Good Enough Good Enough?

So when is good enough good enough? I've often wanted some clouds in the sky to reflect off water or the infamous reflective sphere on a plane to add some character to my rendered scene. In these cases, I don't need a full-blown, high quality media cloud - I need something that'll render quickly and look good enough in a reflection. Take the scene below, example1.pov, - a few clouds would liven up the reflection off the sphere.

Image to go with example1.pov

Layers Of Planes

To get quick rendering times, the first rule is make a texture and slap it onto something. This is how my early clouds started out, but they lacked depth and color variation that make real clouds look amazing. To get that depth and color variation, add multiple layers of planes. With the added planes, the clouds get true depth while allowing color or ambient finish variations between the layers to add some complexity to the rendering. The easiest way is build this is to declare a cloud pigment P_Cloud and apply it onto my layers of planes.

The plane layers look something like this:
union {
    plane {
        <0, -1, 0> 0
        texture { pigment { P_Cloud } finish { ambient 1.0 }  }
    }
    plane {
        <0, -1, 0> 0
        translate <0, 5, 0>
        texture { pigment { P_Cloud } finish { ambient 0.6 }  }
    }
    plane {
        <0, -1, 0> 0
        translate <0, 10, 0>
        texture { pigment { P_Cloud } finish { ambient 0.8 }  }
    }
    plane {
        <0, -1, 0> 0
        translate <0, 15, 0>
        texture { pigment { P_Cloud } finish { ambient 0.4 }  }
    }
    translate <0, 1000, 0> // Put in correct space in sky
}

It is important to translate the individual planes before applying the texture. If the texture is applied, and then the planes are put in their relative positions, they will all have the same pigment applied since they were all at y=0. In this example, I've varied the ambient finish values to change how dark or light the clouds look.

Adjusting P_Cloud

By creating our cloud layers with planes, we've pushed the problem into our P_Cloud pigment. Generally, my P_Cloud's take some form similar to
#declare P_Cloud = pigment {
    bozo   
    turbulence <1,1,1>
    octaves 6
    lambda 2
    omega 0.5
    color_map {
        [0.00 color rgbt <1.00,1.00,1.00,1.00>]
        [0.45 color rgbt <1.00,1.00,1.00,1.00>]
        [0.55 color rgbt <0.50,0.50,0.50,0.50>]
        [0.00 color rgbt <1.00,1.00,1.00,0.00>]
    }
    scale 1000
}

To get a P_Cloud that feel right for my rendering, I create a dummy Povray file, observe_clouds.pov, and render it several times, tweaking parameters each rendering. The Povray file includes a sky_sphere to create the blue sky, the plane layers, and my P_Clouds declaration. I have it look directly at the clouds to get a feel for what the reflection will see. When I want to hit the problem over the head, I use my POV-Broom scripts to do batch renderings. I ended up with the following clouds after playing with my settings.

observe_clouds.pov output

The source for P_Clouds is shown below:
#declare P_Cloud = pigment {
    wrinkles
    turbulence <0.5, 0.5, 0.5>
    octaves    7
    omega      0.5
    lambda     3
    color_map {
        [0.00 color rgbt <1.00,1.00,1.00,1.00>]
        [0.50 color rgbt <1.00,1.00,1.00,1.00>]
        [0.60 color rgbt <0.50,0.50,0.50,0.50>]
        [1.00 color rgbt <1.00,1.00,1.00,0.00>]
    }
    scale <1200,1200,1200>
}

Putting It Together

After getting the clouds the way I want them, I insert the cloud layer and P_Clouds into my original. The new example2.pov renders and gives reasonable cloud reflections in the sphere.

Image to go with example2.pov

Want To Know More?

Using multiple planes to create clouds is well discussed in the Povray community, and a few people have additional information on making clouds.

Last Edited: 11/15/04

Copyright (C) 2004 Mike Kost