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>GXSetTevIndBumpXYZ</TITLE>
9</HEAD>
10<BODY>
11<H1 align="left">GXSetTevIndBumpXYZ</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 GXSetTevIndBumpXYZ( <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">TEV stage to be set <BR>Accepted values are: <CODE>GX_TEVSTAGE0</CODE>, <CODE>GX_TEVSTAGE1</CODE>, <CODE>GX_TEVSTAGE2</CODE> through <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>Accepted values are:<BR><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 matrix and scale value for offset and multiplication <BR>Accepted values are:<BR>
35      <TABLE border="1" width="500" cellspacing="0.1">
36        <TBODY>
37          <TR>
38<TD width="150" bgcolor="#C0C0C0">Name</TD>
39<TD width="350" bgcolor="#C0C0C0">Indirect Matrix and Scale Value Used</TD>
40          </TR>
41          <TR>
42<TD width="150"><CODE>GX_ITM_0</CODE></TD>
43<TD width="350">indirect matrix 0 and matrix scale value 0</TD>
44          </TR>
45          <TR>
46<TD width="150"><CODE>GX_ITM_1</CODE></TD>
47<TD width="350">indirect matrix 1 and matrix scale value 1</TD>
48          </TR>
49          <TR>
50<TD width="150"><CODE>GX_ITM_2</CODE></TD>
51<TD width="350">indirect matrix 2 and matrix scale value 2</TD>
52          </TR>
53        </TBODY>
54      </TABLE>
55      </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 up an environment-mapped and bump-mapped indirect lookup.&nbsp;The indirect map specifies offsets in object (X, Y, Z) space. This kind of lookup requires only one TEV stage to calculate.&nbsp;However, the bump map (indirect map) is geometry-specific.&nbsp;Thus there is a space/calculation tradeoff for using this function and using <a href="GXSetTevIndBumpST.html"><code>GXSetTevIndBumpST</code></a>.</P>
63<P>The indirect matrix must be loaded with a transformation for normals from object space to texture space (similar to visible space, but with a possibly inverted Y axis).&nbsp;The surface geometry need only provide regular normals at each vertex. A normal-based texgen must be set up for regular texture coordinates.</P>
64<P><B>Note:</B> In fact, it is possible to perform this kind of bump mapping without providing vertex normals.&nbsp;Doing so requires centering the environment map around (0, 0) (wrapping below 0) instead of around the texture map's center.&nbsp;Also, the bump map must be loaded with actual normals instead of normal offsets.&nbsp;Regular texture coordinates must not be used.&nbsp;This can be done with a position-based texgen and a zero matrix, It is also possible to use <CODE>GXSetTevIndirect</CODE> (in place of <CODE>GXSetTevIndBumpXYZ</CODE>) and wrap the regular texture coordinates to zero.</P>
65<p>The following is an example for users wanting to learn more about this function.</p>
66<BLOCKQUOTE><code>GXSetTevIndBumpXYZ(GX_TEVSTAGE0, GX_INDTEXSTAGE0, GX_ITM_0);</code></BLOCKQUOTE>
67<p>Performs the equivalent operations below:</p>
68<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_STU,&nbsp;&nbsp;&nbsp;// bias<br> &nbsp;&nbsp;&nbsp;&nbsp;GX_ITM_0,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// matrix select (matrix 0 with scale 0)<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;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> }<br></code></BLOCKQUOTE>
69<H2>See Also</H2>
70<P><A href="GXSetTevIndirect.html"><CODE>GXSetTevIndirect</CODE></A></P>
71<H2>Revision History</H2>
72<P>2006/03/01 Initial version.</P>
73<hr>
74<P>CONFIDENTIAL</p>
75</BODY>
76</HTML>