here: <django.conf.LazySettings object at 0x98ad3ac>

by treeform 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:

http://katana.aff2aw.com/affdata/blog/makingclouds/1.jpg

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:

http://katana.aff2aw.com/affdata/blog/makingclouds/2.jpg

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:

http://katana.aff2aw.com/affdata/blog/makingclouds/3.jpg

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

http://katana.aff2aw.com/affdata/blog/makingclouds/4.jpg

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

http://katana.aff2aw.com/affdata/blog/makingclouds/5.jpg

Next I apply the original texture again:

http://katana.aff2aw.com/affdata/blog/makingclouds/6.jpg

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

http://katana.aff2aw.com/affdata/blog/makingclouds/7.jpg

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!

blog comments powered by Disqus