|
Mac OS 9
|
#include <RAVE.h>
Data Fields | |
| float | x |
| float | y |
| float | z |
| float | invW |
| float | r |
| float | g |
| float | b |
| float | a |
TQAVGouraud is used for Gouraud shading. Each vertex specifies position, color and Z.
Alpha is always treated as indicating transparency. Drawing engines which don't support Z-sorted rendering use the back-to-front transparency blending functions shown below. (ARGBsrc are the source (new) values, ARGBdest are the destination (previous) pixel values.)
Premultiplied Interpolated A = 1 - (1 - Asrc) * (1 - Adest) A = 1 - (1 - Asrc) * (1 - Adest) R = (1 - Asrc) * Rdest + Rsrc R = (1 - Asrc) * Rdest + Asrc *
Rsrc G = (1 - Asrc) * Gdest + Gsrc G = (1 - Asrc) * Gdest + Asrc * Gsrc B = (1 - Asrc) * Bdest + Bsrc B = (1 - Asrc) * Bdest + Asrc * Bsrc
Note that the use of other blending modes to implement antialiasing is performed automatically by the drawing engine when the kQATag_Antialias variable != kQAAntiAlias_Fast. The driving software should continue to use the alpha fields for transparency even when antialiasing is being used (the drawing engine will resolve the multiple blending requirements as best as it can).
Drawing engines which perform front-to-back Z-sorted rendering should replace the blending function shown above with the equivalent front-to-back formula.