< Previous | Contents | Next >

Methods


ShadePixel

Called to process each pixel.

EvalShadePixel

This is called to fetch the color values and location of the current pixel.

Example

This is an example of a simple gamma shader program:


shader = [[

void ShadePixel(inout FuPixel f)

{

// get source pixel EvalShadePixel(f);


// apply Gamma

vec4 gamma = vec4(Gamma, Gamma, Gamma, Alphagamma);


f.Color = sign(f.Color) * pow(abs(f.Color), gamma);

}

]]