Making Clouds Look Better

I always had a problem with my clouds not looking realistic enough. My clouds were looking like they where made out of triangles. As one would turn around them one would instantly see the walls and the shape of the triangles, it did not look realistic at all. I started thinking about it solve my problem and make clouds look better.

Posted by on

I always had a problem with my clouds not looking realistic enough. In Second Antarean War I wanted to fill the maps with stuff - empty space maps are not interesting. The stuff that you find in space are rocks, dust clouds, nebulas, stars and space stations.

My clouds were looking like they where made out of triangles. As one would turn around them one would instantly see the walls and the shape of the triangles, it did not look realistic at all.

I started thinking about it solve my problem and make clouds look better. Older games used billboards. A Billboard is when you have one quad that represents an object. When you move the camera the billboard rotates to face you. The problem with billboards is that they switch too much when you turn, thus making shift, change shape, and looking very odd. I thought of a better way to render clouds, basically, use multiple non rotating billboards and instead just fade them in and out when the angle to them gets steep.

This is the first attempt, billboard-only:

You can immediately see the edges of the cloud polygons. It is even more prominent when you move around the cloud. So the first thing I do is compute the normal of each cloud face:

Then I dot the eye vector with the normal. This way I figure out how much of an angle the face is relative to the camera:

After I make the faces that are at flat angles more transparent:

Still not too transparent, thats why I used power of 2 on the dot value:

Next I apply the original texture again:

Finally I soften the clouds a little to make them look better.

This new way to make my in-game clouds is part of the new shaders and graphics update for 2aw. New shaders requires more computation, but together with the optimized maps I've managed to both make 2aw look better AND faster!

Nice post.
you said that that smoke come at the end really smooth, but what hapen if multiples smokes been fired at same place ? I remember that most games get capped when that happen.

didnt a really few smoke textures composing one shader with soft edges couldnt pass as same ?

But still looking good, I must say.

Author

Yes they could. But i don't think it is really necessary. Many games crap out due to use of overdraw - when you get lots of transparent things in one place. One can reduce overdraw on smoky-things by rendering them all into a low resolution buffer and then scaling them up in the real view, if the smoke is smooth enough no one notices any ways.

this is awesome i wish i could help

Author

You can help by spreading the word!