Xors3d Engine
Blending modes

Defines

#define BLEND_ADD   3
#define BLEND_ALPHA   1
#define BLEND_MULTIPLY   2
#define BLEND_PUREADD   4

Define Documentation

#define BLEND_ALPHA   1

Entity will be blended in respect to its aplha value. It uses this formula: RGBr = (As * RGBs) + ((1.0 - As) * RGBd), where 'RGBr' - result color, 'RGBs' - source pixel color (from rendered entity), 'RGBd' - destination pixel color (from rendering buffer), 'As' - source alpha value (set by xEntityAlpha() command). This mode is default for entities.

#define BLEND_MULTIPLY   2

Entity will be multiplied with rendering buffer. It uses this formula: RGBr = RGBs * RGBd, where 'RGBr' - result color, 'RGBs' - source pixel color (from rendered entity), 'RGBd' - destination pixel color (from rendering buffer).

#define BLEND_ADD   3

Entity color multiplied by alpha value will be added to rendering buffer. It uses this formula: RGBr = (RGBs * As) + RGBd, where 'RGBr' - result color, 'RGBs' - source pixel color (from rendered entity), 'RGBd' - destination pixel color (from rendering buffer), 'As' - source alpha value (set by xEntityAlpha() command).

#define BLEND_PUREADD   4

This blending mode is intended for use with particle systems only. It uses this formula: RGBr = RGBs + RGBd, where 'RGBr' - result color, 'RGBs' - source pixel color (from rendered entity), 'RGBd' - destination pixel color (from rendering buffer). The advantage of this mode consists in that the sorting of polygons is not required. This mode is default for particle systems.