Texturing fluid dynamics grid to convey the movement

Started by
1 comment, last by HybridUAE 12 years, 6 months ago
So let's say I have a traditional fluid dynamics grid of 256 x 256. Within the fluid dynamics simulation you have the velocity of the fluid at each cell.

Given that it's a grid that therefore could easily be made into a grid mesh of vertices, I want to be able to generate texture indices at each vertex of the grid cells to convey the movement of the fluid i.e. water.

I was thinking something along the lines of having a "still" water texture that represents the fluid when there is little or no movement. As the velocity at a vertex increases I would blend in a more turbulent water texture i.e. waves/white horses over the top. However I want these waves to animate in the direction of the fluid at this point.

Is this easy to do? I'm having trouble figuring out how to generate the texture indices on the fly each frame so that the texture is orientated in the right direction each frame as the fluid moves around.

To help visualise what I want to do, see this water from the game "From Dust" (skip to 1:45):
,while that is 3D, it's still a dynamic fluid as such, and you can see their waves/white horses travel in the movement of the water. I want that same effect with the movement and blending in for faster moving water, but with a fluid dynamics grid.

Thanks for any pointers or tips!

Cheers
--- Hybrid ---
Advertisement
Take a look at this: http://valvesoftware...s_waterflow.pdf

The only difference is, they have an artist draw the velocity map for the water surface. You could just use your velocity map directly out of your fluid simulator.
Thanks, I'll have a read of that.
--- Hybrid ---

This topic is closed to new replies.

Advertisement