# Fully interactive ocean surface

This topic is 4760 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I'm currently working on getting a real large water surface, which can be interacted with such that objects moving through the water can cause waves and splashes. The physical simulation of the water surface is done using pressure differentials as described in Yann's water lecture. This method works well for the interaction with a calm surface but what I'd like to do is to have a surface with wind-driven waves which can still be interacted with. The wind-driven waves could be calculated from e.g. FFT. In my application the water surface will be almost infinitely large, with few object interactions. The FFT will be the main producer of height data and then small areas will be created where object interaction is needed. In this areas the FFT data has to be modified due to the interaction. Is there any good methods of combining the two methods of creating height data? When pressure differentials are calculated the FFT data has to been taken into account too. Has anyone seen examples of this? Other suggestions/reflections? Regards, E

##### Share on other sites
Quote:
 Original post by ecccoI'm currently working on getting a real large water surface, which can be interacted with such that objects moving through the water can cause waves and splashes.The physical simulation of the water surface is done using pressure differentials as described in Yann's water lecture. This method works well for the interaction with a calm surface but what I'd like to do is to have a surface with wind-driven waves which can still be interacted with.The wind-driven waves could be calculated from e.g. FFT. In my application the water surface will be almost infinitely large, with few object interactions. The FFT will be the main producer of height data and then small areas will be created where object interaction is needed. In this areas the FFT data has to be modified due to the interaction.Is there any good methods of combining the two methods of creating height data? When pressure differentials are calculated the FFT data has to been taken into account too.Has anyone seen examples of this? Other suggestions/reflections?Regards,E

Indefinitely large, accurate, largescale ocean simulations are a hard thing. It is not possible in real time the way you described it, especially if you want to get local effects like spashing waves and airborne particles.

Just for reference, Intel had a tech demo last year with 4 CPUs doing accurate deep-ocean current simulation at about 50FPS -- with a 256-square grid.

GPU Gems 1 had a moderately good water simulation article near the front, but I don't think it's the kind of water you have in mind.

SIGGRAPH 2001 had a great session on wind and water. Tessendorf's paper would interest you. I'm sure there are many good papers in there (and in many other years as well) that might help you out.

These are some links you might be interested in. Be prepared to sacrifice most of your CPU time to any of those algorithms, though.

frob.

##### Share on other sites
Hello,

I'm assuming this is for a game. 2D fluids simulator based on pressure differentials is just what you need. You just need a LOD algorithm for the viewport.

I've thought about this before when I had the idea to make a huge MMORPG WaterWorld style (you build ships and subs, etc) (no longer using this idea for now so if anyone wants to pick it up just do ot :) ) The solution I had in mind is a a 2D fluids sim in the area around the "boat" or the viewport and about 1km away the resultion decreases. On the far horizon and where nothing happens (ie. ocean has no interaction) just a good vertex shader animation. If you want huge see battle animations, you may get in trouble, but if you can use camera tricks to occlude unintresting parts of the ocean you can improove performance. Also in big action scenes the player's focus is on the action, so you have some faking headroom.

In conclusion, search for hight-map occlusion techniques (based on quadtrees or whatever) not to occlude but to use them to define the level of detail of the ocean's interaction. Near the camera and interaction you scale up resolution of interaction grid, where you only see consequent riples (ie. not so close to intraction) you down scale resolution and where all you need is an animation to "imposter" the eye... Just precompute. Or if you meant real scientific simulations, you could base the idea if you accept certain approximations. And for 2D fluids sim check out:

http://panoramix.ift.uni.wroc.pl/~maq/eng/index.php (lots of examples on fluid solvers)

Hope this helps

JVFF

PS. Sorry for long posts :(

##### Share on other sites
Thank you for your replies. That is pretty much how far I've come though, so I'll try to redefine my question.

What I have is a graphical mesh, with a viewport based tesselation, as described in the Projected grid concept. (The first link at www.vterrain.org/water)
When there's no objects interacting with the water surface this mesh is always in the same plane, world space. Shaders is used to get the impression of waves.

When an object gets near to the surface, a new grid, used for physical calculations with pressure differentails, is created beneath the object. The graphical mesh then samples its height values from the physical meshes.

As there's not too many interacting objects in the application (yep, a game ;) ), this method with different meshes works pretty well. The physical meshes doesn't have to get too high-resoluted (65-square is enough) so the framerate stays at a decent level.

Now I was thinking of letting the graphical mesh sample its height values from a FFT to get wind driven waves. The problem would be when there's interactions with objects, as the FFT height data has to be taken into account when calculating the pressure differentials.

What I'm interested in is if anyone has calculated pressure differentials combined with a FFT based model.

/E

##### Share on other sites
EDIT: Sorry, didn't correctly read your first post. So the solution is to use the FFT generated data to create pressure differentials. The higher the water column, the more pressure it has. From there you can calculate the differentials based on the original pressures of the pressure-differential data field.

I'm not really sure in what data the FFT generates. I'm not really familiar. If it is pressure-differentials then you can interact with the meshes. If it is a hight field you could also use it as some sort of pressure differentials for the 2D mesh (higher colums = higher pressure from these columns). If it generates movement data you can use them to create pressure differentials if you consider that the movement is created by higher pressure cells. I'm sorry for not really being able to help. Could you enlighten me a bit what the FFT is doing and what data it is generating?

Hope this helps,

JVFF

##### Share on other sites
Hi

Do you have the link to Yann's water lecture? Cheers.
By pressure differentials do you mean a spring-based system?

Thanks

##### Share on other sites
Found from gamedev post found by google :)

http://www.andyc.org/lecture/viewlog.php?log=Realistic%20Water%20Rendering,%20by%20Yann%20L

I read it some time ago and it really covers it well. From the lecture, Yann uses the heightfield to define the static pressure of each cell. The formula is on the lecture.

Hope this helps,

JVFF

##### Share on other sites
Ah yes, I've seen that before; thanks, you've been very helpful.

##### Share on other sites
Sorry for taking time to respond. To use the FFT data in the pressure calculation should be the right way to go. I'll look into it later in the week when I got timetimetime.
Thank you jvff for your help.

/e

##### Share on other sites
There's an article on using vertex texture fetch for realistic water sim. in GPU Gems 2, and it's one of the free ones at
GPU Gems 2

• ### What is your GameDev Story?

In 2019 we are celebrating 20 years of GameDev.net! Share your GameDev Story with us.

• 10
• 11
• 13
• 9
• 11
• ### Forum Statistics

• Total Topics
634092
• Total Posts
3015448
×