anachronox-sdk/docs/procedural/proc_interform.bak
2002-01-21 00:00:00 +00:00

163 lines
5.6 KiB
Text

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD>
<TITLE>Interform Procedural Textures</TITLE>
<LINK type="text/css" rel="stylesheet" href="../webdocs.css">
</HEAD>
<BODY>
<H1>Interform Procedural Textures</H1>
<P>The interform procedural texture generates a texture from
two color index maps and a palette. The effect varies, but is
usually used for bubbling or flowing effects. It is highly
recommended that you play with the interform procedure explorer
in Kai's Power Tools before trying to make interform textures
of your own.</P>
<PRE class="syntax">
<B>ATD1</B>
<B>type = interform</B>
<B>width =</B> <I>integer</I>
<B>height =</B> <I>integer</I>
<B>palette =</B> <I>filename</I>
<B>mother =</B> <I>filename</I>
<B>mother_move =</B> <I>string</I> (optional)
<B>mother_vx =</B> <I>float</I> (optional, for scrolling)
<B>mother_vy =</B> <I>float</I> (optional, for scrolling)
<B>mother_speed =</B> <I>float</I> (optional, for wander)
<B>mother_rate =</B> <I>float</I> (optional, for wander)
<B>mother_strength =</B> <I>float</I> (optional, for wander)
<B>father =</B> <I>filename</I>
<B>father_move =</B> <I>string</I> (optional)
... (other options same as for mother image)
</PRE>
<H4>Parameters</H4>
<DL>
<DT><I>width</I></DT>
<DD>Width of the texture, must be a power of two.</DD>
<DT><I>height</I></DT>
<DD>Height of the texture, must be a power of two.</DD>
<DT><I>palette</I></DT>
<DD>Filename of the image from which the color palette is
derived. The image must be a 24-bit PNG file that is exactly
256 pixels wide and at least one pixel high. This allows for
easy creation of palettes using the gradient tool in
Photoshop. The top line of the image becomes the interform
palette.</DD>
<DT><I>mother</I></DT>
<DD>Filename of the first source color map, which must be an
8-bit PNG file that is at least as large as the output size,
but not necessarily a power of two. For your own convenience,
it is recommended to be a greyscale file, rather than merely
8-bit paletted, so you can more easily think of the file as a
color MAP rather than having colors. See remarks section
below.</DD>
<DT><I>mother_move</I></DT>
<DD>
Determines how the mother image moves. Can be one of the
following values (more can be added upon request):
<TABLE summary="interform move types">
<TR>
<TH>string</TH>
<TH>Description</TH>
</TR>
<TR>
<TD><B>none</B></TD>
<TD>No movement whatsoever. This is the default
value.</TD>
</TR>
<TR>
<TD><B>scroll</B></TD>
<TD>Scroll the texture continuously with speeds
specified by <B>mother_vx</B> and <B>mother_vy</B>.
These values are in texture units per second. For
example, if you have &minus;1.0 for <B>mother_vx</B>
and 0.5 for <B>mother_vy</B> then after one second, the
mother will have scrolled its entire width to the left
and half its height upwards.</TD>
</TR>
<TR>
<TD><B>wander</B></TD>
<TD>Scroll the texture in a random direction but change
the direction of travel over time. The scrolling speed
is controlled by <B>mother_speed</B>, the amount of
change in direction is controlled by <B>
mother_rate</B>, and the strength of the steering force
is controlled by <B>mother_strength</B>. Note that
these are all optional values and do not need to be
specified.</TD>
</TR>
</TABLE>
</DD>
<dt><i>width</i>
<dd>Output width of animated texture, must be power of two.
<dt><i>height</i>
<dd>Output height of animated texture, must be power of two.
</DL>
<H4>Remarks</H4>
<P>The interform procedural texture takes two color maps, the
mother and father, averages the values of corresponding pixels
and uses that value as a lookup into a palette. By constantly
moving the color maps around, very interesting effects can be
created. Keep in mind that when you are creating the color
maps, you are not creating two greyscale images that are going
to be blended together in any normal way.</P>
<P>It is recommended for the best interform effects that the
mother and father textures are "smooth" textures where the
index value does not vary too quickly between successive
pixels. Interform textures sometimes have a tendency to look
blocky and pixellated, otherwise.</P>
<H4>Advanced OpenGL Parameters</H4>
<DL>
<DT><I>internal format</I></DT>
<DD>GL_RGB</DD>
<DT><I>GL_TEXTURE_MIN_FILTER</I></DT>
<DD>GL_LINEAR (no mipmapping, bilinear interpolation)</DD>
<DT><I>GL_TEXTURE_MAG_FILTER</I></DT>
<DD>GL_LINEAR (bilinear interpolation)</DD>
</DL>
<H4>Examples</H4>
<P>No examples are presented here because it is rather
difficult to capture the interform effect without many frames
in an animated GIF and I have a lot of tasks on my list to do.
Please take a look around <B>map joeyproc</B> for a variety of
example interform textures.</P>
</BODY>
</HTML>