Sign in to follow this  
HybridUAE

Texturing fluid dynamics grid to convey the movement

Recommended Posts

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): [url="http://www.youtube.com/watch?v=Kgf7AOPe2XA"]http://www.youtube.com/watch?v=Kgf7AOPe2XA[/url] ,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

Share this post


Link to post
Share on other sites
Take a look at this: [url="http://valvesoftware.com/publications/2010/siggraph2010_vlachos_waterflow.pdf"]http://valvesoftware...s_waterflow.pdf[/url]

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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this