summaryrefslogtreecommitdiff
path: root/manuals/chickadee/Rendering-Engine.html
diff options
context:
space:
mode:
Diffstat (limited to 'manuals/chickadee/Rendering-Engine.html')
-rw-r--r--manuals/chickadee/Rendering-Engine.html62
1 files changed, 40 insertions, 22 deletions
diff --git a/manuals/chickadee/Rendering-Engine.html b/manuals/chickadee/Rendering-Engine.html
index fa9f021..daef0ce 100644
--- a/manuals/chickadee/Rendering-Engine.html
+++ b/manuals/chickadee/Rendering-Engine.html
@@ -1,6 +1,6 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
-<!-- Copyright (C) 2017 David Thompson davet@gnu.org
+<!-- Copyright (C) 2017, 2018, 2019 David Thompson davet@gnu.org
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3
@@ -13,6 +13,8 @@ A copy of the license is also available from the Free Software
Foundation Web site at http://www.gnu.org/licenses/fdl.html.
+* Chickadee: (chickadee). Game programming toolkit for Guile.
+
The document was typeset with
http://www.texinfo.org/ (GNU Texinfo).
-->
@@ -30,8 +32,8 @@ http://www.texinfo.org/ (GNU Texinfo).
<link href="Index.html#Index" rel="index" title="Index">
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="Graphics.html#Graphics" rel="up" title="Graphics">
-<link href="Textures.html#Textures" rel="next" title="Textures">
-<link href="Graphics.html#Graphics" rel="prev" title="Graphics">
+<link href="Buffers.html#Buffers" rel="next" title="Buffers">
+<link href="Viewports.html#Viewports" rel="prev" title="Viewports">
<style type="text/css">
<!--
a.summary-letter {text-decoration: none}
@@ -90,18 +92,19 @@ ul.no-bullet {list-style: none}
<a name="Rendering-Engine"></a>
<div class="header">
<p>
-Next: <a href="Textures.html#Textures" accesskey="n" rel="next">Textures</a>, Up: <a href="Graphics.html#Graphics" accesskey="u" rel="up">Graphics</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Index.html#Index" title="Index" rel="index">Index</a>]</p>
+Next: <a href="Buffers.html#Buffers" accesskey="n" rel="next">Buffers</a>, Previous: <a href="Viewports.html#Viewports" accesskey="p" rel="prev">Viewports</a>, Up: <a href="Graphics.html#Graphics" accesskey="u" rel="up">Graphics</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Index.html#Index" title="Index" rel="index">Index</a>]</p>
</div>
<hr>
<a name="Rendering-Engine-1"></a>
-<h4 class="subsection">2.3.1 Rendering Engine</h4>
+<h4 class="subsection">2.3.10 Rendering Engine</h4>
<p>Chickadee defines rendering using a metaphor familiar to Scheme
programmers: procedure application. A shader (see <a href="Shaders.html#Shaders">Shaders</a>) is
like a procedure for the GPU to apply. Shaders are passed arguments:
-A vertex array containing the geometry to render (see <a href="Vertex-Arrays.html#Vertex-Arrays">Vertex Arrays</a>) and zero or more keyword arguments that the shader
-understands. Similar to how Scheme has <code>apply</code> for calling
-procedures, Chickadee provides <code>gpu-apply</code> for calling shaders.
+A vertex array containing the geometry to render (see <a href="Buffers.html#Buffers">Buffers</a>) and
+zero or more keyword arguments that the shader understands. Similar
+to how Scheme has <code>apply</code> for calling procedures, Chickadee
+provides <code>gpu-apply</code> for calling shaders.
</p>
<p>Additionally, there is some dynamic state that effects how
<code>gpu-apply</code> will behave. Things like the current viewport,
@@ -113,16 +116,31 @@ would be tedious to have to have to specify them each time
<code>(chickadee render)</code> module.
</p>
<dl>
-<dt><a name="index-gpu_002dapply"></a>Syntax: <strong>gpu-apply</strong> <em><var>shader</var> <var>vertex-array</var> [#:uniform-key <var>uniform-value</var> ...]</em></dt>
-<dt><a name="index-gpu_002dapply_002a"></a>Syntax: <strong>gpu-apply*</strong> <em><var>shader</var> <var>vertex-array</var> <var>count</var> [#:uniform-key <var>uniform-value</var> ...]</em></dt>
+<dt><a name="index-gpu_002dapply"></a>Syntax: <strong>gpu-apply</strong> <em>shader vertex-array [#:uniform-key uniform-value &hellip;]</em></dt>
+<dt><a name="index-gpu_002dapply_002a"></a>Syntax: <strong>gpu-apply*</strong> <em>shader vertex-array count [#:uniform-key uniform-value &hellip;]</em></dt>
<dd>
<p>Render <var>vertex-array</var> using <var>shader</var> with the uniform values
specified in the following keyword arguments.
</p>
<p>While <code>gpu-apply</code> will draw every vertex in <var>vertex-array</var>,
<code>gpu-apply*</code> will only draw <var>count</var> vertices.
+</p></dd></dl>
+
+<dl>
+<dt><a name="index-gpu_002dapply_002finstanced"></a>Syntax: <strong>gpu-apply/instanced</strong> <em>shader vertex-array n [#:uniform-key uniform-value &hellip;]</em></dt>
+<dt><a name="index-gpu_002dapply_002finstanced-1"></a>Syntax: <strong>gpu-apply/instanced</strong> <em>shader vertex-array count n [#:uniform-key uniform-value &hellip;]</em></dt>
+<dd>
+<p>Render <var>vertex-array</var> <var>n</var> times using <var>shader</var> with the
+uniform values specified in the following keyword arguments.
+</p>
+<p>Instanced rendering is very beneficial for rendering the same object
+many times with only small differences for each one. For example, the
+particle effects described in <a href="Particles.html#Particles">Particles</a> use instanced rendering.
</p>
-</dd></dl>
+<p>While <code>gpu-apply/instanced</code> will draw every vertex in
+<var>vertex-array</var>, <code>gpu-apply*</code> will only draw <var>count</var>
+vertices.
+</p></dd></dl>
<dl>
<dt><a name="index-current_002dviewport"></a>Procedure: <strong>current-viewport</strong></dt>
@@ -136,12 +154,12 @@ specified in the following keyword arguments.
<dl>
<dt><a name="index-current_002dblend_002dmode"></a>Procedure: <strong>current-blend-mode</strong></dt>
-<dd><p>Return the currently bound blend mode (see <a href="Blending-and-Depth-Testing.html#Blending-and-Depth-Testing">Blending and Depth Testing</a>).
+<dd><p>Return the currently bound blend mode (see <a href="Blending.html#Blending">Blending</a>).
</p></dd></dl>
<dl>
<dt><a name="index-current_002ddepth_002dtest"></a>Procedure: <strong>current-depth-test</strong></dt>
-<dd><p>Return <code>#t</code> if depth testing is currently enabled (see <a href="Blending-and-Depth-Testing.html#Blending-and-Depth-Testing">Blending and Depth Testing</a>).
+<dd><p>Return <code>#t</code> if depth testing is currently enabled (see <a href="Blending.html#Blending">Blending</a>).
</p></dd></dl>
<dl>
@@ -155,36 +173,36 @@ specified in the following keyword arguments.
</p></dd></dl>
<dl>
-<dt><a name="index-with_002dviewport"></a>Syntax: <strong>with-viewport</strong> <em><var>viewport</var> <var>body</var> ...</em></dt>
+<dt><a name="index-with_002dviewport"></a>Syntax: <strong>with-viewport</strong> <em>viewport body &hellip;</em></dt>
<dd><p>Evaluate <var>body</var> with the current viewport bound to <var>viewport</var> (see <a href="Viewports.html#Viewports">Viewports</a>).
</p></dd></dl>
<dl>
-<dt><a name="index-with_002dframebuffer"></a>Syntax: <strong>with-framebuffer</strong> <em><var>framebuffer</var> <var>body</var> ...</em></dt>
+<dt><a name="index-with_002dframebuffer"></a>Syntax: <strong>with-framebuffer</strong> <em>framebuffer body &hellip;</em></dt>
<dd><p>Evaluate <var>body</var> with the current framebuffer bound to
<var>framebuffer</var> (see <a href="Framebuffers.html#Framebuffers">Framebuffers</a>).
</p></dd></dl>
<dl>
-<dt><a name="index-with_002dblend_002dmode"></a>Syntax: <strong>with-blend-mode</strong> <em><var>blend-mode</var> <var>body</var> ...</em></dt>
+<dt><a name="index-with_002dblend_002dmode"></a>Syntax: <strong>with-blend-mode</strong> <em>blend-mode body &hellip;</em></dt>
<dd><p>Evaluate <var>body</var> with the current blend mode bound to
-<var>blend-mode</var> (see <a href="Blending-and-Depth-Testing.html#Blending-and-Depth-Testing">Blending and Depth Testing</a>).
+<var>blend-mode</var> (see <a href="Blending.html#Blending">Blending</a>).
</p></dd></dl>
<dl>
-<dt><a name="index-with_002ddepth_002dtest"></a>Syntax: <strong>with-depth-test</strong> <em><var>depth-test?</var> <var>body</var> ...</em></dt>
+<dt><a name="index-with_002ddepth_002dtest"></a>Syntax: <strong>with-depth-test</strong> <em>depth-test? body &hellip;</em></dt>
<dd><p>Evaluate <var>body</var> with the depth-test disabled if <var>depth-test?</var>
-is <code>#f</code>, or enabled otherwise (see <a href="Blending-and-Depth-Testing.html#Blending-and-Depth-Testing">Blending and Depth Testing</a>).
+is <code>#f</code>, or enabled otherwise (see <a href="Blending.html#Blending">Blending</a>).
</p></dd></dl>
<dl>
-<dt><a name="index-with_002dtexture"></a>Syntax: <strong>with-texture</strong> <em><var>texture</var> <var>body</var> ...</em></dt>
+<dt><a name="index-with_002dtexture"></a>Syntax: <strong>with-texture</strong> <em>texture body &hellip;</em></dt>
<dd><p>Evaluate <var>body</var> with the current texture bound to <var>texture</var>
(see <a href="Textures.html#Textures">Textures</a>).
</p></dd></dl>
<dl>
-<dt><a name="index-with_002dprojection"></a>Syntax: <strong>with-projection</strong> <em><var>projection</var> <var>body</var> ...</em></dt>
+<dt><a name="index-with_002dprojection"></a>Syntax: <strong>with-projection</strong> <em>projection body &hellip;</em></dt>
<dd><p>Evaluate <var>body</var> with the current projection matrix bound to
<var>projection</var> (see <a href="Matrices.html#Matrices">Matrices</a>).
</p></dd></dl>
@@ -192,7 +210,7 @@ is <code>#f</code>, or enabled otherwise (see <a href="Blending-and-Depth-Testin
<hr>
<div class="header">
<p>
-Next: <a href="Textures.html#Textures" accesskey="n" rel="next">Textures</a>, Up: <a href="Graphics.html#Graphics" accesskey="u" rel="up">Graphics</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Index.html#Index" title="Index" rel="index">Index</a>]</p>
+Next: <a href="Buffers.html#Buffers" accesskey="n" rel="next">Buffers</a>, Previous: <a href="Viewports.html#Viewports" accesskey="p" rel="prev">Viewports</a>, Up: <a href="Graphics.html#Graphics" accesskey="u" rel="up">Graphics</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Index.html#Index" title="Index" rel="index">Index</a>]</p>
</div>