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>tg-shadow</title>
10</head>
11
12<body>
13
14<h1 align="left">tg-shadow</h1>
15
16
17
18<h2>Description</h2>
19
20<P>This program performs shadow projection using texture coordinate generation and a two-pass rendering method. A shadow pattern is rendered along the first path. Next, the frame buffer is copy output as a texture. For the second path, this shadow texture is projected onto the floor. This demo shows a scene of a torus object shadow.</P>
21<h2>Coverage</h2>
22<TABLE border="1" cellpadding="3" cellspacing="0.1" width="640">
23  <tr>
24<TD width="30%" bgcolor="#C0C0C0"><EM><STRONG>Function</STRONG></EM></TD>
25<TD width="25%" bgcolor="#C0C0C0"><EM><STRONG>Parameters</STRONG></EM></TD>
26<TD width="45%" bgcolor="#C0C0C0"><EM><STRONG>Description</STRONG></EM></TD>
27    </tr>
28  <tr>
29<TD width="30%" rowspan="3"><a href="../../../gx/Transform/GXLoadTexMtxImm.html"><code>GXLoadTexMtxImm</code></a></TD>
30<TD width="25%">Matrices</TD>
31<TD width="45%">Appropriate projection matrix.</TD>
32    </tr>
33  <tr>
34<TD width="25%">Matrix destination</TD>
35<TD width="45%"><FONT face="Courier New">GX_TEXMTX1</FONT></TD>
36    </tr>
37  <tr>
38<TD width="25%">Types</TD>
39<TD width="45%"><strong><FONT face="Courier New">GX_MTX3x4</FONT></strong></TD>
40    </tr>
41  <tr>
42<TD width="30%"><a href="../../../gx/TexCoordGen/GXSetNumTexGens.html"><code>GXSetNumTexGens</code></a></TD>
43<TD width="25%">number of texture coordinates.</TD>
44      <TD width="45%">0, 1</TD>
45    </tr>
46  <tr>
47<TD width="30%" rowspan="4"><a href="../../../gx/TexCoordGen/GXSetTexCoordGen.html"><code>GXSetTexCoordGen</code></a></TD>
48<TD width="25%">Destination coordinates.</TD>
49<TD width="45%"><FONT face="Courier New">GX_TEXCOORD1</FONT></TD>
50    </tr>
51  <tr>
52<TD width="25%">Generation type.</TD>
53<TD width="45%"><strong><FONT face="Courier New">GX_TG_MTX3x4</FONT></strong></TD>
54    </tr>
55  <tr>
56<TD width="25%">Generation source.</TD>
57<TD width="45%"><strong><FONT face="Courier New">GX_TG_POS</FONT></strong></TD>
58    </tr>
59  <tr>
60<TD width="25%">Matrix source.</TD>
61<TD width="45%"><FONT face="Courier New">GX_TEXMTX1</FONT></TD>
62    </tr>
63  <tr>
64<TD width="30%" rowspan="5"><a href="../../../gx/Texture/GXInitTexObj.html"><code>GXInitTexObj</code></a></TD>
65<TD width="25%">Pointer to image data.</TD>
66<TD width="45%">Appropriate value.</TD>
67    </tr>
68  <tr>
69<TD width="25%">Width and height</TD>
70<TD width="45%">Appropriate value.</TD>
71    </tr>
72  <tr>
73<TD width="25%">Format</TD>
74<TD width="45%"><CODE>GX_TF_IA4</CODE>, <CODE>GX_TF_RGB5A3</CODE></TD>
75    </tr>
76  <tr>
77<TD width="25%">Wrap mode (s, t)</TD>
78<TD width="45%"><FONT face="Courier New">GX_CLAMP</FONT>, <FONT face="Courier New">GX_REPEAT</FONT>.</TD>
79    </tr>
80  <tr>
81<TD width="25%">Mipmap</TD>
82<TD width="45%">Always <CODE>GX_FALSE</CODE>.</TD>
83    </tr>
84  <tr>
85<TD width="30%"><a href="../../../gx/Texture/GXLoadTexObj.html"><code>GXLoadTexObj</code></a></TD>
86<TD width="25%">Destination texture name.</TD>
87<TD width="45%"><CODE>GX_TEXMAP0</CODE>, <CODE>GX_TEXMAP1</CODE></TD>
88    </tr>
89  <tr>
90<TD width="30%"><a href="../../../gx/Texture/GXInvalidateTexAll.html"><code>GXInvalidateTexAll</code></a></TD>
91<TD width="25%">(No parameter)</TD>
92      <TD width="45%"></TD>
93    </tr>
94  <tr>
95<TD width="30%"><a href="../../../gx/Framebuffer/GXSetTexCopySrc.html"><code>GXSetTexCopySrc</code></a></TD>
96<TD width="25%">top / left / width / height</TD>
97<TD width="45%">Only fixed size.</TD>
98    </tr>
99  <tr>
100<TD width="30%" rowspan="3"><a href="../../../gx/Framebuffer/GXSetTexCopyDst.html"><code>GXSetTexCopyDst</code></a></TD>
101<TD width="25%">Width and height</TD>
102<TD width="45%">Only fixed size.</TD>
103    </tr>
104  <tr>
105<TD width="25%">Format</TD>
106<TD width="45%">Always <CODE>GX_TF_IA4</CODE>.</TD>
107    </tr>
108  <tr>
109<TD width="25%">Mipmap filter</TD>
110<TD width="45%"><strong><FONT face="Courier New">GX_TRUE</FONT></strong></TD>
111    </tr>
112  <tr>
113<TD width="30%" rowspan="2"><a href="../../../gx/Framebuffer/GXCopyTex.html"><code>GXCopyTex</code></a></TD>
114<TD width="25%">Pointer to image data.</TD>
115<TD width="45%">Appropriate value.</TD>
116    </tr>
117  <tr>
118<TD width="25%">Clear operation</TD>
119<TD width="45%"><strong><FONT face="Courier New">GX_TRUE</FONT></strong></TD>
120    </tr>
121  <tr>
122<TD width="30%" rowspan="2"><a href="../../../gx/Framebuffer/GXSetCopyClear.html"><code>GXSetCopyClear</code></a></TD>
123<TD width="25%">Color</TD>
124<TD width="45%">Only one color.</TD>
125    </tr>
126  <tr>
127<TD width="25%">Z value</TD>
128<TD width="45%">Always 0xFFFFFF.</TD>
129    </tr>
130  <tr>
131<TD width="30%" rowspan="2"><a href="../../../gx/Tev/GXSetTevOp.html"><code>GXSetTevOp</code></a></TD>
132<TD width="25%">TEV stage ID</TD>
133<TD width="45%"><CODE>GX_TEVSTAGE0</CODE>, <CODE>GX_TEVSTAGE1</CODE>.</TD>
134    </tr>
135  <tr>
136<TD width="25%">Operation mode</TD>
137<TD width="45%"><CODE>GX_MODULATE</CODE> for stage0, <CODE>GX_DECAL</CODE> for stage1</TD>
138    </tr>
139  <tr>
140<TD width="30%" rowspan="2"><a href="../../../gx/PixelProc/GXSetPixelFmt.html"><code>GXSetPixelFmt</code></a></TD>
141<TD width="25%">Pixel Format</TD>
142<TD width="45%"><FONT face="Courier New"><CODE>GX_PF_RGBA6_Z24</CODE></FONT></TD>
143    </tr>
144  <tr>
145<TD width="25%">Z compression format</TD>
146<TD width="45%">Always <CODE>GX_ZC_LINEAR</CODE>.</TD>
147    </tr>
148  <tr>
149<TD width="30%"><a href="../../../gx/Management/GXPixModeSync.html"><code>GXPixModeSync</code></a></TD>
150<TD width="25%">(No parameter)</TD>
151      <TD width="45%"></TD>
152    </tr>
153</TABLE>
154<h2>Operation Method</h2>
155
156<P>START exits the test.</P>
157
158<P>The Control Stick moves camera position. The C Stick moves light position. The A Button starts or stops the spinning animation of the torus object.</P>
159<h2>Snapshot</h2>
160
161<P><IMG src="./images/tg-shadow.jpg" alt="tg-shadow.jpg (46270 bytes)" width="640" height="480"></p>
162
163<h2>Required Data Files</h2>
164
165<p><FONT face="Courier New">$REVOLUTION_SDK_ROOT/dvddata/gxTextrs.tpl</FONT></p>
166<H2>Revision History</H2>
167<P>03/01/2006 Initial version.</P>
168</body>
169</html>