Not logged in, Join Here! or Log In Below:  
News Articles Search    

Submitted by Sylvain Lefebvre, posted on May 12, 2003

Image Description, by Sylvain Lefebvre

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

Image of the Day Gallery


Archive Notice: This content is archived, and commenting is no longer active. It is here for reference purposes. This content was added on an older version of flipcode, before the site closed in 2005.
Hosting by Solid Eight Studios, maker of PhotoTangler Collage Maker.