Volumetric clouds

Published August 24, 2004
First topic: volumetric clouds.

I recently talked a lot with Sean O Neil (check out his website) and Lutz Justen (his website) about planet and clouds rendering. Lutz has some impressive satellite views of Earth, but he's just using textures - if you zoom at low altitudes, you will see it's only a flat layer of clouds. He does handle shadows of the clouds on the land though. I will use the same approach for space views, but i want the user to be able to come close to the clouds, and even fly through them if possible. My clouds must be volumetric.

Sean has already started an implementation of volumetric clouds - he's even got a demo you can download on his website -. They look good but he's still working on his planet-scale implementation.. i wish him good luck.

All these discussions about volumetric clouds made me want to give it a try myself. It was on my TODO list anyway, so i spent a few hours today to work on it. My current plan is in two steps:
1. Generating a 3D voxel grid that contains cloud densities and displaying it with particles.
2. Merging this technique with a global scale texture. I will probably assign a voxel grid (covering 1 km x 1 km in world space) to each texel in this texture. The texture itself will cover the whole Earth and will be of a high resolution.
More on step 2. in the next days.

As for step 1, i remembered a paper on vterrain.org i read a few years ago about clouds generation. It's called A Simple, Efficient Method for Realistic Animation of Clouds, by Y.Dobashi, K.Kaneda, H.Yamashita, T.Okita and T.Nishita. (Siggraph 2000). I am not quite sure yet if i will do the animation part, but to generate the clouds, this technique is extremely simple to understand and to implement. It's based on a cellular automate; each voxel contains 3 boolean states (humidity, transition phase and cloud presence) and the algorithm uses some transition rules to step the simulation. After a while, puff of smoke, forming clouds, appear. It's a matter of choosing the correct parameters and to be able to visualize the results.

There was a few tricks though. First, by reading the paper too quickly, i didn't realize the parameters probabilities weren't constant for all the voxels. The authors used some ellipsoids to fill each voxel with the probabilities. Since i jumped over this important detail initially, i ended up with a voxel grid filled with noise. Not very nice.

When i spotted the error, it immediately started to look better. I generated ellipsoids randomly over the grid, and the algorithm generated one cloud shape per ellipsoid. The next step was to evaluate the cloud densities in [0-1] by smoothing the voxels (which were still boolean before: there's clouds or there's no clouds), and then to shade the voxels. For shading i cast 16 random rays into the sky and collected the amount of light reaching the voxel.

The final step was to convert the voxel space into a set of particles. Each particle is given an alpha value for transparency which equals the cloud density at the voxel; its radius is constant, and its color is the shading value previously calculated. I then wrote a small viewer to sort the particles by squared distance to the viewer, and render each voxel particle with a cloudy texture.

I haven't optimized for performance yet - i need to optimize fillrate with the alpha test, bandwidth by using something more advanced than OpenGL's immediate mode, and play with the parameters and lighting. One important thing i must implement before switching to the planet scale rendering is impostors. I will not be able to render thousand of clouds, each cloud made of thousand of particles, in real time without impostors.



0 likes 4 comments

Comments

Comments are shown oldest first so the discussion reads top to bottom.
evolutional
Seriously, your work never ceases to amaze me.

Have you looked at the work of Niniane Wang and her team here?
August 24, 2004 12:08 PM
johnhattan
Those are some excellent clouds. Much nicer than that "alpha shaded ball" stuff that I've seen in other games.
August 24, 2004 05:07 PM
Ysaneya
Quote:

Have you looked at the work of Niniane Wang and her team here?


Yes. Flight Simular 2004's cloud are a great inspiration to me. I even bought the game to look at their sky/clouds/atmosphere rendering in details (i'm not too much into flight sims otherwise). I would like to achieve comparable results, but on the planet scale.

Quote:

Those are some excellent clouds. Much nicer than that "alpha shaded ball" stuff that I've seen in other games.


Thanks. I think it's not too bad for a few hours of work, but i am hoping to improve the quality by a lot in the next days. Shading/lighting, specifically.

Y.
August 25, 2004 04:06 AM
LintfordPickle
Hi,

first off, you have an awe-inspiring journal, the video of the camera zooming around the planet and then off into space was quality :)

I realise that you did this 2 years ago now, but Would it be possible for you to post a little more information about how you achieved the volumetric clouds?

E.g. did you have the voxel space extending accross the entire terrain/planet, or dd you have several small voxel spaces per cloud? and did/are you animating the clouds per <n>th frame (like in the paper which you linked) or are the clouds just the result of <n>timesteps using this method, and which will not change shape as time passes? Did you fill the voxel space randomly at the start of the app withrandom hum(midity) values to get the 'randomised' look of the clouds.

Ha, I just realised I could go on and on asking questions :)

Sorry if I'm not supposed to ask these question in a journal, but I'm not sure of the rules for journals (couldn't find any) - if it's inappropriate, please just delete it.

thanks, and great work.

-lintford
June 16, 2008 08:57 AM
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!