Page 1 of 1

[GSoC] 3D Fluid Fizzics Engine

Posted: Wed Apr 02, 2008 9:18 am
by leafclone
Hi, I study computational physics modeling. I am developing a real time water wave algorithm on my own, which I plan to publish as a thesis. Looking through latest simulation techniques often surprises me with their brilliance in algorithm and tactics, and I often thought that it would be very useful if someone would develop a physics engine that concentrates on fluid, so that using that library, the developer could express a wide variety of fluid phenomena. I know the deadline for GSoC has been postponed until Apri.7 so I would be very happy to get as much comments I could get.

Well, here goes my abstract.

***

In this project, we present physics engine library that specifically deals with the dynamics of water surface. The engine provides novel algorithms that solves 3D water motion in real-time. The embodiment of general advection of water is an important part of our physics system; however it is an aspect commonly neglected in previous models of water surface, mainly due to computational cost reasons. The physical state of the surface is represented by set of two dimensional field of physical values, including height, velocity, and the gradient. The evolution of the velocity field is handled by a velocity solver based on the Navier Stokes Equations. We integrate the principle of the mass conservation in a fluid of equilateral density to update the height field from the unevenness of the velocity propagation, which in mathematical terms can be represented by the divergence operator. Thus the model generates waves induced by horizontal velocity, offering a simulation that puts force added in all direction into account when calculating the values for height and velocity for the next frame. Other effects such as reflection off the boundaries, and interactions with floating objects are involved in the algorithm. In this fluid-specified physics engine, we chiefly gear towards simplicity for game developers. Apart from our novel algorithm we also plan to inlcude famous physics models and physics solver algorithms from past researches(FFT, Wave particle, Stable fluid, Fluid interaction with rigid bodies), basically providing a framework for fluid physics system. Using the library, developers do not have to implement every complex algorithm suggested in the state-of-the-art researches.

Posted: Wed Apr 02, 2008 9:19 am
by leafclone
// Detailed Description

Physics based simulation is a respectful technology in animations, and especially in games. When playing a video game, the vivid details and the realistic motions that render on the screen when you collide with another object further absorbed the player into the game, making the player feel he is racing a real-world racing car.

The motivation of the project was to see a physics based game which mainly deals with the hydrodynamics - the water surface. Water is extremely difficult to simulate in real-time when it aims for a decent physical accuracy. And as one gears more toward physical accuracy (which determines the quality of the game), the harder it gets(and exponentially) to achieve real-time. For many cases, water has been only a accessory visual effect, and not part of the major physics system in many 3D physics simulation based games. If the trend in the video game market was mainly focused on rigid bodies, we challenge to simulate the rigid objects interacting with a restlessly active wide domain of water surface. The project will mark an important step for the graphics community to achieve such 'revolution', and I believe that with ongoing efforts of computer graphists, the physics modeling techonology will take as far as where aircraft and deep water simulations can be rendered in real-time. It would be like shaping the real world inside the computer.

The open source project would be a framework that provides pre-compiled implementation of real-time fluid simulation techniqeus, including one of my current researches on physics modeling of the water surface, which I have studied on for the past 14 months. OGRE, which stands for Object-Oriented Graphics Rendering Engine, provides an excellent environment to work on for any graphics application. I find it especially useful for water simulations, where a number of different shaders are preset. The following paragraphs are some details directly excerpted from my research paper.

Posted: Wed Apr 02, 2008 9:22 am
by leafclone
Water is around us everywhere. From drinking cups to swimming pools, water is very plain to us yet it has strikingly unique physical properties, creating visually impressive effects in the real life. This research is driven by a motivation to catch such visual scenes caused by water, and to render the effects on the computer screen by mimicking how natural water would act.

Computer graphics is a widely demanded technology where consumers ask for higher efficiency and realism in animations, movies, and games. Algorithms are adapted for their uses. In computational cost blind areas where they ask for the most accurate detail as possible, they use a complex and accurate algorithm to spend hours of offline computation to create the most accurate simulation of graphics effect. On the other hand, areas such as video or online games require an instant simulation at an interactive level with the user, known as the real-time simulation. Our work is focused on the latter, where we seek to provide a convincing physical simulation of water with a fast implementation, there to be applied for practical uses with large domains.

Water, an amorphous matter by nature, takes many different forms from splattering raindrops to a great tsunami. However, instead of creating a model that covers every aspect of water phenomena, this research focuses on a creating a model specialized for a certain side of the water behavior: the water surface. Advection of floating objects, generation of water waves, and interaction with surface boundaries are part of water effects we aim to simulate on our virtual water surface model.

Algorithms for creating a large scale simulation that are handled by real-time often entail abbreviation of physical principles. Tendencies in previous literature show that water surface simulation techniques for large domains neglect significant fluid flow. This tendency can be explained that the fluid flow might be considered unimportant on a water surface of extensive size. Also, physically depicting the velocity field often brings heavy computational cost. However, Neglecting the horizontal velocity property of the water surface puts limitation in animating some wider range of surface behavior, such as objects traversing along a flowing water, or wave being generated from horizontal wind blow. We depart from the common trend that concentrates on the depiction of ‘waves’, which is physically defined as the transport of energy through space not associated with motion of the medium occupying this space as a whole. Instead, we design a surface when the fluid flow is of the main importance, and still embodying the wave effects and other surface phenomena as well. Of course, all of this is kept in real-time performance.

Our model is a computationally inexpensive physics model purposed for water surface that embodies global fluid flow. Here we set up a simple wish list of what is expected for the model.

Running Speed Efficiency: Water simulation of large scale domain should be run on a real time scale.

Advection: The model should embody the physical aspect of fluid flow. The fluid advection should not die out affecting only a limited region of the surface; instead, it should propagate over the entire water surface, and hence we call it global flow. We want to see not only miniscule swirls, but the actual transport of mass between two distant points.

Realism: The model should produce shapes similar to the real water waves. The velocity should also propagate in a realistic manner, which should be visible through floating objects and generation of water waves.

Again, our goal is to develop a physics engine library for hydrodynamics based on the OGRE, which will serve as a connection bridge between state-of-the-art water algorithms, and game developers who apply them in practical needs.

Posted: Wed Apr 02, 2008 9:26 am
by leafclone
I think I need to rearrange this whole writing into some kind of a format..

I'm looking around the forums and I realize that I was pretty lame in the way I was trying to present my topic.

Posted: Wed Apr 02, 2008 12:01 pm
by sinbad
This is a lovely subject and would be perfect for an open-source physics engine like ODE or Bullet, but it's somewhat out of scope for Ogre, which is a graphics engine.

Posted: Thu Apr 03, 2008 7:14 am
by leafclone
Do you really think so?

A physics-based animation, is indeed in same league with all the other graphcis animations.

Lots of OGRE open source projects handle with physics-based modeling and it wouldn't hurt to have a built-in physics engine.

In fact, the first inspiration I've ever gotten on water physics simulation was from the Demo Water application in OGRE samples you have when you first install it.

I understand what you mean by 'out of scope', but I certainly think the project would have contributions. Physics is just another way to make a graphics scene look real...

Posted: Thu Apr 03, 2008 8:26 am
by tuan kuranes
Physics engines are out of Ogre core (3D), but some Physic engine like Bullet does accept gsoc submissions.

You should try there, you'll indeed have more chances, as priority is given to applications near to the Ogre core.

Posted: Thu Apr 03, 2008 6:03 pm
by sinbad
Yeah, there's a difference between something that people who use Ogre might also use, and something that is core to Ogre. Many people who use Ogre also use sound engines, but that doesn't mean a sound filtering project would be appropriate for Ogre.

The water demo is really just a simple demo showing how you might use dynamic geometry - all of its water-sim functionality is out of the Ogre core. Personally, I'd love to see a great new water sim demo but it's definitely not a core graphics engine feature, and as such it wouldn't be a priority GSoC project.

Posted: Thu Apr 03, 2008 6:33 pm
by SpaceDude
Disclaimer: I didn't read the entire abstract :P

The physics part does seem out of the scope, but maybe there is something to be done on the rendering front. Your proposal seems to deal mainly with modeling the surface of a flat expanse of water so this may not be relevant, but it would be nice to be able to render fluids in a realistic manner from Physics simulations such as AGEIA's PhysX engine, see video:

http://www.youtube.com/watch?v=_bjGVcjMMJA

Here the water seems to be modeled as particles, but when you just render them as individual spheres it doesn't look very nice. You want something more like this:

http://www.youtube.com/watch?v=anoH3JQJGlA

I'm not sure how this was done but one method that springs to mind is implicit surfaces/iso-surfaces/whatever you want to call it:

http://local.wasp.uwa.edu.au/~pbourke/m ... licitsurf/

Posted: Thu Apr 03, 2008 11:06 pm
by leafclone
tuan kuranes//

Then where should I try out for if OGRE would be out of range for me?

I certainly don't find 'bullet' on the participating organization list of the GSoC...

Anyone knows organization that would happy to see a new physics engine?

Posted: Fri Apr 04, 2008 12:58 am
by Assaf Raman
Try Linden Lab (Second Life).

Posted: Fri Apr 04, 2008 4:14 am
by leafclone
Assaf Raman//

Thanks :)

Any other suggestions?

Posted: Fri Apr 04, 2008 1:07 pm
by tuan kuranes
you should really have a look at crystalspace3d...