View Full Version : Water refraction and heat shimmer

06-18-2006, 12:49 PM
Hi there,

i'm looking for some material about water light refraction and heat shimmer (done in fragment shaders). Has anybody some ideas for these effects, or better than that some examples, or sample code ???



06-19-2006, 01:28 AM
There's a heat haze effect on in 3dlabs' GLSL demo and also a glass refraction shader.

06-19-2006, 10:30 AM
The underlying method is to distort a rendered image after you've drawn it but the detailed requirements are quite different.

Render to texture then use that texture on a screenspace mesh for the heat haze, you can have a mesh of verts to distort or a pixel level displacement. Typically you need to sort the heat haze in screenspace w.r.t. the scene and draw it at the right time if it has the potential to be occluded.

For water you need to use the view vector and surface normal to compute the refraction vector and that leads to a texture coordinate displacement in the refracted texture. To make this look good though you need refraction + reflection textures mixed using Fresnel's equations.