Chickadee defines rendering using a metaphor familiar to Scheme
programmers: procedure application. A shader (see Shaders) is
like a procedure for the GPU to apply. Shaders are passed arguments:
A vertex array containing the geometry to render (see Vertex Arrays) and zero or more keyword arguments that the shader
understands. Similar to how Scheme has apply
for calling
procedures, Chickadee provides gpu-apply
for calling shaders.
Additionally, there is some dynamic state that effects how
gpu-apply
will behave. Things like the current viewport,
framebuffer, and blend mode are stored as dynamic state because it
would be tedious to have to have to specify them each time
gpu-apply
is called.
The following procedures and syntax can be found in the
(chickadee render)
module.
Render vertex-array using shader with the uniform values specified in the following keyword arguments.
While gpu-apply
will draw every vertex in vertex-array,
gpu-apply*
will only draw count vertices.
Return the currently bound viewport. See Viewports for more details about using viewports.
Return the currently bound framebuffer. See Framebuffers for more details about using framebuffers.
Return the currently bound blend mode. See Blending and Depth Testing for more details about using blend modes.
Return #t
if depth testing is currently enabled.
See Blending and Depth Testing for more details about using the
depth test.
Return the currently bound texture. See Textures for more details about using textures.
Return the currently bound projection matrix. See Matrices for more details about matrices.
Evaluate body with the current viewport bound to viewport.
Evaluate body with the current framebuffer bound to framebuffer.
Evaluate body with the current blend mode bound to blend-mode.
Evaluate body with the depth-test disabled if depth-test?
is #f
, or enabled otherwise.
Evaluate body with the current texture bound to texture.
Evaluate body with the current projection matrix bound to projection.