Next: Rendering Engine, Previous: Viewports, 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. The
(chickadee graphics blend)
module provides a data type for
blending modes.
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
The (chickadee graphics polygon)
module provides access to the
g:polygon-mode
and g:cull-face-mode
render states.
Completely fill in the polygon. This is the default mode.
Render only the edges of the polygon. Produces a wireframe.
Render only the vertex positions as points.
Return a new polygon mode that uses the method front for the
front face and back for the back face. The valid modes are
fill
, line
, and point.
Return #t
if obj is a polygon mode.
Return the current polygon mode.
Render state for polygon modes (see Rendering Engine.)
Don’t cull any faces.
Cull only back faces.
Cull only front faces.
Cull both front and back faces.
Return #t
if obj is a cull face mode.
Return #t
if cull-face-mode culls front faces.
Return #t
if cull-face-mode culls back faces.
Return the current cull face mode.
Render state for cull face modes (see Rendering Engine.)
The (chickadee graphics depth)
module provides access to the
g:depth-test
render state.
Return a new depth test object. If write is #t
, the
depth buffer will be written to during a draw call. near and
far define the min/max Z values for which depth testing may
pass.
function specifies how the depth value of pixel being drawn compares to the depth value that is already in the depth buffer. When this comparison is true, the depth test passes and the pixel is drawn. When it fails, the pixel is discarded.
The possible values of function are:
always
never
equal
not-equal
less-than
less-than-or-equal
greater-than
greater-than-or-equal
Return #t
when obj is a depth test object.
Return #t
when depth-test will write to the depth buffer.
Return the comparison function of depth-test.
Return the near Z value of depth-test.
Return the far Z value of depth-test.
Return the current depth test.
Render state for depth tests (see Rendering Engine.)
The (chickadee graphics stencil)
module provides access to the
g:stencil-test
render state.
A stencil test that always passes.
Return a new stencil test object. Different configurations can be used for the front and back faces by using the arguments that end in “front” or “back”.
Valid values for on-pass, on-fail, and on-depth-fail are:
zero
keep
replace
increment
increment-wrap
decrement
decrement-wrap
invert
Valid values for function are:
always
never
equal
not-equal
less-than
less-than-or-equal
greater-than
greater-than-or-equal
Return #t
when obj is a stencil test object.
Return the front mask of stencil-test.
Return the back mask of stencil-test.
Return the front function of stencil-test.
Return the back function of stencil-test.
Return the front function-mask of stencil-test.
Return the back function-mask of stencil-test.
Return the front reference value of stencil-test.
Return the back reference value of stencil-test.
Return the front failure action of stencil-test.
Return the back failure action of stencil-test.
Return the front depth test failure action of stencil-test.
Return the back depth test failure action of stencil-test.
Return the front pass action of stencil-test.
Return the back pass action of stencil-test.
Return the current stencil test.
Render state for stencil testing (see Rendering Engine.)
Multisample antialiasing is a feature supported by many, but not all,
graphics cards. It is a nice easy way to improve the final frame that
the user sees, particularly in 3D scenes. The (chickadee
graphics multisample)
module provides access to the
g:multisample?
render state.
Return #t
if multisampling is enabled.
Render state for multisampling (see Rendering Engine.)
Next: Rendering Engine, Previous: Viewports, Up: Graphics [Contents][Index]