AlphaTest (Material stage keyword)

Description

The alphaTest stage keyword makes parts of a diffuse map texture invisible depending on the alpha channel. If the alpha value of a pixel is less than the threshold given as the parameter to alphaTest, that pixel will not be drawn.

This is useful for rendering grids, gratings and so on, where parts of the texture must be transparent. It does not permit partial transparency of diffusemap textures.

Usage

alphaTest [cutoff]

Parameters

  • [cutoff] - the alpha value at which point the diffuse stage is drawn. Any values less than this are not drawn.

Example

None.

Notes

This is the only way for a diffuse stage to make use of alpha transparency.

The only other blend mode that allows for alpha transparency is blend and it does not recieve lighting.

Unfortunately alphatest is limited in that each pixel is either 100% opaque, or 100% transparent.

While alphaTest is a stage specific keyword, it has an effect on all stages. To counter that, use the keyword ignoreAlphaTest in stages where you do not want to apply the alphaTest.

Photoshop 7 does not save transparency information into an alpha channel when dealing with targa images. You must download the updated Targa export plugin from Adobe . All other versions of Photoshop work correctly.

Applying an alphatested material to a brush will make it so that the brush cannot be used to seal off the map from the void. This can be noticed when the pointfile line goes straight through a brush.