CS 6610 Final Project

James Angel

December 7, 2002

 

 

Clouds In OpenGL (Various Methods)

 

For the final project in this class I have explored several rendering techniques used toward the creation of virtual clouds.  Unfortunately, the two most sophisticated and rewarding methods proved to be more involved than I had anticipated.  I implemented instead three somewhat less complicated methods, the last of which (billboarding) produced some quite convincing results.

 

Below I give a description of the two methods I planned to implement, how far I got in each case, and the alternative methods I came up with instead.

 

 

Translucent Volume Rendering

 

My original intent was for this to be the main focus of the project but after looking into what was required, I realized I had not left myself enough time to both implement a volume renderer and then go on to develop the perturbation and lighting algorithms that are needed for the creation of convincing clouds.  A description of this method was presented at the 2002 Visualization conference. [Kniss, 2002].

 

 

Particle Systems

 

Particle system cloud generation is well described  by Mark Harris both in his latest paper [Harris, 2001],  and on his website:

 

http://www.cs.unc.edu/~harrism/clouds/index.html

 

Harris describes the use of multiple forward scattering for realistically shaded cloud and anisotropic scattering to simulate the “silver lining effect” observed when a cloud comes between the viewpoint and light source.

 

My code has been set up with the intention of using Harris’ method.  Unfortunately, I didn't leave myself enough time to light the particles in a realistic manner. Notice the clouds appear as if fully lit in the screen shot below. 

 

 

What’s There

 

What I have put together is a particle system model (modeled after Harris’) that is a list of structures each with it’s own 3D position, radius, density, and color.  In an intermediate step on my way to implementing Harris’ algorithm, I have displayed the system in my openGL space by representing each particle as a blob with appropriate position, “radius”, and density, which I represented by assigning to alpha.

 

To make these intermediate clouds a bit more convincing, I added Perlin noise, which makes the resulting cloud appear a bit less cartoonish.  Never the less, the result looks terribly solid and heavy. 

 

My third attempt makes use of “billboarding.”  I use the same model as above, but render each particle as a 2D texture.  The texture I use is a gaussian point and is RGBA.  Most of the image is transparent.  Only at its center is it opaque.  By layering this image over itself according to the cloud model it is possible to assemble very convincing cloud fields.  That each particle has unique density (which corresponds to alpha, or translucency), radius, and randomized position is essential to the model.



The GUI

 

The GUI for this project allows the user to switch between a few different methods: my “NPR” kludge, the kludge with Perlin noise added, particle systems, and volume rendering.  Of course, I only succeeded in implementing the first two, so there’s not much functionality here as of yet.

 

The clouds, such as they are, can be shaded or rendered without shading via a checkbox.  Without shading those particles with low density look almost glass-like.

 

I’ve also included the standard camera translation and rotation controls, as well as a spinner to rotate the directional light source about the scene.

 

 

Other Features of Note

 

The model for the particle cloud is made in two steps.  In the first a ball of particles is defined.  Following this a disk of particles is defined just below this ball.  The result looks a bit more cloud-like than either a spheroid or ellipsoid (or random) distribution of particles.

 

To add a bit of realism to the scene I added a moon, which shows appropriate phase, given the position of the light source - the “sun.”  (Notice I made the ambient material property of the moon to be slightly reddish, to simulate the lighting cast on the moon by the earth, filtered through the earth’s atmosphere. 

 

Note the texture mapped floor which I made to look like lower layers of cloud cover below the main rendered cloud.  There is also sky box to simulate night which can be turned on and off by means of a checkbox.

 

 

What I Could Add Next

 

Beyond the implementation of Harris’ system and Joe’s volume rendering-based technique, there are a few other additions I might like to make to my scene. 

 

It would be very simple to add a slight curvature to the floor of the present scene to make it all look like the rendered cloud was very high in the earth’s atmosphere.  The cloud model could be stretched out horizontally to more closely resemble high atmosphere cirrius cloud.

 

Wind to push the model around, affecting certain parts of the cloud more than others, so as to distort it over time, would be another very visually compelling addition.  The motion of the sun, moon, and stars (perhaps with 24 hours elapsing in one minute, e.g.) would be another fun animation.

 

I also planned to change the color of the light source as the sun moved down in the sky.  The light source should wane in intensity and grow first yellow, then orange, red, and finally fade altogether as the disk of the sun passes below the “horizon,” after which point there should be some afterglow.

 

 

Resources

 

[1] KNISS, JOE M.  Interactive Translucent Volume Rendering and Procedural Mapping. Visualization Conference, (2002).

 

[2] HARRIS, MARK J.  Real-Time Cloud Rendering.  Eurographics 2001.

 

[3] DOBASHI, Y. ET AL.  Interactive Rendering of Atmospheric Scattering Effects Using Graphics Hardware.  www.graphicshardware.org/program.html

 

 

Joe provided me with the C++ Pnoise class used to perturb my sphere.  The code came originally from Perlin’s site: http://mrl.nyu.edu/~perlin/

 

Miriah gave me a link to a project she did using Harris’ method.  I used her gaussian_point.tga.