< Previous | Contents | Next >

Summary

The ShadePixel function is written in GLSL and executed by the GPU for every drawn pixel. A FuPixel is passed as the argument, and changes made to this FuPixel are passed on to the next shader in the chain when it calls EvalShadePixel().

The FuPixel structure has four members, all of which are four-component vectors:

vec4 Color // source pixel color

vec4 TexCoord0 // image pixel coords [0..w-1, 0..h-1]

vec4 TexCoord1 // image normalised coords [0..1, 0..1]

vec4 TexCoord2 // dest screen coords [0..scrw, scrh..0] (0 is top)