1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2<HTML>
3<HEAD>
4<META http-equiv="Content-Type" content="text/html; charset=windows-1252">
5<META name="GENERATOR" content="Microsoft FrontPage 5.0">
6<META http-equiv="Content-Style-Type" content="text/css">
7<LINK rel="stylesheet" type="text/css" href="../../CSS/revolution.css">
8<TITLE>GXSetTevOrder</TITLE>
9</HEAD>
10<BODY>
11<H1 align="left">GXSetTevOrder</H1>
12<H2>C Specification</H2>
13<DL>
14  <DD>
15  <PRE><CODE>#include &lt;revolution/gx.h&gt;</CODE></PRE>
16  <DD>
17  <PRE><CODE>void GXSetTevOrder(
18    <A href="../Enumerated_Types/GXTevStageID.html">GXTevStageID</A>    stage,
19    <A href="../Enumerated_Types/GXTexCoordID.html">GXTexCoordID</A>    coord,
20    <A href="../Enumerated_Types/GXTexMapID.html">GXTexMapID</A>      map,
21    <A href="../Enumerated_Types/GXChannelID.html">GXChannelID</A>     color
22);</CODE></PRE>
23</DL>
24<H2>Arguments</H2>
25<TABLE border="1" cellspacing="0.1" cellpadding="3">
26  <TBODY>
27    <TR>
28<TD width="120" valign="top" bgcolor="#ffffe8"><EM><STRONG><CODE>stage</FONT></STRONG></EM></TD>
29<TD width="520">the TEV <a href="../Enumerated_Types/GXTevStageID.html">stage ID</a><BR>Accepted values are: <code>GX_TEVSTAGE0</code>, <code>GX_TEVSTAGE1</code>, <code>GX_TEVSTAGE2</code>, through <code>GX_TEVSTAGE15</code>.</TD>
30    </TR>
31    <TR>
32<TD width="120" valign="top" bgcolor="#ffffe8"><EM><STRONG><CODE>coord</FONT></STRONG></EM></TD>
33<TD width="520">the texture <A href="../Enumerated_Types/GXTexCoordID.html">coordinates ID</A><BR>Applicable values are <code>GX_TEXCOORD_NULL</code>, <code>GX_TEXCOORD0</code>, <code>GX_TEXCOORD1</code>, <code>GX_TEXCOORD2</code> through <code>GX_TEXCOORD7</code>.</TD>
34    </TR>
35    <TR>
36<TD width="120" valign="top" bgcolor="#ffffe8"><EM><STRONG><CODE>map</FONT></STRONG></EM></TD>
37<TD width="520">the texture <A href="../Enumerated_Types/GXTexMapID.html">map ID</A><BR>Applicable values are <code>GX_TEXCOORD_NULL</code>, <code>GX_TEXCOORD0</code>, <code>GX_TEXCOORD1</code>, <code>GX_TEXCOORD2</code>, through <code>GX_TEXCOORD7</code>. The bitwise OR for <code>GX_TEX_DISABLE</code> and <code>GX_TEXMAP*</code> are permitted to perform coordinate scaling without a texture lookup.</TD>
38    </TR>
39    <TR>
40<TD width="120" valign="top" bgcolor="#ffffe8"><EM><STRONG><CODE>color</FONT></STRONG></EM></TD>
41<TD width="520">the color <A href="../Enumerated_Types/GXChannelID.html">channel</A>&nbsp;<BR>Accepted values are:<BR>
42      <TABLE border="1" width="500" cellspacing="0.1">
43
44          <tr>
45<TD width="150" bgcolor="#C0C0C0">Name</TD>
46<TD width="350" bgcolor="#C0C0C0">Rasterized Color Channel Input</TD>
47          </tr>
48          <tr>
49<TD width="150"><code> GX_COLOR_NULL</code></TD>
50<TD width="350">rasterized color is not input to the TEV stage</TD>
51          </tr>
52          <tr>
53<TD width="150"><code>GX_COLOR0A0</code></TD>
54<TD width="350">color channel 0 from the lighting unit</TD>
55          </tr>
56          <tr>
57<TD width="150"><code>GX_COLOR1A1</code></TD>
58<TD width="350">color channel 1 from the lighting unit</TD>
59          </tr>
60          <tr>
61<TD width="150"><code>GX_COLOR_ZERO</code></TD>
62<TD width="350">enters 0 in the TEV stage</TD>
63          </tr>
64          <tr>
65<TD width="150"><code>GX_ALPHA_BUMP</code></TD>
66<TD width="350">the bump alpha from the indirect texture unit</TD>
67          </tr>
68          <tr>
69<TD width="150"><code>GX_ALPHA_BUMPN</code></TD>
70<TD width="350">the normalized bump alpha from the indirect texture unit</TD>
71          </tr>
72
73      </TABLE>
74Note: Neither <code>GX_ALPHA_BUMP</code> nor <code>GX_ALPHA_BUMPN</code> can be used with <code>GX_TEVSTAGE0</code>.</TD>
75    </TR>
76  </TBODY>
77</TABLE>
78<H2>Return Values</H2>
79<P>None.</P>
80<H2>Description</H2>
81<P>This function specifies the texture and rasterized color that will be available as inputs to this TEV <code>stage</code>.&nbsp;The texture coordinate <code>coord</code> is generated from input attributes using the <a href="../TexCoordGen/GXSetTexCoordGen.html"><code>GXSetTexCoordGen</code></a> function, and is used to look up the texture <code>map</code>, previously loaded by <a href="../Texture/GXLoadTexObj.html"><code>GXLoadTexObj</code></a>.&nbsp;</P>
82<P>Be aware that this function does not make TEV stages available.&nbsp;Use the <a href="GXSetNumTevStages.html"><code>GXSetNumTevStages</code></a> function to make available the series of TEV stages beginning with stage <CODE>GX_TEVSTAGE0</CODE>.</P>
83<P>The processes for each TEV stage are independent. Color processing is controlled by the <A href="GXSetTevColorIn.html"><CODE>GXSetTevColorIn</CODE></A> and <A href="GXSetTevColorOp.html"><CODE>GXSetTevColorOp</CODE></A> functions. Alpha processing is controlled by the <A href="GXSetTevAlphaIn.html"><CODE>GXSetTevAlphaIn</CODE></A> and <A href="GXSetTevColorOp.html"><CODE>GXSetTevColorOp</CODE></A> functions.</P>
84<P>The number of texture coordinates that can be used in all active TEV stages is set using the <A href="../TexCoordGen/GXSetNumTexGens.html"><CODE>GXSetNumTexGens</CODE></A> function. The number of color channels that can be used with all active TEV stages is set using the <A href="../TexCoordGen/GXSetNumTexGens.html"><CODE>GXSetNumChans</CODE></A> function. Active TEV stages should not reference more texture coordinates and colors than were generated.</P>
85<P>Using the <A href="GXSetTevOrder.html"><CODE>GXSetTevOrder</CODE></A> function, it is possible to broadcast a single texture coordinate to multiple textures <B>as long as they are the same size</B>:</P>
86<BLOCKQUOTE><font size="2"><CODE>GXSetTevOrder(GX_TEVSTAGE0, GX_TEXCOORD0, GX_TEXMAP0, GX_COLOR0A0);<BR> GXSetTevOrder(GX_TEVSTAGE1, GX_TEXCOORD0, GX_TEXMAP1, GX_COLOR0A0);<BR> GXSetTevOrder(GX_TEVSTAGE2, GX_TEXCOORD0, GX_TEXMAP2, GX_COLOR1A1);<BR> GXSetTevOrder(GX_TEVSTAGE3, GX_TEXCOORD0, GX_TEXMAP3, GX_COLOR0A0);</CODE></FONT></BLOCKQUOTE>
87<P>Any TEV stage can use any generated texture coordinates.</P>
88<BLOCKQUOTE><font size="2"><CODE>GXSetTevOrder(GX_TEVSTAGE0, GX_TEXCOORD3, GX_TEXMAP0, GX_COLOR0A0);<BR> GXSetTevOrder(GX_TEVSTAGE1, GX_TEXCOORD2, GX_TEXMAP1, GX_COLOR0A0);<BR> GXSetTevOrder(GX_TEVSTAGE2, GX_TEXCOORD1, GX_TEXMAP2, GX_COLOR1A1);<BR> GXSetTevOrder(GX_TEVSTAGE3, GX_TEXCOORD0, GX_TEXMAP3, GX_COLOR0A0);</CODE></FONT></BLOCKQUOTE>
89<P>If textures are not to be used in the TEV stage, set <CODE>coord</CODE> and <CODE>map</CODE> to NULL.</P>
90<BLOCKQUOTE><font size="2"><CODE>GXSetTevOrder(GX_TEVSTAGE0, GX_TEXCOORD2, GX_TEXMAP0, GX_COLOR0A0);<BR> GXSetTevOrder(GX_TEVSTAGE1, GX_TEXCOORD_NULL, GX_TEXMAP_NULL, GX_COLOR0A0);<BR> GXSetTevOrder(GX_TEVSTAGE2, GX_TEXCOORD1, GX_TEXMAP2, GX_COLOR1A1);<BR> GXSetTevOrder(GX_TEVSTAGE3, GX_TEXCOORD0, GX_TEXMAP3, GX_COLOR0A0);</CODE></FONT></BLOCKQUOTE>
91<P>If colors are not to be used in the TEV stage, set <CODE>color</CODE> to NULL.</P>
92<BLOCKQUOTE><font size="2"><CODE>GXSetTevOrder(GX_TEVSTAGE0, GX_TEXCOORD3, GX_TEXMAP0, GX_COLOR0A0);<BR> GXSetTevOrder(GX_TEVSTAGE1, GX_TEXCOORD2, GX_TEXMAP1, GX_COLOR_NULL);<BR> GXSetTevOrder(GX_TEVSTAGE2, GX_TEXCOORD1, GX_TEXMAP2, GX_COLOR1A1);<BR> GXSetTevOrder(GX_TEVSTAGE3, GX_TEXCOORD0, GX_TEXMAP3, GX_COLOR0A0);</CODE></FONT></BLOCKQUOTE>
93<P>The <A href="../TexCoordGen/GXSetTexCoordGen.html"><CODE>GXSetTevOrder</CODE></A> function will, within its calls, scale the normalized texture coordinates generated in the <A href="GXSetTevOrder.html"><CODE>GXSetTexCoordGen</CODE></A> function according to the texture map size. For this reason, texture coordinates can only be broadcast to multiple texture maps only if those maps are the same size. In some cases, you may want to generate a texture coordinate at a certain scale but disable the texture lookup (this is an issue when generating texture coordinates for indirect bump mapping). To implement this, use the <CODE>GX_TEXMAP_DISABLE</CODE> flag.</P>
94<BLOCKQUOTE><CODE><font size="2">GXSetTevOrder(GX_TEVSTAGE1, GX_TEXCOORD0, GX_TEXMAP3 | GX_TEXMAP_DISABLE, GX_COLOR_NULL);</FONT></CODE></BLOCKQUOTE>
95<P>This uses <CODE>GX_TEXMAP3</CODE> to scale <CODE>GX_TEXCOORD0</CODE>, but disables the lookup for <CODE>GX_TEXMAP3</CODE>.</P>
96<P>There are several special settings for the argument <CODE>color</CODE>. Zero is always obtained as a rasterized color when <CODE>GX_COLOR_ZERO</CODE> is specified. When <CODE>GX_ALPHA_BUMP</CODE> or <CODE>GX_ALPHA_BUMPN</CODE> are specified, the bump alpha from the indirect texture unit can be used as a rasterized color (for more on settings for bump alphas, see the <A href="../Indirect/GXSetTevIndirect.html"><CODE>GXSetTevIndirect</CODE></A> function). A bump alpha only has five bits of data, so <CODE>GX_ALPHA_BUMP</CODE> will shift the upper bits; the resulting range of values is from 0 to 248. <CODE>GX_ALPHA_BUMPN</CODE>, however, performs normalization, allowing for a range from 0 to 255.</P>
97<P>The <A href="../Management/GXInit.html"><CODE>GXInit</CODE></A> function describes the default TEV order.</P>
98<H2>See Also</H2>
99<P><A href="TevConfigGuide.html">TEV Setting Guide</A><BR> <BR> <CODE><A href="GXSetNumTevStages.html">GXSetNumTevStages</A></CODE><BR> <A href="../Lighting/GXSetChanCtrl.html"><CODE>GXSetChanCtrl</CODE></A><BR> <A href="../Texture/GXLoadTexObj.html"><CODE>GXLoadTexObj</CODE></A><BR> <A href="../TexCoordGen/GXSetTexCoordGen.html"><CODE>GXSetTexCoordGen</CODE></A></P>
100<H2>Revision History</H2>
101<P>2006/03/01 Initial version.</P>
102<hr>
103<P>CONFIDENTIAL</p>
104</BODY>
105</HTML>
106