×
Menu

Transparency Modes (EN)

 

 Выдержка из оригинальной справки. (NDL Gamebryo 1.1)
 
Conceptually, both the pixel value that is about to be written into the back buffer (the source pixel) and the pixel value currently in the back buffer (the destination pixel) are both modified by some function, the two results are summed together, and that final result is written to the back buffer. For normal alpha blending the source pixel has its r,g,b components multiplied by its alpha value. Simultaneously the destination pixel has its r,g,b values multiplied by one minus the source pixel's alpha value. These two values are then summed together to yield the usual alpha blended result, which then overwrites the old destination pixel.
In terms of the "Transparency" panel, this process is specified by setting the "Src" to SRCALPHA and the "Dest" to INVSRCALPHA. "Src" and "Dest" specify the modification made to the source and destination pixels before they are summed together and can each be one of: ONE, ZERO, SRCCOLOR, INVSRCCOLOR, DESTCOLOR, INVDESTCOLOR, SRCALPHA, INVSRCALPHA, DESTALPHA, INVDESTALPHA, or SRCALPHASAT.
The ONE modifier replaces the specified pixel in the blending equation with white while the ZERO modifier replaces the pixel with black. The SRCCOLOR modifier replaces the specified pixel with the color of the source pixel, while INVSRCCOLOR replaces the pixel with the source color subtracted per component from white. DESTCOLOR and INVDESTCOLOR are the same as SRCCOLOR and INVSRCCOLOR except that the destination pixel's color is used. SRCALPHA multiplies each of the specified pixel's components by the source pixel's alpha value while INVSRCALPHA uses one minus the source pixel's alpha value. DESTALPHA and INVDESTALPHA are similar except they use the destination pixel's alpha value. Finally, SRCALPHASAT takes the lesser of the source pixel's alpha or one minus the destination pixel's alpha and places it in the red, green, and blue fields of the specified pixel. This mode sets the specified pixel's alpha to be 1.