Advertisement

3D Water

Started by May 22, 2000 12:46 AM
20 comments, last by Jallen 24 years, 5 months ago
Does anyone know of a fast and good looking way to create 3D water in OpenGL? What I would like is rippling water (random rippling, not waves) similar to the water in certian levels in Half-Life (bounce for example). I have managed to make my own water with bezier meshes, mocing all the control points randomly... problem is..this way is extremely slow. Especially if I draw a transparent object overtop of the moving water or do anything else complex at the same time. Any help is appreciated, Jason A. --- I write code.
---I write code.DelphiGL (http://delphigl.cfxweb.net)
I haven''t done anything with water, so anything I say after this sentence may be true or not true so don''t flame me if I said something stupid or wrong..
Any water that you want to be real 3D is going to be a polygon hog. I have that demo that comes with the GeForce which has water in it. While you don''t move, the FPS is alright, but if you move or rotate the camera, it jumps very severly, so I would say that a full 3D approach might be bad. You could try doing something like that flag effect in one of NeHe''s tutorials only "clamp" the edges of the water down, and maybe do the effect at random places... just my ideas
||--------------------------||Black Hole Productionshttp://bhp.nydus.netResident expert on stuffmax621@barrysworld.com||--------------------------||
Advertisement
Three words: environment bump-mapping.
Check out Nvidia''s site ( developpers section ). It has pretty good demos:

www.nvidia.com

Y.
Hi Jallen,

As it has been pointed out, it can get pretty expensive to have a constantly (and random) morphing mesh to represent water... but damn it looks cool

A cheaper alternative is to trick people with animated/cycling or procedural textures. Now, I am far from being a guru, but I think this would be a shiteload faster than squillions of tiny polys, and it looks almost as good.

The only problem in your case would be the 'randomness' of this approach... obviously animated/cycling textures won't look very random at all (unless you have a lot of different textures), but with a bit of effort, a nicely randomesque procedural texture could work... to tell the truth, I've got no idea how to go about that though

-------------
squirrels are a remarkable source of protein...

Oh crap, I just remembered that if you're using openGL texture objects (if you're not, you should be), you can't get access to the actual texture to alter it. That prolly rules out a randomising procedural approach... d'oh

Edited by - Bad Monkey on May 22, 2000 7:57:01 PM
I tried Nvidia''s stuff but couldn''t even get it to compile. Not to mention it was extremely complex, I couldn''t even locate the code where they do the water thing .

Problem with environment-bump mapping is that its not supported in my TNT (i think only GeForce and G400''s have this feature).

Yes, I am using texture objects, until yesterday I had no idea there was another way . It would be nice if I had access to the texture coordinates but unfortunately I don''t.

Anyways, thanks for the replies...I will keep looking. I wish I had access to Half-Life''s source code

Jason A.

---
I write code.
---I write code.DelphiGL (http://delphigl.cfxweb.net)
Maybe you could make water like the GeForce demo but with LOD management? I mean, when you move, use less polygons than when you''re still. Remember that the GeForce demo is a demo, which means it is used to show what the machine can do. It uses a large number of polygons, when you can achieve something similar with a lot less of these.

My idea, no way to test it at home.

Eric Laberge
----------------------------------------"Inash neteia haeg joa kavari quilm..." SD4
Advertisement
Well I am not really gonna be moving the camera at all, it will just be sitting there onscreen moving, dunno how LOD would really affect it.

I could use it to use less polygons the farther away from the screen the water is. That would probably increase the speed. I don''t really have access to the individual faces though.

Jason A.

---
I write code.
---I write code.DelphiGL (http://delphigl.cfxweb.net)
Maybe you could contact Pierre Terdiman, I think he has done exactly what you want, take a look at the Image Of The Day at flipcode.com.

----------
Drago, VerSoft
osu!
Take a look at www.hangsim.com/vs
Ilan has created a tiling system to represent large areas of ocean with varying sea states. Not sure if its what you want but worth a look.
i have an idea..carnt you youse brice 4 to get the simulation of moveing water and inport that to your program,
if you can i can draw the animatiom up for you ,as well as water movement i can make the textur move as well.

This topic is closed to new replies.

Advertisement