Thread: [Algorithms] Water Effects
Brought to you by:
vexxed72
From: Pai-Hung C. <pa...@ac...> - 2000-08-26 17:40:58
|
Hi, Does anyone know how the fantastic water effect is done in Outcast? Is there any good 3D water-effect tutorial on the web? (I know GameDev has one, but only 2D.) Thank you for the help, Pai-Hung Chen |
From: Charles B. <cb...@cb...> - 2000-08-26 18:27:55
|
The outcast home page has a description of their water technique, as well as a lot of other cool tricks. Unfortunately, their algorithms only work with their software renderer for their voxel engine. The recent "Game Programming Gems" book has a little article by some ATI guys (Jason Mitchell + some guy) on 3d water effects. Basically, they just wiggle some verts with trig functions, and then do some nice UV mapping for reflection and refraction simulation. The water in Halo has been talked about alot. It would be nice if someone wrote up a summary of all the tricks for water (I've been meaning to). (For example, it's well known that "particles can be used to simulate the specular flicker", but I've never seen a good write-up of that technique). My basic summar of how to do water is to start with reflection, using EMBM or environment mapping or something. Refraction is pretty irrelevant for large bodies of water, you basically can't see into them. Once you've got the water base-textured with the reflection map (with uv's wiggled to simulate waves) you need to lay some fake speculars on. I would do this with a black and white texture. You simply tile it, and wiggle the uv's to make it irregular, and lay it down as an additive pass. Then, rotate the uv's and wiggle them differently and lay down another additive pass. The combinatin of the two passes, both wiggled a bit, is that you break up the regular tiling pattern that afflicts most water. Also, if you shift the uvs of both passes you get a nice irregular wave effect. Of course, to simulate the height of the water, you just do the old 2d wave effect and make a mesh from it. A bit rushed and incoherent, but hopefully you get the idea... At 10:34 AM 8/26/00 -0700, you wrote: >Hi, > >Does anyone know how the fantastic water effect is done in Outcast? Is >there any good 3D water-effect tutorial on the web? (I know GameDev has >one, but only 2D.) > >Thank you for the help, > >Pai-Hung Chen > > >_______________________________________________ >GDAlgorithms-list mailing list >GDA...@li... >http://lists.sourceforge.net/mailman/listinfo/gdalgorithms-list > > ------------------------------------------------------- Charles Bloom cb...@cb... http://www.cbloom.com |
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 > |
From: Vladimir K. <vka...@si...> - 2000-08-27 11:51:05
|
Hi All, Also it is difficult to combine animated water grid with geometry based reflections (not rendered into texture). So my ocean has flat water :) vlad |