Re: [Algorithms] Water Effects
Brought to you by:
vexxed72
From: Pierre T. <p.t...@wa...> - 2000-08-27 09:58:28
|
Don't know if it can help, but here's a copy of an old answer to a private mail from John Ratcliff. Nothing to add since last time. :) Pierre ================================================ -----Original Message----- From: Pierre Terdiman [mailto:p.t...@wa...] Sent: Monday, May 22, 2000 1:46 PM To: John W. Ratcliff Subject: Re: Water effect Hi John, I can't post the executable because it used a commercial engine for which I simply haven't the rights. I worked on it for one year, but now I don't work for the same company anymore, and I think they wouldn't allow me to spread all that stuff. Now, the demo isn't really useful since you have me instead :))))))) My approach was easy, it was just a 3D version of the ultra-famous 2D water effect (seen in several demos for years, and recently rediscovered in a Game Developer article). This is not physically correct, but the result looks nice. I tried more physically accurate methods in a school project called Vortex, where I used an algorithm by Nick Foster and Dimitri Metaxas. The results were just a little more exact (the rotational part of the Navier-Stokes equation was taken into account for example), but taken as a whole it wasn't visually better. On the other hand it took a lot of time to compute, sure. Hence, I usually take the old demoish route. (historical notes: I first saw that water effect in a very old DOS demo by a spannish group called Iguana. It appears one of their members, JCAB, is a well-known name on the algorithms & DX lists....small world). I also have an old 2D version of that, somewhere on my site. Should be in www.codercorner.com/Oldies.zip, but the download is quite big, and the effect is the same as in the recent GD article, so just download it if you're curious - and if you can run pure DOS mode programs. The 3D version is a simple height-field computed from the 2D water picture. I also use a bitmask texture telling me where the coasts are, and where the water is. Using that mask in the computation makes the water bounce on the coasts, which is quite convincing. I sometimes add an extra filter on the computed water height-field, to smooth it. But this tends to be slow. Oh! It should be possible to compute the whole thing using hardware texture blending, SetRenderTarget, etc. That would be some "hardware fluid dynamics", and it apparently looks like the recent Kim Pallister article about procedural clouds. It looks painful to implement anyway. Never tried. That was the modeling part. To render the water, I think the best way nowadays is with cube-mapped refractions. I guess you already know the NVIDIA demo showing that effect in action. (there's another one - better - for the GeForce2, originally found on the Kano website - I can find the link if you don't see what I'm talking about). Kim Pallister also had a demo with bump-mapped water, which is really one of the best way to handle that part - but of course, it just runs on G400, and I haven't such a card. Some of the most convincing water images from Ken Musgrave & al, are just rendered with an fBm as a bump map. Easy and efficient. Now, some really convincing water images were produced by Arete Software, and used in some films (Titanic, 5th Element..). Strangely enough, it looks quite easy to do. Really looks like my 3D water mixed with a bump map (a fractal cellular noise for example, as seen in SIGGRAPH'96, is damn convincing for water.)....Those last pointers shouldn't be possible in realtime anyway (...well, I'm not even sure of that, nowadays everything is possible, isn't it?) The biggest problem I can think about, is the size of the needed water. That's quite easy to produce convincing water on a little scale, but producing oceans the same way is ....well, not possible. I don't have a lot of time to continue my water-tests, but fractal mountains and landscapes are one of my all-time favorite computer topics, and I'd be glad to follow your quest in search of the perfect water! Attached is a snapshot of the 3D water field, once rendered with a diffuse and a specular texture. Note the aliasing problems. That's why I add a smoothing filter sometimes. I saw the same effect in a PS2 game, in a fountain. That's exactly what I said before: interacting with a particle system, it looks really nice for a simple fountain. But it may be quite hard to use the same effect on a very large scale, e.g. for seas, etc... Ok, enough! Pierre ----- Original Message ----- From: John W. Ratcliff <jra...@ve...> To: <p.t...@wa...> Sent: Monday, May 22, 2000 9:39 PM Subject: Water effect > Pierre, > > Are you going to post an executable demo of the water effect in your > terrain demo? I'm real interested in exploring different approaches to > the problem. > > Thanks, > > John > |