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