Category Archives: Special Effects


Fluid Simulation and Rendering

For effects like smoke or water, a fluid simulation and rendering approach is needed. There are currently two popular methods for this:

  1. Simulate the fluid on the CPU and send the result as particles to the GPU for rendering as billboards. This is often called a particle system. The technique has been around since the dawn of computer graphics.

  2. Simulate the fluid on the GPU and render the result into textures. This will then be rendered by doing volume ray casting (or ray marching) on the GPU. This technique is new and rather unexplored, and there are few real-life implementations. The result can be very realistic but slow.

Technique one burdens both CPU, bandwidth and GPU. Although in modern solutions, it’s the bandwidth that’s the bottleneck. The GPU based technique only burdens the GPU ( but a lot ).

The movie shows the GPU method of fluid simulation and rendering. More info about this particular implementation in the two last links.

Building an Advanced Particle System
Building a Million Particle System
Real-Time Simulation and Rendering of 3D Fluids
The previous page’s authors homepage:

Mega Particles

Mega Particles

Instead of rendering textured billboards, this technique called “Mega Particles” render spheres to an off-screen texture. This texture is then blurred and randomly displaced using a fractal cube. The final result is carefully blended into the scene, taking depth into account. The result is a volumetric cloud that is lit by lighting and truly look volumetric. The problem is that this technique suffers from the shower-door effect which can make it really annoying to use in practice. It’s also harder for artist to control the final look. Also, going inside the cloud requires special treatment not even mentioned in the slides. But nevertheless, it’s an interesting approach that certainly can be developed furthered. At least one optimization could be to not render actual spheres, but instead billboards holding the sphere info.

Red Screen Filter

This is one way to apply a filter to make the whole screen red. After rendering the scene to a texture like usual. Render a full screen quad with the following shader attached, to get the whole screen in red. This is a nice and quick effect.

 The original output to the left, the result of the filter to the right

By averaging the different components with the weights 0.3, 0.59, 0.11 you will get a better result than just taking equally much from each. Read more on this page about it

The fragment shader:

uniform sampler2D screenRT;
varying vec2 uv;
void main( void )
    // make the screen red, (but works fine for other channels too, of course)
    gl_FragColor.r = dot(texture2D( screenRT, uv ).xyz,vec3(0.3, 0.59, 0.11));