Transparency |
In an
active object the
transparency element controls the way in which the object surface color is combined with the background color. When drawing an object the resulting color components (including alpha) of each point to be drawn are calculated according the following formula:
resulting_component = source_component*source_coefficient + destination_component*destination_coefficient. The transparency is represented by a 2 digit numeric code. The digit on the units' position determines the operation code for the source color, the digit on the tens' position determines the operation code for the destination color. The most frequently used combinations are:
1 Ordinary (default) mode: The object overlaps the background completely.
11 Mode for fire and projectiles: The object color is added to the background color.
20 Mode for glass: The object color is multiplied by the background color (modulation).
54 Mode for transparent overlap: The transparency can continuously be controlled by the object's alpha component.
Operation codes (resulting_code = source_code + destination_code*10):
0 coefficient = 0 (component will not assert itself)
1 coefficient = 1 (component will assert itself fully)
2 coefficient = source_component (component modulated by source color)
3 coefficient = (1-source_component) (component modulated by source color complement)
4 coefficient = source_alpha (component modulated by source alpha)
5 coefficient = (1-source_alpha) (component modulated by source alpha complement)
6 coefficient = destination_component (component modulated by destination color)
7 coefficient = (1-destination_component) (component modulated by destination color complement)
8 coefficient = destination_alpha (component modulated by destination alpha)
9 coefficient = (1-destination_alpha) (component modulated by destination alpha complement)
When setting the
transparency element a default object
render group will be set : opaque objects (resulting color does not depend on the destination color) have default group equal
4, transparent objects have group
10,
2D pictures have group
14.
Notes: The target alpha component (8 and 9) need not always be supported. (This depends on the actual videomode and the videocard type). With OpenGL interface and the older DirectX versions, the source component coefficient (2 and 3) for the source component operation, and the destination component coefficient (6 and 7) for the destination component operation are not supported.
Full Html Context Help of The Peter - Gemtree Software & Children Programming