HGE Blending modes

To specify a HGE blending mode, unite one of the constants from each pair using C-language bitwise or operator (|):

#define	BLEND_COLORADD    1
#define	BLEND_COLORMUL    0

#define	BLEND_ALPHABLEND  2
#define	BLEND_ALPHAADD    0

#define	BLEND_ZWRITE      4
#define	BLEND_NOZWRITE    0
BLEND_COLORADD
The vertex color is added to a texture's texel colors, resulting in texture lightening. The vertex color 0x00000000 makes no effect.
BLEND_COLORMUL
Texture's texel colors are multiplied by the vertex color, resulting in texture darkening. The vertex color 0xFFFFFFFF makes no effect.
BLEND_ALPHABLEND
The object's pixel colors are alpha-blended with the pixels already on the screen when rendering. Use this for usual objects rendering.
BLEND_ALPHAADD
The object's pixel colors are added to the pixels already on the screen when rendering. Use this to create lighting effects.
BLEND_ZWRITE
Write the pixels' Z-order to the Z-buffer when rendering. When using Z-buffer, use this for opaque objects.
BLEND_NOZWRITE
Don't write the pixels' Z-order to the Z-buffer when rendering. When using Z-buffer, first, render all opaque objects, then use this to render all semi-transparent objects.

Default blending constants combinations:

#define BLEND_DEFAULT
	(BLEND_COLORMUL | BLEND_ALPHABLEND | BLEND_NOZWRITE)
#define BLEND_DEFAULT_Z
	(BLEND_COLORMUL | BLEND_ALPHABLEND | BLEND_ZWRITE)

Requirements

Header: hge.h

See also

Triple structure, Quad structure