Next: Framebuffers, Previous: 3D Models, Up: Graphics [Contents][Index]
Rendering a scene often involves drawing layers of objects that overlap each other. Blending determines how two overlapping pixels are combined in the final image that is rendered to the screen.
Chickadee provides the following blend modes:
Blend pixels according to the values of their alpha channels. This is the most commonly used blend mode.
Overwrite the output pixel color with the color being drawn.
Add all pixel color values together. The more colors blended together, the more white the final color becomes.
Subtract all pixel color values. The more colors blended together, the more black the final color becomes.
Custom blend modes can be created using the make-blend-mode
procedure:
Return a new custom blend mode that applies source-function to the source color, destination-function to the destination color, and finally applies equation to the transformed source/destination color values. These arguments are not procedures, but symbolic representations of the functions that OpenGL supports.
Valid values for equation are:
add
subtract
reverse-subtract
min
max
alpha-min
alpha-max
Valid values for source-function are:
zero
one
destination-color
one-minus-destination-color
source-alpha-saturate
source-alpha
one-minus-source-alpha
destination-alpha
one-minus-destination-alpha
constant-color
one-minus-constant-color
constant-alpha
one-minus-constant-alpha
Valid values for destination-function are:
zero
one
source-color
one-minus-source-color
source-alpha
one-minus-source-alpha
destination-alpha
one-minus-destination-alpha
constant-color
one-minus-constant-color
constant-alpha
one-minus-constant-alpha
Next: Framebuffers, Previous: 3D Models, Up: Graphics [Contents][Index]