Saturday, June 6, 2009

Rendering water

Here's about rendering water.

Water plays an important role in all terrain renderers used in modern games and visualizations to present outdoor areas. This is because it improves general image quality in an extent bigger than any other technique and makes it more photorealistic. Alas, even though it tends to look better and better with every game released it is still far from being realistic.

Besides, deferred shading gains popularity every month. Many newer games and engines make use of it, eg. Starcraft 2 and Tabula Rasa. Though deferred shading is typically used to limit lighting-related operations from O(objects_number * lights_number) to O(objects_number) I will prove that it can be helpful in many more algorithms.

In this article I will describe a technique of realistic and flexible water rendering by using bump mapping in the post-process stage just after deferred shading. The presented technique fits into the concept of deferred shading pretty nicely, i.e. it helps to avoid additional geometry rendering. A description on deferred shading can be found in [1], [2] and [3]. It is possible to implement this technique using forward rendering but in this case it seems less natural and may require additional work.

The presented algorithm eliminates the majority of the flaws of typical techniques used for water rendering such as hard edges or unrealistic colour extinction. I will talk shortly about common drawbacks in the section “Traditional approaches to water rendering”.

Theory behind water

The theory behind water is very complex and not fully understood. It will suffice to say that there is no adequate formal model describing it so far. Survey conducted by Guillot [4] proved that none of the 46 models he analyzed is valid when compared to reality.

Existing models are also a way too complex and computationally expensive to be used for real time applications, especially games. A game should not spend most of its CPU or GPU processing time just to update and render realistic water.

So a completely different solution has to be found.

In my opinion the theory of water for real time applications can be divided into two categories:

  • Waves - their animation, propagation and interaction with the rest of the world
  • Optics.
To simulate waves propagation, FFT (Fast Fourier Transform [5]) is frequently used. In this article I do not focus on waves propagation and so I will skip the theory behind it. I strongly believe that what is more important for good looking water is optics and I will describe it in a very detailed way.

No comments:

Post a Comment

Bookmark and Share

Sponsor Links

Stop drawing and painting figures the hard way!
Draw People and Figures Perfectly!
Over 1016 Detailed Illustrations!
www.anatomydrawingsecrets.com

Learn How To Draw CARICATURES
Step By Step Videos!
Easy Step By Step Lessons
www.learn-to-draw.org

Stop drawing cartoons the hard way!...
Finally! You Can Draw Cartoons
Cartoons Drawing can be both a FUN and PROFITABLE hobby or pastime!
www.cartoon-drawing-made-easy.com