Real-Time Fluid Dynamics for Games

Smoke | Friday 26 September 2008 9:35 pm

A method to create very realistic and convincing dynamic fluids in games. For example smoke and explosions.  

The abstract:

“In this paper we present a simple and rapid implementation of a fluid dynamics solver for game engines. Our tools can greatly enhance games by providing realistic fluid-like effects such as swirling smoke past a moving character. The potential applications are endless. Our algorithms are based on the physical equations of fluid flow, namely the Navier-Stokes equations. These equations are notoriously hard to solve when strict physical accuracy is of prime importance. Our solvers on the other hand are geared towards visual quality. Our emphasis is on stability  and speed, which means that our simulations can be advanced with arbitrary time steps. We also demonstrate that our solvers are easy to code by providing a complete C code implementation in this paper. Our algorithms run in real-time for reasonable grid sizes in both two and three dimensions on standard PC hardware, as demonstrated during the presentation of this paper at the conference.”

Real-Time Fluid Dynamics

Link to the paper:
http://www.dgp.toronto.edu/people/stam/reality/Research/pdf/GDC03.pdf

Bilateral upsampling

Optimizations | Friday 26 September 2008 7:36 pm

Bilateral upsampling can be used as a cheat method to increase the size of a texture you got without bluriness over the edges. Normally you do bilinear sampling to get a smooth result when upsizing a texture but this approch also considers the normals and heights. The result is an image with smooth result but crisp edges.

It works like a normal bilinear sampling but not only uses the distance between the sample pixels as weights but also calculate a weight factor based on difference in height and normals.

It can be implemented like the following in a GLSL shader function:

TODO

Here’s a paper about soft global illumination that uses bilateral upsampling to save some processing. It also includes a formel for the bilateral upsampling.
http://www.ppsloan.org/publications/ProxyPG.pdf

And here’s a more in detail description about bilateral upsampling:
http://www.cs.duke.edu/~tomasi/papers/tomasi/tomasiIccv98.pdf

Multisampling (Supersampling)

Filtering | Friday 26 September 2008 7:35 pm

Because every pixel is normally only sampled once they cannot get the correct output if the whole pixel isn’t covered by one triangle. This is beacuse the sample can only get it’s colour (and other properties) from one triangle. In the contour of a model this is very apparent and if no multisampling is enabled then the edges will be jagged and appear very annoing. This effect is called aliasing and to deal with it we would need unlimited with samples in the pixel and blend them together, but it’s not possible with the current hardware. Instead we have to accept only taking two, four or more samples and hope it’s enough. There are a lot of different methods to do multisampling and the table below show some of the most used ones and the result from using them on a filled triangle and a outlined triangle.

Supersampling Schemes

Image from the book Real-Time Rendering, used with permission.

Shading

Basic Materials | Friday 26 September 2008 7:24 pm

Shading is the result from applying a lightning technique on a rendered object. There are three common types of shading.

Flat (left image): The lightning is calculated per face

Gouraud (middle image): The lightning is calculated per vertex and for each pixel the result is interpolated from the vertices of the face that the pixel belongs to.

Phong (right image): The lightning is calculated per pixel.

Shading
« Previous PageNext Page »