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="IBM WebSphere Studio Homepage Builder Version 7.0.0.0 for Windows">
7<META http-equiv="Content-Style-Type" content="text/css">
8<title>G3*_PolygonAttr</title>
9<LINK rel="stylesheet" href="../../css/nitro.css" type="text/css">
10</head>
11
12<body>
13
14<h1 align="left">G3*_PolygonAttr <img src="../../image/NTR.gif"align="middle"><img src="../../image/TWL.gif" align="middle"></H1>
15<H2>Syntax</H2>
16
17<dl>
18  <dd>
19<PRE>
20<CODE>#include &lt;nitro/gx/g3imm.h&gt;
21#include &lt;nitro/gx/g3b.h&gt;
22#include &lt;nitro/gx/g3c.h&gt;</CODE><BR>
23<CODE>void G3_PolygonAttr(
24    int light,
25    GXPolygonMode polyMode,
26    GXCull cullMode,
27    int polygonID,
28    int alpha,
29    int misc
30</CODE>);<BR>
31// Below are APIs for creating the display list (command list):
32<CODE>void G3B_PolygonAttr(<A href="../gx/GXDLInfo.html">GXDLInfo</A>* info, ...);
33void G3C_PolygonAttr(<A href="../gx/GXDLInfo.html">GXDLInfo</A>* info, ...);
34void G3BS_PolygonAttr(<A href="../gx/GXDLInfo.html">GXDLInfo</A>* info, ...);
35</CODE><CODE>void G3CS_PolygonAttr(<A href="../gx/GXDLInfo.html">GXDLInfo</A>* info, ...);</CODE></PRE></dd>
36</dl><h2>Arguments</h2>
37
38<table border="1" width="100%">
39  <tr>
40<td width="13%"><CODE>info</CODE></td>
41<td width="87%">Command List Information.</td>
42  </tr>
43  <tr>
44<td width="13%"><CODE>light</CODE></td>
45<td width="87%">4-bit mask to specify the light to illuminate</td>
46  </tr>
47    <TR>
48<TD><CODE>polyMode</CODE></TD>
49<TD>Specifies polygon mode</TD>
50    </TR>
51    <TR>
52<TD><CODE>cullMode</CODE></TD>
53<TD>Specifies the screen to cull</TD>
54    </TR>
55    <TR>
56<TD><CODE>polygonID</CODE>&nbsp;</TD>
57<TD>Specifies the polygon ID</TD>
58    </TR>
59    <TR>
60<TD><CODE>alpha</CODE></TD>
61<TD>Specifies the &alpha; value</TD>
62    </TR>
63    <TR>
64<TD><CODE>misc</CODE></TD>
65<TD>Bit field to specify other polygon attributes</TD>
66    </TR>
67  </table>
68<h2>Return Values</h2>
69<p>None.</p>
70<H2>Description</H2>
71<P>This function sets the polygon attribute values.<BR> <em><strong><code>light</code></strong></em> is the 4-bit flag that specifies, in order from the lower bit of the lower 4 bits, whether Light 0, Light 1, Light 2, and Light 3 are ON/OFF. The polygon mode is specified as a <CODE>GXPolygonMode</CODE> value by the <SPAN class="argument">polyMode</SPAN> argument. The polygon culling method is specified as a <CODE>GXCull</CODE> value by the <SPAN class="argument">cullMode</SPAN> argument. <em><strong><code>polygonID</code></strong></em> is the argument that specifies the polygon ID between 0 - 63. Used when rendering translucent polygons, shadow polygons, and edge marking. <em><strong><code>alpha</code></strong></em> is the argument that specifies the &alpha; value for a polygon between 0 - 31. A setting of 31 specifies an opaque polygon; a setting of 0 specifies a wireframe (configure it to be hidden using the <CODE><A href="G3X_AlphaTest.html">G3X_AlphaTest</A></CODE> function); and settings between 1 and 30 specify translucent polygons. <code>misc</code> is a bit field that consists of the remaining attribute flags, and passes the logical sum of <CODE>GXPolygonAttrMisc</CODE>-type values.<BR>
72</P>
73<TABLE border="1">
74  <TBODY>
75    <TR>
76<TD width="30%"><CODE>GX_POLYGONMODE_MODULATE</CODE></TD>
77<TD width="70%">Modulation mode</TD>
78    </TR>
79    <TR>
80<TD width="30%"><CODE>GX_POLYGONMODE_DECAL</CODE></TD>
81<TD width="70%">Decal mode</TD>
82    </TR>
83    <TR>
84<TD width="30%"><CODE>GX_POLYGONMODE_TOON</CODE></TD>
85<TD width="70%">Toon shading/highlight shading mode</TD>
86    </TR>
87    <TR>
88<TD width="30%"><CODE>GX_POLYGONMODE_SHADOW</CODE></TD>
89<TD width="70%">Shadow polygon mode</TD>
90    </TR>
91  </TBODY>
92</TABLE>
93<P></P>
94<TABLE border="1">
95  <TBODY>
96    <TR>
97<TD width="30%"><CODE>GX_CULL_ALL</CODE></TD>
98<TD width="70%">Do not show on either plane</TD>
99    </TR>
100    <TR>
101<TD width="30%"><CODE>GX_CULL_FRONT</CODE></TD>
102<TD width="70%">Do not show front plane</TD>
103    </TR>
104    <TR>
105<TD width="30%"><CODE>GX_CULL_BACK</CODE></TD>
106<TD width="70%">Do not show back plane</TD>
107    </TR>
108    <TR>
109<TD width="30%"><CODE>GX_CULL_NONE</CODE></TD>
110<TD width="70%">Show both planes</TD>
111    </TR>
112  </TBODY>
113</TABLE>
114<P></P>
115<TABLE border="1">
116  <TBODY>
117    <TR>
118<TD width="30%"><CODE>GX_POLYGON_ATTR_MISC_NONE</CODE></TD>
119<TD width="70%">Indicates that nothing is visible.</TD>
120    </TR>
121    <TR>
122<TD width="30%"><CODE>GX_POLYGON_ATTR_MISC_XLU_DEPTH_UPDATE</CODE></TD>
123<TD width="70%">Update the depth buffer when rendering translucent polygons.</TD>
124    </TR>
125    <TR>
126<TD width="30%"><CODE>GX_POLYGON_ATTR_MISC_FAR_CLIPPING</CODE></TD>
127<TD width="70%">Clip if the polygon intersects the FAR plane (delete if intersects when not specified).</TD>
128    </TR>
129    <TR>
130<TD width="30%"><CODE>GX_POLYGON_ATTR_MISC_DISP_1DOT</CODE></TD>
131<TD width="70%">Show 1-dot polygons. Also see the <CODE><A href="G3X_SetDisp1DotDepth.html">G3X_SetDisp1DotDepth</A></CODE> function.</TD>
132    </TR>
133    <TR>
134<TD width="30%"><CODE>GX_POLYGON_ATTR_MISC_DEPTHTEST_DECAL</CODE></TD>
135<TD width="70%">Renders when the depth value of the fragment matches the depth value in the depth buffer. When not specified, renders when smaller than the depth value.</TD>
136    </TR>
137    <TR>
138<TD width="30%"><CODE>GX_POLYGON_ATTR_MISC_FOG</CODE></TD>
139<TD width="70%">The rendering engine performs fog blending.</TD>
140    </TR>
141  </TBODY>
142</TABLE>
143<P>The following indicate type definitions for <code>GXPolygonMode</code>, <code>GXCull</code>, and <code>GXPolygonAttrMisc</code> types.</P>
144<PRE><CODE>typedef enum
145{
146    GX_POLYGONMODE_MODULATE = 0,
147    GX_POLYGONMODE_DECAL = 1,
148    GX_POLYGONMODE_TOON = 2,
149    GX_POLYGONMODE_SHADOW = 3
150}
151GXPolygonMode;
152
153typedef enum
154{
155    GX_CULL_ALL = 0,
156    GX_CULL_FRONT = 1,
157    GX_CULL_BACK = 2,
158    GX_CULL_NONE = 3
159}
160GXCull;
161
162typedef enum
163{
164    GX_POLYGON_ATTR_MISC_NONE = 0,
165    GX_POLYGON_ATTR_MISC_XLU_DEPTH_UPDATE = 1 &lt;&lt; REG_G3_POLYGON_ATTR_XL_SHIFT,
166    GX_POLYGON_ATTR_MISC_FAR_CLIPPING = 1 &lt;&lt; REG_G3_POLYGON_ATTR_FC_SHIFT,
167    GX_POLYGON_ATTR_MISC_DISP_1DOT = 1 &lt;&lt; REG_G3_POLYGON_ATTR_D1_SHIFT,
168    GX_POLYGON_ATTR_MISC_DEPTHTEST_DECAL = 1 &lt;&lt; REG_G3_POLYGON_ATTR_DT_SHIFT,
169    GX_POLYGON_ATTR_MISC_FOG = 1 &lt;&lt; REG_G3_POLYGON_ATTR_FE_SHIFT
170}
171GXPolygonAttrMisc;</CODE></PRE>
172<H2>See Also</H2>
173<H2>Revision History</H2>
174<P>2004/01/19 Initial version.</P>
175<PRE>
176</PRE>
177<hr><p>CONFIDENTIAL</p></body></html>
178