Return to main page

Heat effect

Distortion effect is now widely used in rendering engine to simulate heat, glasses or explosion deflagration.

In this demo, I render first the scene, without distortion polygons, in a texture. Second, I render this texture in the buffer to be displayed. Then, I render distortion polygons : by projecting the rendered scene texture on it and, using a displacement map (for example a normalmap or at least a two-channel texture), I apply an offset to texture coordinate to read the scene texture to get distortion.

This effect is implemented with fragment program and GeForce4 texture shader. Transition between normal image and distorded image are better when using a fragment program (no ghost effect). On GeForce4, Transition are done by blending, and with fragment program by scaling the offset vector.

Download source and executable

Normal rendering
Viewing the same scene through a glass

 

Distortion transition on GeForce4 :
distorded image is blended and image ghost appears
Smooth distortion transition with fragment program

 

Different glasses color

Return to main page