blend-mode


Vocabulary
gpu.state

Class description
A blend-mode is specified as part of the blend-state to determine the blending equation used between the source (incoming fragment) and destination (existing framebuffer value) colors of blended pixels.
The equation slot determines how the source and destination colors are combined after the source-function and dest-function have been applied.
eq-add indicates that the source and destination results are added.
eq-subtract indicates that the destination result is subtracted from the source.
eq-reverse-subtract indicates that the source result is subtracted from the destination.
eq-min indicates that the componentwise minimum of the source and destination results is taken.
eq-max indicates that the componentwise maximum of the source and destination results is taken.
The source-function and dest-function slots each specify a function to apply to the source, destination, or constant color values to generate a blending factor that is multiplied respectively against the source or destination value before feeding the results to the equation.
func-zero returns a constant factor of zero.
func-one returns a constant factor of one.
func-source returns the corresponding source color component for every result component.
func-one-minus-source returns one minus the corresponding source color component for every result component.
func-dest returns the corresponding destination color component for every result component.
func-one-minus-dest returns one minus the corresponding destination color component for every result component.
func-constant returns the corresponding component of the current blend-state's constant-color for every result component.
func-one-minus-constant returns one minus the corresponding component of the current blend-state's constant-color for every result component.
func-source-alpha returns the source alpha component for every result component.
func-one-minus-source-alpha returns one minus the source alpha component for every result component.
func-dest-alpha returns the destination alpha component for every result component.
func-one-minus-dest-alpha returns one minus the destination alpha component for every result component.
func-constant-alpha returns the alpha component of the current blend-state's constant-color for every result component.
func-one-minus-constant-alpha returns one minus the alpha component of the current blend-state's constant-color for every result component.
A typical transparency effect will use the values:
T{ blend-mode { equation eq-add } { source-function func-source-alpha } { dest-function func-one-minus-source-alpha } }


See also
<blend-mode>

Definition