1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2<html>
3
4<head>
5<META http-equiv="Content-Type" content="text/html; charset=windows-1252">
6<META name="GENERATOR" content="Microsoft FrontPage 5.0">
7<META http-equiv="Content-Style-Type" content="text/css">
8<LINK rel="stylesheet" type="text/css" href="../../CSS/revolution.css">
9<title>GXSetTevAlphaIn</title>
10</head>
11
12<body>
13
14<h1 align="left">GXSetTevAlphaIn</h1>
15
16<h2>Syntax</h2>
17<dl><dd><pre class="construction">
18#include &lt;revolution/gx.h&gt;
19
20void GXSetTevAlphaIn(
21    <a href="../Enumerated_Types/GXTevStageID.html">GXTevStageID</a>   stage,
22    <a href="../Enumerated_Types/GXTevAlphaArg.html">GXTevAlphaArg</a>  a,
23    <a href="../Enumerated_Types/GXTevAlphaArg.html">GXTevAlphaArg</a>  b,
24    <a href="../Enumerated_Types/GXTevAlphaArg.html">GXTevAlphaArg</a>  c,
25    <a href="../Enumerated_Types/GXTevAlphaArg.html">GXTevAlphaArg</a>  d );
26</pre></dd></dl>
27
28<h2>Arguments</h2>
29<TABLE class="arguments" border="1" >
30  <tr>
31<TH>stage</TH>
32<TD>Name of the <a href="../Enumerated_Types/GXTevStageID.html">stage</a>. Accepted values are: <code>GX_TEVSTAGE0</code>, <code>GX_TEVSTAGE1</code>, <code>GX_TEVSTAGE2</code>, ... , <code>GX_TEVSTAGE15</code>.</TD>
33  </tr>
34  <tr>
35<TH><a name="a">a</a></TH>
36<TD>Input <a href="../Enumerated_Types/GXTevColorArg.html">operand</a>. An unsigned 8-bit value for the component. Accepted values are:<BR>
37      <TABLE class="arguments" border="1" >
38          <tr>
39<TD bgcolor="#C0C0C0">Name</TD>
40<TD bgcolor="#C0C0C0">Input</TD>
41          </tr>
42          <tr>
43<TH>GX_CA_A0</TH>
44<TD>Alpha from the <CODE>TEVREG0</CODE> register.</TD>
45          </tr>
46          <tr>
47<TH>GX_CA_A1</TH>
48<TD>Alpha from the <CODE>TEVREG1</CODE> register.</TD>
49          </tr>
50          <tr>
51<TH>GX_CA_A2</TH>
52<TD>Alpha from the <CODE>TEVREG2</CODE> register.</TD>
53          </tr>
54          <tr>
55<TH>GX_CA_APREV</TH>
56<TD>Alpha from the <CODE>TEVPREV</CODE> register.</TD>
57          </tr>
58          <tr>
59<TH>GX_CA_TEXA</TH>
60<TD>Alpha from the texture.</TD>
61          </tr>
62          <tr>
63<TH>GX_CA_RASA</TH>
64<TD>Alpha from the rasterized vertex color.</TD>
65          </tr>
66          <tr>
67<TH>GX_CA_ZERO</TH>
68<TD>0.0 fixed.</TD>
69          </tr>
70          <tr>
71<TH>GX_CA_KONST</TH>
72<TD>Constant alpha input (see the <A href="GXSetTevKAlphaSel.html"><CODE>GXSetTevKAlphaSel</CODE></A> function).</TD>
73          </tr>
74      </TABLE>
75      </TD>
76    </tr>
77  <tr>
78<TH>b&nbsp;&nbsp;</TH>
79<TD>Input <A href="../Enumerated_Types/GXTevAlphaArg.html">operand</A>. An unsigned 8-bit value for the element. Applicable values are the same as for <SPAN class="argument">a</SPAN>.</TD>
80    </tr>
81  <tr>
82<TH>c</TH>
83<TD>Input <A href="../Enumerated_Types/GXTevAlphaArg.html">operand</A>. An unsigned 8-bit value for the element. Applicable values are the same as for <SPAN class="argument">a</SPAN>.</TD>
84    </tr>
85  <tr>
86<TH>d</TH>
87<TD>Input <A href="../Enumerated_Types/GXTevAlphaArg.html">operand</A>. A signed 1-bit + 10-bit value per element. Applicable values are the same as for <SPAN class="argument">a</SPAN>.</TD>
88    </tr>
89</TABLE>
90
91<h2>Return Values</h2>
92<p>None.</p>
93
94<H2>Description</H2>
95<P>This function sets the input operands for one <SPAN class="argument">stage</SPAN> of the texture environment (TEV) alpha combiner unit. The input operands <SPAN class="argument">a</SPAN>, <SPAN class="argument">b</SPAN>, and <SPAN class="argument">c</SPAN> are unsigned 8-bit inputs (0 &lt;= <SPAN class="argument">a, b, c</SPAN> &lt;= 255). The <SPAN class="argument">d</SPAN> input operand is a signed 10-bit input (-1024 &lt;= <SPAN class="argument">d</SPAN> &lt;= 1023).</P>
96<P>Each TEV stage implements the following function:</P>
97<DL><DD><CODE><EM>reg</EM></CODE> = ( <SPAN class="argument">d</SPAN> ( <CODE><EM>op</EM></CODE> ) (( 1.0 - <SPAN class="argument">c</SPAN> ) * <SPAN class="argument">a</SPAN> + <SPAN class="argument">c</SPAN> * <SPAN class="argument">b</SPAN> ) + <CODE><EM>bias</EM></CODE>) * <CODE><EM>scale</EM></CODE>;</DD></DL>
98<P>The operations described by <CODE><EM>op</EM>, <EM>bias</EM>,</CODE> and <CODE><EM>scale</EM></CODE> are programmable using the <A href="GXSetTevAlphaOp.html"><CODE>GXSetTevAlphaOp</CODE></A> function.</P>
99<P>The output of this stage is directed by default to the <CODE>GX_TEVPREV</CODE> register (see <A href="../Management/GXInit.html"><CODE>GXInit</CODE></A>), but can be set explicitly by the <A href="GXSetTevAlphaOp.html"><CODE>GXSetTevAlphaOp</CODE></A> function. When the input <SPAN class="argument">a</SPAN>, <SPAN class="argument">b</SPAN> or <SPAN class="argument">c</SPAN> is from a signed 10-bit number (either the results of a previous TEV stage or an input constant), only the 8 least-significant bits are used.&nbsp;The number is not converted; upper bits are simply discarded.</P>
100<P>The registers used to store the output of TEV stages can also be used as inputs: <CODE>GX_CA_A0</CODE>, <CODE>GX_CA_A1</CODE>, <CODE>GX_CA_A2</CODE>, and <CODE>GX_CA_APREV</CODE>. These registers can be set with constant alpha values using the <A href="GXSetTevColor.html"><CODE>GXSetTevColor</CODE></A> or <A href="GXSetTevColorS10.html"><CODE>GXSetTevColorS10</CODE></A> functions.</P>
101<P>The input operand <CODE>GX_CA_RASA</CODE> is the solution for the <A href="../list.html#Lighting">per-vertex lighting</A> equation. The input operand <CODE>GX_CA_TEXA</CODE> is the texture alpha input for this stage. You can select the colors and textures to which these inputs correspond using the <A href="GXSetTevOrder.html"><CODE>GXSetTevOrder</CODE></A> function.</P>
102
103<h2>See Also</h2>
104<P class="reference">
105<A href="GXSetTevOp.html">GXSetTevOp</A>,
106<A href="GXSetTevColorIn.html">GXSetTevColorIn</A>,
107<A href="GXSetTevAlphaOp.html">GXSetTevAlphaOp</A>,
108<A href="GXSetTevKAlphaSel.html">GXSetTevKAlphaSel</A>
109</p>
110
111<h2>Revision History</h2>
112<P>
1132008/05/26 Corrected errors.<br>2006/03/01 Initial version.<br>
114</P>
115
116<hr><p>CONFIDENTIAL</p></body>
117</HTML>