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 13<H2>Syntax</H2> 14<dl><dd><pre class="construction"> 15#include <revolution/gx.h> 16 17void 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); 23</pre></dd></dl> 24 25<H2>Arguments</H2> 26<TABLE class="arguments" border="1" > 27 <TBODY> 28 <TR> 29<TH><STRONG><EM><CODE>stage</CODE></EM></STRONG></TH> 30<TD>Tev <A href="../Enumerated_Types/GXTevStageID.html">stage ID</A>. Accepted values are: <code>GX_TEVSTAGE0</code>, <code>GX_TEVSTAGE1</code>, <code>GX_TEVSTAGE2</code> through <code>GX_TEVSTAGE15</code>.</TD> 31 </TR> 32 <TR> 33<TH><STRONG><EM><CODE>coord</CODE></EM></STRONG></TH> 34<TD>Texture <A href="../Enumerated_Types/GXTexCoordID.html">coordinates ID</A>. 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> 35 </TR> 36 <TR> 37<TH>map</TH> 38<TD>Texture <A href="../Enumerated_Types/GXTexMapID.html">map ID</A>. Applicable values are <code>GX_TEXMAP_NULL</code>, <code>GX_TEXMAP0</code>, <code>GX_TEXMAP1</code>, <code>GX_TEXMAP2</code> through <code>GX_TEXMAP7</code>. The bitwise OR of <code>GX_TEX_DISABLE</code> and <code>GX_TEXMAP*</code> can be used to perform coordinate scaling without a texture lookup.</TD> 39 </TR> 40 <TR> 41<TH><STRONG><EM><CODE>color</CODE></EM></STRONG></TH> 42<TD>Color <A href="../Enumerated_Types/GXChannelID.html">channel</A>. Accepted values are:<BR> 43 <TABLE class="arguments" border="1" > 44 <tr> 45<TD bgcolor="#C0C0C0">Name</TD> 46<TD bgcolor="#C0C0C0">rasterized color channel input</TD> 47 </tr> 48 <tr> 49<TH>GX_COLOR_NULL</TH> 50<TD>Rasterized color is not input to the TEV stage.</TD> 51 </tr> 52 <tr> 53<TH>GX_COLOR0A0</TH> 54<TD>Color channel 0 from the lighting unit.</TD> 55 </tr> 56 <tr> 57<TH>GX_COLOR1A1</TH> 58<TD>Color channel 1 from the lighting unit.</TD> 59 </tr> 60 <tr> 61<TH>GX_COLOR_ZERO</TH> 62<TD>Enters 0 in the TEV stage.</TD> 63 </tr> 64 <tr> 65<TH>GX_ALPHA_BUMP</TH> 66<TD>Bump alpha from the indirect texture unit.</TD> 67 </tr> 68 <tr> 69<TH>GX_ALPHA_BUMPN</TH> 70<TD>Formalized bump alpha from the indirect texture unit.</TD> 71 </tr> 72 </TABLE> 73<STRONG>Note:</STRONG> Neither <code>GX_ALPHA_BUMP</code> nor <code>GX_ALPHA_BUMPN</code> can be used with <code>GX_TEVSTAGE0</code>.</TD> 74 </TR> 75 </TBODY> 76</TABLE> 77 78<H2>Return Values</H2> 79<P>None.</P> 80 81<H2>Description</H2> 82<P>This function specifies the texture and rasterized color that will be available as inputs to this TEV <SPAN class="argument">stage</SPAN>. The texture coordinate <SPAN class="argument">coord</SPAN> is generated from input attributes used in the <A href="../TexCoordGen/GXSetTexCoordGen.html"><CODE>GXSetTexCoordGen</CODE></A> function, and is used to look up the texture <SPAN class="argument">map</SPAN>, previously loaded by the <A href="../Texture/GXLoadTexObj.html"><CODE>GXLoadTexObj</CODE></A> function.</P> 83<P>Be aware that this function does not make TEV stages available. 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> 84<P>The processes for each TEV stage are independent. Color processing is controlled by the <A href="GXSetTevColorOp.html"><CODE>GXSetTevColorIn</CODE></A> and <A href="GXSetTevColorIn.html"><CODE>GXSetTevColorOp</CODE></A> functions. Alpha processing is controlled by the <A href="GXSetTevAlphaOp.html"><CODE>GXSetTevAlphaIn</CODE></A> and <A href="GXSetTevAlphaIn.html"><CODE>GXSetTevAlphaOp</CODE></A> functions.</P> 85<P>All of the texture coordinate numbers that can be used in active TEV stages are set using the <A href="../TexCoordGen/GXSetNumTexGens.html"><CODE>GXSetNumTexGens</CODE></A> function. All of the color channel numbers that can be used in active TEV stages are set using the <A href="../Lighting/GXSetNumChans.html"><CODE>GXSetNumChans</CODE></A> function. Active TEV stages should not reference texture coordinates and colors beyond those that were generated.</P> 86<P>Using the <A href="GXSetTevOrder.html"><CODE>GXSetTevOrder</CODE></A> function, it is possible to broadcast a single texture coordinate to many textures <B>as long as the textures are the same size</B>.</P> 87<DL><DD><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></DD></DL> 88<P>Any TEV stage can use any generated texture coordinates.</P> 89<DL><DD><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></DD></DL> 90<P>If textures are not to be used in the TEV stage, set <SPAN class="argument">coord</SPAN> and <SPAN class="argument">map</SPAN> to <CODE>NULL</CODE>.</P> 91<DL><DD><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></DD></DL> 92<P>If colors are not to be used in the TEV stage, set <SPAN class="argument">color</SPAN> to <CODE>NULL</CODE>.</P> 93<DL><DD><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></DD></DL> 94<P>The <A href="GXSetTevOrder.html"><CODE>GXSetTevOrder</CODE></A> function will, within its calls, scale the formalized texture coordinates generated in the <A href="../TexCoordGen/GXSetTexCoordGen.html"><CODE>GXSetTexCoordGen</CODE></A> function, to suit the size of the texture map. As a result, texture coordinates can be broadcast to multiple texture maps when the map sizes are identical. There may be times when it is desirable to generate texture coordinates within a certain scale without performing a texture lookup (which would occur when generate texture coordinates for indirect texture bump mapping). To affect this. use the <CODE>GX_TEXMAP_DISABLE</CODE> flag.</P> 95<DL><DD><CODE>GXSetTevOrder(GX_TEVSTAGE1, GX_TEXCOORD0, GX_TEXMAP3 | GX_TEXMAP_DISABLE, GX_COLOR_NULL);</CODE></DD></DL> 96<P>This uses <CODE>GX_TEXMAP3</CODE> to scale <CODE>GX_TEXCOORD0</CODE>, but disables the lookup for <CODE>GX_TEXMAP3</CODE>.</P> 97<P>There are some special settings for the argument <SPAN class="argument">color</SPAN>. When <CODE>GX_COLOR_ZERO</CODE> is specified, zero is always derived as a rasterized color. When <CODE>GX_ALPHA_BUMP</CODE> or <CODE>GX_ALPHA_BUMPN</CODE> is 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 therefore from 0 to 248. <CODE>GX_ALPHA_BUMPN</CODE>, however, performs normalization, allowing for a range from 0 to 255.</P> 98<P>The <A href="../Management/GXInit.html"><CODE>GXInit</CODE></A> function records the default TEV state.</P> 99 100<H2>See Also</H2> 101<P class="reference"> 102<A href="TevConfigGuide.html">TEV Configuration Guide</A>, <A href="GXSetNumTevStages.html">GXSetNumTevStages</A>, <A href="../Lighting/GXSetChanCtrl.html">GXSetChanCtrl</A>, <A href="../Texture/GXLoadTexObj.html">GXLoadTexObj</A>, <A href="../TexCoordGen/GXSetTexCoordGen.html">GXSetTexCoordGen</A> 103</P> 104 105<H2>Revision History</H2> 106<P> 1072006/03/01 Initial version.<br> 108</P> 109 110<hr><p>CONFIDENTIAL</p></body> 111</HTML>