The aim of this tutorial is to show how to implement the main techniques of texture mapping
in GLSL (OpenGL Shading Language). Simple texturing, multitexturing, environment mapping (sphere, dual paraboloid and
cube), texture warping, projective texture mapping as well as some examples of special textures (alpha and gloss maps) will be studied.
We will focus on texturing in the pixel shader (Pixel Texture Fetching - PTF). Texturing using vertex shader
(or Vertex Texture Fetching - VTF) has been discussed in a previous tutorial: Vertex Displacement Mapping.
We will use the Demoniak3D Demo-System
in order to quickly code the demos and GLSL shaders.
The texturing being a quite complex domain with infinite possibilities particularly with the use
of realtime shaders, this tutorial wants before all to be an introduction to the basic techniques which,
once mastered, will allow to approach all others with serenity.
Before diving into code, I would like to thank Delilah
to have let me use (and warped in passing) some of her productions (in the simple and multitexturing, sphere env
mapping, texture warping and texture rectangle parts). Grazie tante Delilah, ed in bocca al lupo
per i tuoi esami, ce la farai, sei bravissima!