Water/Fire/Explosion effects using OpenGL

  • Follow


Hi, I want to ask:

how to make simple water (with waving animation) using plain C & OpenGL ??

it is implemented using water-like looking textures ??

PS. Sorry my english is bad, english isn't my native language :-)
0
Reply Brain 1/31/2011 10:47:15 AM

On Jan 31, 11:47 am, Brain Death

> how to make simple water (with waving animation) using plain C & OpenGL ??

You should look for something called  ' caustics ' :
http://www.opengl.org/resources/code/samples/mjktips/caustics/
0
Reply Jean 1/31/2011 10:57:03 AM


On 1/31/2011 2:47 AM, Brain Death wrote:
> Hi, I want to ask:
>
> how to make simple water (with waving animation) using plain C&  OpenGL ??
>
> it is implemented using water-like looking textures ??
>
> PS. Sorry my english is bad, english isn't my native language :-)

There are zillion approaches depending on which kind of 
water you are expecting. If you assume a shallow water model 
(small depth) or low velocities (the water surface is just a 
heightfield), you can come up with approaches with 2D FFTs 
which work well, or you can even just sum a small amount of 
sine waves whose amplitude depend on the depth and the 
direction and speed depend on wind velocity.

If you want to model the flow of wine in a glass, you'd 
better build a finite element or finite differences 
approach, or some particle in cell methods (PIC, for the 
advection) or FLIP methods.
Things can be complicated if you plan to support multi-phase 
fluids (a mix of water and air, if you want to handle 
bubbles for example) etc.

A very good introductory book for that is the book from 
Robert Bridson, called Fluid Simulation for Computer 
Graphics (if I remember well).

There are also other neat approaches using vorticities, or 
if you want to model the foam or bubbles in a glass of beer, 
or if you want a fast GPU method etc. For all that, you may 
want to check recent proceedings of Siggraph, SCA, 
Eurographics or sometimes i3D...
There is a Graphics Gems with some snippets of code for 
fluids on the GPU I think (or you may even find some online 
code for CUDA).

Everything will depend on the complexity of the phenomenon 
you want to handle with respect to the time you want to 
invest in it, and if you want to code it yourself to 
understand things better or if you plan to use a library.

Cheers,

-- 
Nicolas Bonneel
http://cs.ubc.ca/~nbonneel/
0
Reply Nicolas 2/2/2011 1:59:59 PM

2 Replies
1338 Views

(page loaded in 0.269 seconds)

Similiar Articles:












7/24/2012 9:22:17 AM


Reply: