Not logged in, Join Here! or Log In Below:  
 
News Articles Search    
 


Submitted by Gottfried Chen, posted on March 03, 2002




Image Description, by Gottfried Chen



Here is what I've been doing recently. After some research I've implemented some realtime water algorithms I found to be interesting.

The top row shows two shallow water algorithms. On the left I use an algorithm that was used in an old SGI demo called Newave. On the right I've implemented the old 2D demo water (there is a description of it in "Game Programming Gems 1" and somewhere on gamedev).

The bottom row shows deep ocean water simulation described in Tessendorf's paper http://home1.gte.net/tssndrf/index.html and by Lasse Staff Jensen (http://www.gamasutra.com/gdce/jensen/jensen_01.htm). On the left is the basic statistical water method and on the right with the choppy waves displacement applied. The statistical water is tileable so you can generate bigger patches of water by tiling the geometry.

I've started my research after reading Jensen's paper and seeing screenshots of it, but being unable to find any running demo or source code implementing the deep ocean water, so I had to do it on my own to see it in motion.

A running demo of the water algorithms can be downloaded at www.chengine.com. (The demo also implements another method called "Gerstner Waves" but the results are rather unconvincing, further I've removed the dampening from the 2D water so it runs forever, but oscillates a bit heavily). I haven't put much effort into shading the water, it's just a water texture with an environment map blended on top of it. Further you can download the source code for the water surface simulation. (Just download the GameEngine source code and look into the Terrain library). I didn't post the source code for the demo itself because it is quite a mess and so I don't want it to become public :)



[prev]
Image of the Day Gallery
www.flipcode.com

[next]

 
Message Center / Reader Comments: ( To Participate in the Discussion, Join the Community )
 
Archive Notice: This thread is old and no longer active. It is here for reference purposes. This thread was created on an older version of the flipcode forums, before the site closed in 2005. Please keep that in mind as you view this thread, as many of the topics and opinions may be outdated.
 
Twig

March 04, 2002, 06:26 AM

I love the last deep water one - it would make a really relaxing screensaver :)

 
Rasmus Christian Kaae

March 04, 2002, 06:57 AM

I really liked your implementation of Lasse Staff Jensens algorithms, however your 2D water algorithm could be improved alot (it over oscilates, just as you mentioned).

Wouldn't it be possible to simulate water using a diamonsquare plasma/fractal as heightmap for the water-level?

 
Mikko Siren

March 04, 2002, 08:16 AM

Look really nice. The last algorithm in the demo reminds me why I didn't always like sailing when I was a kid =)

 
_Nameless

March 04, 2002, 05:57 PM

Amazing!

The first two are a little unconvincing and the third one doesn't look like water at all, but the last two are incredible!

Especially the final algorithm -- add a bit of foam and it'll look completely realistic!

Works perfectly on my system:
Athlon 1400
512MB DDR PC2100
GeForce2MX, WinXP

This is definetly one of the more impressive screenshots I've seen lately.

 
Gottfried Chen

March 05, 2002, 04:24 AM

The shallow water algorithms definitely need dampening and a little smoothening. But that's very easy to add, I just haven't done it yet. If you mean midpoint displacement by diamondsquare fractal, I've used that for terrain, but haven't tried it for water. You'd need some way to parameterize the fractal so you can modify it over time, but I guess it wouldn't really look like water.

 
Mike Nelson

March 05, 2002, 08:57 PM

Gottfried ,
I'm very impressed with your water demo. Congrats! I know how challenging this is to do!

I also was inspired by Tessendorf and Jenson's papers. I built a little screensaver based off of them a while back. Doesn't look nearly as smooth as yours though. Part of the reason mine is lacking is because I couldn't figure out how to implement the FFT within sinusoid/height field conversion, so mine is pretty slow on most systems. I'm sure I don't understand FFT fully because I don't see how it would be faster. If you or someone could point me in the right direction on how to implement it...? The source code for my screensaver is available on my site. Any comments or suggestions would be greatly appreciated. I got caught up in another project before I could figure it out, but now I have a little time for this again.

Mike

 
Lasse S. Jensen

March 08, 2002, 04:30 PM

Hi all! Nice to see that there's finally public sources for this. I would just like to mention that we did get permission to release some divx of our work, so for those that didn't see it:

http://www.swrendering.com/water.html

Also I would like to stress the WE fact.. Robert Golias deserves just as much (if not more) credit as me!

Cheers,
- Lasse S. Jensen

 
This thread contains 37 messages.
First Previous ( To view more messages, select a page: 0 1 ... out of 1) Next Last
 
 
Hosting by Solid Eight Studios, maker of PhotoTangler Collage Maker.