BLEND
Description
These enums are used by render.OverrideBlend to determine what the Source and Destination color and alpha channel values for a given pixel will be multiplied by before they are sent to the Blend Function to calculate the pixel's final color during draw operations.
For an interactive demonstration of how these enums behave, see Anders Riggelsen's Visual glBlendFunc Tool here
Values
BLEND_ZERO | 0 | The Multiplier will be r=0 , g=0 , b=0 , a=0
This is useful for removing the Source or Destination from the final pixel color. |
BLEND_ONE | 1 | The Multiplier will be r=1 , g=1 , b=1 , a=1
This is useful for keeping the Source or Destination as their starting values. |
BLEND_DST_COLOR | 2 | The Multiplier will be the same as the Destination color and alpha. |
BLEND_ONE_MINUS_DST_COLOR | 3 | Each color and alpha channel value of the Destination is subtracted from 1 .
Example: |
BLEND_SRC_ALPHA | 4 | All color and alpha channels will be the same as the Source alpha value.
Example: |
BLEND_ONE_MINUS_SRC_ALPHA | 5 | All color and alpha channels will be set to the Source alpha value subtracted from 1 .
Example: |
BLEND_DST_ALPHA | 6 | All color and alpha channels will be set to the the Destination alpha value.
Example: |
BLEND_ONE_MINUS_DST_ALPHA | 7 | All color and alpha channels will be set to the Destination alpha value subtracted from 1 .
Example: |
BLEND_SRC_ALPHA_SATURATE | 8 | First, the Source alpha is compared against the Destination alpha value subtracted from 1 and the smaller of the two is kept.
Then, the Source color channels are multiplied by the value from the first step. The Source alpha channel is multiplied by Example: The Destination alpha value subtracted from The color channels of the Source are multiplied by the smaller value: The final Multiplier value will be |
BLEND_SRC_COLOR | 9 | The Multiplier will be the same as the Source color and alpha. |
BLEND_ONE_MINUS_SRC_COLOR | 10 | Each color and alpha channel value of the Source is subtracted from 1 .
Example: |