So I read ATi's paper and looked at their demo and set out to work. Now, I'm not math genious (having only taken calculus and linear algebra), but implementing atmospheric scattering is not for the faint of heart. However, after about a month I had a pretty good working implementation based on the Hoffman and Preetham paper.
Then I started on the water rendering component. There were two articles in Shader X3/4 that were of great help when it came to getting the color just right.
After a couple of months I had a pretty good looking demo. The terrain wasn't anything special, it was just broken down into a quadtree, so I was only able to render 2048x2048 terrain. In order to do this I made the water be at half the height of the terrain and culled the non-visible areas when i was above/below the water, so I was effectively only rendering half of the terrain when I was above/below the water line.
Anyways, on to the pictures:
- 1024x1024 terrain with multi-texturing and aerial perspective
- Sky dome with sun and skylight scattering
- 2048x2048 water plane(size not number of vertices)
- Bloom post processing
- Written in c# and managed directx
And a video of it in action:
The water has realistic coastal coloring, soft edges when it intersects the terrain, under water fogging, and depth fogging.
This summer I plan to rewrite the whole application in c++. I also want to extend the terrain rendering with geomipmapping, fix the huge sun, and add volumetric clouds. I had tried implementing volumetric clouds using mega particles, but didn't turn out too well in a dense cloud field. Worked really well for volcanic or nuclear plumes though. More on this in a later post.