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>GXSetTevIndBumpST</TITLE>
9</HEAD>
10<BODY>
11<H1 align="left">GXSetTevIndBumpST</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 GXSetTevIndBumpST( <A href="../Enumerated_Types/GXTevStageID.html">GXTevStageID</A> tev_stage,
18<A href="../Enumerated_Types/GXIndTexStageID.html">GXIndTexStageID</A> ind_stage,
19<A href="../Enumerated_Types/GXIndTexMtxID.html">GXIndTexMtxID</A> matrix_sel);</CODE></PRE>
20</DL>
21<H2>Arguments</H2>
22<TABLE border="1" cellpadding="3" cellspacing="0.1">
23  <TBODY>
24    <TR>
25<TD width="120" valign="top" bgcolor="#ffffe8"><EM><STRONG><CODE>tev_stage</code></STRONG></EM></TD>
26<TD width="520">the TEV stage to be set <BR>Applicable values are <code>GX_TEVSTAGE0</code>, <code>GX_TEVSTAGE1</code>, <code>GX_TEVSTAGE2</code> through <code>GX_TEVSTAGE13</code>. This function sets three consecutive stages, so it cannot use <code>GX_TEVSTAGE14</code> and <code>GX_TEVSTAGE15</code>.</TD>
27    </TR>
28    <TR>
29<TD width="120" valign="top" bgcolor="#ffffe8"><EM><STRONG><CODE>ind_stage</code></STRONG></EM></TD>
30<TD width="520">the indirect stage results used with this TEV stage <BR>Applicable values are <code>GX_INDTEXSTAGE0</code>, <code>GX_INDTEXSTAGE1</code>, <code>GX_INDTEXSTAGE2</code> and <code>GX_INDTEXSTAGE3</code>.</TD>
31    </TR>
32    <TR>
33<TD width="120" valign="top" bgcolor="#ffffe8"><EM><STRONG><CODE>matrix_sel</code></STRONG></EM></TD>
34<TD width="520">specifies the indirect scale value for offset multiplication <BR>Accepted values are:<BR>
35      <TABLE border="1" width="500" cellspacing="0.1">
36
37          <tr>
38<TD width="150" bgcolor="#C0C0C0">Name</TD>
39<TD width="350" bgcolor="#C0C0C0">Matrix Scale Value Used</TD>
40          </tr>
41          <tr>
42<TD width="150" height="15"><code>GX_ITM_0</code></TD>
43<TD width="350" height="15">matrix scale value 0</TD>
44          </tr>
45          <tr>
46<TD width="150"><code>GX_ITM_1</code></TD>
47<TD width="350">matrix scale value 1</TD>
48          </tr>
49          <tr>
50<TD width="150"><code>GX_ITM_2</code></TD>
51<TD width="350">matrix scale value 2</TD>
52          </tr>
53
54      </TABLE>
55This function cannot use any indirect matrices. Matrix scale values can only be used together with dynamic S/T matrices.</TD>
56    </TR>
57  </TBODY>
58</TABLE>
59<H2>Return Values</H2>
60<P>None.</P>
61<H2>Description</H2>
62<P>This function sets an environment-mapped bump-mapped (EMBM) indirect lookup.&nbsp;The indirect map specifies offsets in the (S, T) coordinate space.&nbsp;This type of lookup requires three TEV stages to calculate.&nbsp;As a result of these calculations, a simple 2D bump map is properly oriented to the surface to which it is applied.&nbsp;It is used to alter a normal-based texgen which then looks up an environment map.&nbsp;The environment map may be a simple light map, or a reflection map of the surrounding scenery.</P>
63<P>When using this function, texture lookups should be disabled for the first two TEV stages.&nbsp;The third stage is where the texture lookup is actually performed. The associated geometry must supply normal/binormal/tangent coordinates at each vertex. Appropriate texgens must supply each of these to the proper stages.&nbsp;(Binormal is first. Tangent is second. Normal is third. ) Even when not using static indirect matrices, it is necessary to select the matrix slot, and set the scale value used for this lookup.</P>
64<P>The following is an example for users wanting to learn more about this function.</P>
65<BLOCKQUOTE><code>GXSetTevIndBumpST(GX_TEVSTAGE0, GX_INDTEXSTAGE0, GX_ITM_0);</code></BLOCKQUOTE>
66<p>Performs the equivalent operations below:</p>
67<BLOCKQUOTE><code>{<br> &nbsp;&nbsp;GXSetTevIndirect(<br> &nbsp;&nbsp;&nbsp;&nbsp;GX_TEVSTAGE0, // tev stage<br> &nbsp;&nbsp;&nbsp;&nbsp;GX_INDSTAGE0, // indirect stage<br> &nbsp;&nbsp;&nbsp;&nbsp;GX_ITF_8, &nbsp;&nbsp;&nbsp;&nbsp;// format<br> &nbsp;&nbsp;&nbsp;&nbsp;GX_ITB_ST, &nbsp;&nbsp;&nbsp;// bias<br> &nbsp;&nbsp;&nbsp;&nbsp;GX_ITM_S0,&nbsp;&nbsp; &nbsp;// matrix select (S matrix with scale 0)<br> &nbsp;&nbsp;&nbsp;&nbsp;GX_ITW_0, &nbsp;&nbsp; &nbsp;// wrap direct S<br> &nbsp;&nbsp;&nbsp;&nbsp;GX_ITW_0, &nbsp;&nbsp; &nbsp;// wrap direct T<br> &nbsp;&nbsp;&nbsp;&nbsp;FALSE, &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// add prev stage output?<br>&nbsp;&nbsp;&nbsp;&nbsp;FALSE, &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// use unmodified TC for LOD?<br>&nbsp;&nbsp;&nbsp;&nbsp;GX_ITBA_OFF &nbsp;&nbsp;// bump alpha select<br> &nbsp;&nbsp;);<br> &nbsp;&nbsp;GXSetTevIndirect(<br> &nbsp;&nbsp; &nbsp;GX_TEVSTAGE1, // tev stage<br> &nbsp;&nbsp;&nbsp;&nbsp;GX_INDSTAGE0,&nbsp;// indirect stage<br> &nbsp;&nbsp;&nbsp;&nbsp;GX_ITF_8, &nbsp;&nbsp;&nbsp;&nbsp;// format<br> &nbsp;&nbsp;&nbsp;&nbsp;GX_ITB_ST, &nbsp;&nbsp;&nbsp;// bias<br> &nbsp;&nbsp;&nbsp;&nbsp;GX_ITM_T0,&nbsp;&nbsp;&nbsp;&nbsp;// matrix select (T matrix with scale 0)<br> &nbsp;&nbsp;&nbsp;&nbsp;GX_ITW_0, &nbsp;&nbsp;&nbsp;&nbsp;// wrap direct S<br> &nbsp;&nbsp;&nbsp;&nbsp;GX_ITW_0, &nbsp;&nbsp;&nbsp;&nbsp;// wrap direct T<br> &nbsp;&nbsp;&nbsp;&nbsp;TRUE, &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// add prev stage output?<br>&nbsp;&nbsp;&nbsp;&nbsp;FALSE, &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// use unmodified TC for LOD?<br>&nbsp;&nbsp;&nbsp;&nbsp;GX_ITBA_OFF &nbsp;&nbsp;// bump alpha select<br> &nbsp;&nbsp;);<br> &nbsp;&nbsp;GXSetTevIndirect(<br> &nbsp;&nbsp; &nbsp;GX_TEVSTAGE2, // tev stage<br> &nbsp;&nbsp;&nbsp;&nbsp;GX_INDSTAGE0,&nbsp;// indirect stage<br> &nbsp;&nbsp;&nbsp;&nbsp;GX_ITF_8, &nbsp;&nbsp;&nbsp;&nbsp;// format<br> &nbsp;&nbsp;&nbsp;&nbsp;GX_ITB_NONE, &nbsp;// bias<br> &nbsp;&nbsp;&nbsp;&nbsp;GX_ITM_OFF, &nbsp;&nbsp;// matrix select<br> &nbsp;&nbsp;&nbsp;&nbsp;GX_ITW_OFF, &nbsp;&nbsp;// wrap direct S<br> &nbsp;&nbsp;&nbsp;&nbsp;GX_ITW_OFF, &nbsp;&nbsp;// wrap direct T<br> &nbsp;&nbsp;&nbsp;&nbsp;TRUE, &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// add prev stage output?<br>&nbsp;&nbsp;&nbsp;&nbsp;FALSE, &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// use unmodified TC for LOD?<br>&nbsp;&nbsp;&nbsp;&nbsp;GX_ITBA_OFF &nbsp;&nbsp;// bump alpha select<br> &nbsp;&nbsp;);<br> }</code></BLOCKQUOTE>
68<P><a href="GXSetTevIndRepeat.html"><code>GXSetTevIndRepeat</code></a> can be used in subsequent TEV stages to reuse the calculated texture coordinates for additional lookups.</P>
69<H2>See Also</H2>
70<P><A href="GXSetTevIndirect.html"><CODE>GXSetTevIndirect</CODE></A><br> <A href="GXSetTevIndRepeat.html"><CODE>GXSetTevIndRepeat</CODE></A></P>
71<H2>Revision History</H2>
72<P>03/01/2006 Initial version.</P>
73</BODY>
74</HTML>