Next: , Previous: , Up: Graphics   [Contents][Index]


2.3.10 Blending

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:

Variable: blend:alpha

Blend pixels according to the values of their alpha channels. This is the most commonly used blend mode.

Variable: blend:replace

Overwrite the output pixel color with the color being drawn.

Variable: blend:add

Add all pixel color values together. The more colors blended together, the more white the final color becomes.

Variable: blend:subtract

Subtract all pixel color values. The more colors blended together, the more black the final color becomes.

Variable: blend:multiply
Variable: blend:darken
Variable: blend:lighten
Variable: blend:screen

Custom blend modes can be created using the make-blend-mode procedure:

Procedure: make-blend-mode equation source-function destination-function

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:

Valid values for source-function are:

Valid values for destination-function are:


Next: , Previous: , Up: Graphics   [Contents][Index]