View more

View more

View more

### Image of the Day Submit

IOTD | Top Screenshots

### The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.

# Broken Fluid Solver

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

1 reply to this topic

### #1ray_intellect  Members

Posted 20 March 2013 - 05:26 PM

Hi,

I am not sure if this is the correct place to post this because I working in OpenGL and CG to create a fluid solver based on the GPU Gems 3 chapter

Real time Simulation and Rendering of 3D Fluids

The code I have at the moment is in CG, and is based on the Render To Volume example in the OpenGL 10 SDK by Nvidia. The example shows a simple solution to the wave equation so I thought it might be the correct place to start.

I set point filtering in the C++ code, however I could not add the 0.5 to the texel coordinates because the fluid tended to diverge quickly in the direction of the corner of the box -I am not sure if CG needs to add the 0.5 to get the texel center.

Edit: I'm convinced its the texel center problem - I found a resource about CG that explains some stuff so I have removed the code for now, I'll repost the program if I can fix it.

Edited by ray_intellect, 20 March 2013 - 08:06 PM.

### #2ray_intellect  Members

Posted 20 March 2013 - 10:13 PM

Sorry for the double post, however I thought I should add this again

Using this code for each function I made a transformation of the coordinate "x" to "x + 0.5 * texelSize" and then relied on the float3(1.0f, 0.0f, 0.0f) * texelSize

to look up the coordinates.

I tried some variations of this method, with no conclusive results, only a real problem in calculating the correct colour. I saw some fluid like effects with very clipped color, mostly the more realistic and wavy looking fluids seem to be an explosion - or perhaps the container seems to fill with fluid - this is after the transformations were applied (on my other computer I have windows xp and opengl 4.0 but on this pc I have windows 7 and directX 10).

So I'm looking for an answer for the mathematics involved - i.e. what is this fluid supposed to be, how is the input supposed to be applied ? Is this an explosion ? etc

Also if anyone can make use of this then good luck

#### Attached Files

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.