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>C Specification</h2> 17 18<dl> 19<dd><PRE><CODE>#include <revolution/gx.h></CODE></PRE></dd> 20<dd><pre><CODE>void GXSetTevAlphaIn( 21<a href="../Structures/GXTexRegion.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 );</CODE></pre></dd> 26</dl><h2>Arguments</h2> 27<TABLE cellspacing="0.1" border="1" cellpadding="3"> 28 <tr> 29<TD width="120" valign="top" bgcolor="#ffffe8"><em><strong><CODE>stage</font></strong></em></TD> 30<TD width="520">name of the <a href="../Enumerated_Types/GXTevStageID.html">stage</a><BR>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<TD width="120" valign="top" bgcolor="#ffffe8"><em><strong><CODE><a name="a">a</a></font></strong></em></TD> 34<TD width="520">an input <a href="../Enumerated_Types/GXTevColorArg.html">operand</a><BR>An unsigned 8-bit value for the component. <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">Input</TD> 40 </tr> 41 <tr> 42<TD width="150"><code>GX_CA_A0</code></TD> 43<TD width="350">alpha from the <CODE>TEVREG0</CODE> register</TD> 44 </tr> 45 <tr> 46<TD width="150"><code>GX_CA_A1</code></TD> 47<TD width="350">alpha from the <CODE>TEVREG1</CODE> register</TD> 48 </tr> 49 <tr> 50<TD width="150"><code>GX_CA_A2</code></TD> 51<TD width="350">alpha from the <CODE>TEVREG2</CODE> register</TD> 52 </tr> 53 <tr> 54<TD width="150"><code>GX_CA_APREV</code></TD> 55<TD width="350">alpha from the <CODE>TEVPREV</CODE> register</TD> 56 </tr> 57 <tr> 58<TD width="150"><code>GX_CA_TEXA</code></TD> 59<TD width="350">alpha from the texture</TD> 60 </tr> 61 <tr> 62<TD width="150"><code>GX_CA_RASA</code></TD> 63<TD width="350">alpha from the rasterized vertex color</TD> 64 </tr> 65 <tr> 66<TD width="150"><code>GX_CA_ZERO</code></TD> 67<TD width="350">0.0 fixed</TD> 68 </tr> 69 <tr> 70<TD width="150"><code>GX_CA_KONST</code></TD> 71<TD width="350">constant alpha input (see the <A href="GXSetTevKAlphaSel.html"><CODE>GXSetTevKAlphaSel</CODE></A> function)</TD> 72 </tr> 73 74 </TABLE> 75 </TD> 76 </tr> 77 <tr> 78<TD width="120" valign="top" bgcolor="#ffffe8"><em><strong><CODE>b</font></strong></em></TD> 79<TD width="520">an input <a href="../Enumerated_Types/GXTevColorArg.html">operand</A><BR>An unsigned 8-bit value for the element. Applicable values are as for <CODE>a</CODE>.</TD> 80 </tr> 81 <tr> 82<TD width="120" valign="top" bgcolor="#ffffe8"><em><strong><CODE>c</font></strong></em></TD> 83<TD width="520">an input <a href="../Enumerated_Types/GXTevColorArg.html">operand</A><BR>An unsigned 8-bit value for the element. Applicable values are as for <CODE>a</CODE>.</TD> 84 </tr> 85 <tr> 86<TD width="120" valign="top" bgcolor="#ffffe8"><em><strong><CODE>d</font></strong></em></TD> 87<TD width="520">an input <a href="../Enumerated_Types/GXTevColorArg.html">operand</A><BR>A signed 1-bit + 10-bit value for the element. Applicable values are as for <CODE>a</CODE>.</TD> 88 </tr> 89</TABLE> 90<h2>Return Values</h2> 91 92<p>None.</p> 93<H2>Description</H2> 94<P>This function sets the input operands for one <code>stage</code> of the texture environment (TEV) alpha combiner unit. The input operands <CODE>a</CODE>, <CODE>b</CODE> and <code>c</code> are unsigned 8-bit inputs <code>(0 <= <strong>a,b,c</strong> <= 255)</code>. The <code>d</code> input operand is a signed 10-bit input <code>(-1024 <= <strong>d</strong> <= 1023)</code>.</P> 95<P>Each TEV stage implements the following function:</P> 96<P><CODE>reg = (<STRONG>d</STRONG> (op) ((1.0 - <STRONG>c</STRONG>)*<STRONG>a</STRONG> + <STRONG>c</STRONG>*<STRONG>b</STRONG>) + bias) * scale;</CODE></P> 97<P>The operations described by <CODE>op</CODE>, <CODE>bias</CODE> and <code>scale</code> are programmable using the <a href="GXSetTevAlphaOp.html"><code>GXSetTevAlphaOp</code></a> function.</P> 98<P>The output of this stage is directed by default to the register <code>GX_TEVPASS</code> (see <a href="../Management/GXInit.html"><code>GXInit</code></a>), but may be set explicitly by <a href="GXSetTevAlphaOp.html"><code>GXSetTevAlphaOp</code></a>. When the input <code>a</code>, <code>b</code> or <code>c</code> 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. The number is not converted; upper bits are simply discarded.</P> 99<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 <code><a href="GXSetTevColor.html">GXSetTevColor</a></code> or <a href="GXSetTevColorS10.html"><code>GXSetTevColorS10</code></a>.</P> 100<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 <a href="GXSetTevOrder.html"><code>GXSetTevOrder</code></a>.</P> 101 102<h2>See Also</h2> 103 104<p><A href="GXSetTevOp.html"><CODE>GXSetTevOp</CODE></A><br> <A href="GXSetTevColorIn.html"><CODE>GXSetTevColorIn</CODE></A><br> <A href="GXSetTevAlphaOp.html"><CODE>GXSetTevAlphaOp</CODE></A><br> <A href="GXSetTevKAlphaSel.html"><CODE>GXSetTevKAlphaSel</CODE></A></p> 105<h2>Revision History</h2> 106<P>03/01/2006 Initial version.</P>