summaryrefslogtreecommitdiff
path: root/manuals/chickadee/Textures.html
diff options
context:
space:
mode:
Diffstat (limited to 'manuals/chickadee/Textures.html')
-rw-r--r--manuals/chickadee/Textures.html83
1 files changed, 78 insertions, 5 deletions
diff --git a/manuals/chickadee/Textures.html b/manuals/chickadee/Textures.html
index 48a580e..80a30db 100644
--- a/manuals/chickadee/Textures.html
+++ b/manuals/chickadee/Textures.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-2020 David Thompson davet@gnu.org
+<!-- Copyright (C) 2017-2021 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
@@ -85,9 +85,11 @@ ul.no-bullet {list-style: none}
Next: <a href="Sprites.html" accesskey="n" rel="next">Sprites</a>, Previous: <a href="Colors.html" accesskey="p" rel="prev">Colors</a>, Up: <a href="Graphics.html" 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" title="Index" rel="index">Index</a>]</p>
</div>
<hr>
-<span id="Textures-1"></span><h4 class="subsection">2.3.2 Textures</h4>
+<span id="Textures-1"></span><h4 class="subsection">5.3.2 Textures</h4>
-<p>Textures are essentially images: a 2D grid of color values. The
+<p>Textures are essentially images: a 2D grid of color values. However,
+this is a great simplification. Textures can be used to store any
+kind of data that can be encoded into color channels. The
<code>(chickadee graphics texture)</code> module provides an interface for
working with texture objects.
</p>
@@ -102,8 +104,8 @@ respectively. Possible values are <code>nearest</code> and <code>linear</code>.
</p>
<p><var>wrap-s</var> and <var>wrap-t</var> describe how to interpret texture
coordinates that are greater than <code>1.0</code>. Possible values are
-<code>repeat</code>, <code>clamp</code>, <code>clamp-to-border</code>, and
-<code>clamp-to-edge</code>.
+<code>repeat</code>, <code>mirrored-repeat</code>, <code>clamp</code>,
+<code>clamp-to-border</code>, and <code>clamp-to-edge</code>.
</p>
<p>For color-keyed images (images where a specific color should be made
transparent), specify the appropriate <var>transparent-color</var>.
@@ -169,6 +171,58 @@ axis for <var>texture</var>.
<dd><p>Return the height of <var>texture</var> in pixels.
</p></dd></dl>
+<dl>
+<dt id="index-current_002dtexture_002d0">Procedure: <strong>current-texture-0</strong></dt>
+<dd><p>Return the current texture associated with texture unit 0 on the GPU.
+</p></dd></dl>
+
+<dl>
+<dt id="index-current_002dtexture_002d1">Procedure: <strong>current-texture-1</strong></dt>
+<dd><p>Return the current texture associated with texture unit 1 on the GPU.
+</p></dd></dl>
+
+<dl>
+<dt id="index-current_002dtexture_002d2">Procedure: <strong>current-texture-2</strong></dt>
+<dd><p>Return the current texture associated with texture unit 2 on the GPU.
+</p></dd></dl>
+
+<dl>
+<dt id="index-current_002dtexture_002d3">Procedure: <strong>current-texture-3</strong></dt>
+<dd><p>Return the current texture associated with texture unit 3 on the GPU.
+</p></dd></dl>
+
+<dl>
+<dt id="index-current_002dtexture_002d4">Procedure: <strong>current-texture-4</strong></dt>
+<dd><p>Return the current texture associated with texture unit 4 on the GPU.
+</p></dd></dl>
+
+<dl>
+<dt id="index-g_003atexture_002d0">Variable: <strong>g:texture-0</strong></dt>
+<dd><p>Render state for texture unit 0 (see <a href="Rendering-Engine.html">Rendering Engine</a>.)
+</p></dd></dl>
+
+<dl>
+<dt id="index-g_003atexture_002d1">Variable: <strong>g:texture-1</strong></dt>
+<dd><p>Render state for texture unit 1 (see <a href="Rendering-Engine.html">Rendering Engine</a>.)
+</p></dd></dl>
+
+<dl>
+<dt id="index-g_003atexture_002d2">Variable: <strong>g:texture-2</strong></dt>
+<dd><p>Render state for texture unit 2 (see <a href="Rendering-Engine.html">Rendering Engine</a>.)
+</p></dd></dl>
+
+<dl>
+<dt id="index-g_003atexture_002d3">Variable: <strong>g:texture-3</strong></dt>
+<dd><p>Render state for texture unit 3 (see <a href="Rendering-Engine.html">Rendering Engine</a>.)
+</p></dd></dl>
+
+<dl>
+<dt id="index-g_003atexture_002d4">Variable: <strong>g:texture-4</strong></dt>
+<dd><p>Render state for texture unit 4 (see <a href="Rendering-Engine.html">Rendering Engine</a>.)
+</p></dd></dl>
+
+<span id="Tile-Atlases"></span><h4 class="subsubsection">5.3.2.1 Tile Atlases</h4>
+
<p>It is common practice to combine multiple bitmap images into a single
texture, known as a &ldquo;tile atlas&rdquo; or &ldquo;tile set&rdquo;, because it is more
efficient to render many regions of a large texture than it is to
@@ -212,6 +266,25 @@ file <var>file-name</var> into a grid of <var>tile-width</var> by
<dd><p>Return the texture region in <var>atlas</var> at <var>index</var>.
</p></dd></dl>
+<span id="Cube-Maps"></span><h4 class="subsubsection">5.3.2.2 Cube Maps</h4>
+
+<p>A cube map is a special type of texture composed of 6 images that can
+be thought of as forming the 6 faces of a cube. See <a href="Skyboxes.html">Skyboxes</a> for a
+practical use of cube maps.
+</p>
+<dl>
+<dt id="index-load_002dcube_002dmap">Procedure: <strong>load-cube-map</strong> <em>#:right #:left #:top #:bottom #:front #:back [#:min-filter linear-mipmap-linear] [#:mag-filter linear]</em></dt>
+<dd>
+<p>Return a new cube map that uses the image data in the files
+<var>right</var>, <var>left</var>, <var>top</var>, <var>bottom</var>, <var>front</var>, and
+<var>back</var> for the 6 faces of the cube.
+</p></dd></dl>
+
+<dl>
+<dt id="index-cube_002dmap_003f">Procedure: <strong>cube-map?</strong> <em>obj</em></dt>
+<dd><p>Return <code>#t</code> if <var>obj</var> is a cube map.
+</p></dd></dl>
+
<hr>
<div class="header">
<p>