| Submitted by , posted on 12 May 2003 |

Image Description, by These are four screenshots of my Drops of Water shader. It is an animated effect showing drops falling allong a surface. The shader relies on a fragment program and therefore no geometry is required for the rendering of the drops: all is done in texture space. The two pictures on the left are only one geometric quad textured with the shader. The drop shape is encoded in a texture. The shader instanciates the drops in texture space where asked by the application. A transformation (scaling and rotation) can be applied on each drop. All happen like if drops were sprites drawn in the texture.
The rendering of drops is done using a faked refraction effect. The rendering of the underlying surface is done with the Phong model. The specular and diffuse coefficient are modulated by a texture to achieve a wet effect. This texture represents the wet areas. It is obtained by rendering the drops as white spots at each time step. The new state is blended with the old texture to accumulate wet areas.
The Drops of Water shader will be explained in detail in the upcoming ShaderX2 book.
Videos are available at http://www.aracknea.net/shaderx2/

[prev] | Image of the Day Gallery www.flipcode.com | [next]

Copyright 1999-2008 (C) FLIPCODE.COM and/or the original content author(s). All rights reserved.
Please read our Terms, Conditions, and Privacy information.