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<LINK rel="stylesheet" type="text/css" href="../../../CSS/revolution.css">
10<title>frb-zcopy</title>
11</head>
12
13<body>
14
15<h1 align="left">frb-zcopy</h1>
16
17
18
19<h2>Description</h2>
20
21<P><CODE>frb-zcopy</CODE> is an example of the process of copying texture from the depth buffer. Z texturing is a powerful feature that attaches depth information to billboards or 2D sprites in order to generate 3D-like effects. If using texture copying from both the frame buffer and the depth buffer, generating images and Z textures at runtime is possible.&nbsp;This program uses a two-pass rendering scheme. On the first pass, it creates both image and depth textures by drawing genuine 3D objects. Therefore, the scene (resulting from the second pass) becomes more 3D-like, although everything is drawn using a billboard.</P>
22
23<h2>Coverage</h2>
24<TABLE border="1" cellpadding="3" cellspacing="0.1" width="640">
25  <tr>
26<TD bgcolor="#C0C0C0" width="30%"><em><strong>Functions</strong></em></TD>
27<TD bgcolor="#C0C0C0" width="25%"><em><strong>Parameters</strong></em></TD>
28<TD bgcolor="#C0C0C0" width="45%"><em><strong>Description</strong></em></TD>
29    </tr>
30  <tr>
31<TD width="30%"><a href="../../../gx/Framebuffer/GXSetTexCopySrc.html"><code>GXSetTexCopySrc</code></a></TD>
32<TD width="25%"><SPAN class="argument">top / left / width / height</SPAN></TD>
33<TD width="45%">Fixed.</TD>
34    </tr>
35  <tr>
36<TD rowspan="3" width="30%"><a     href="../../../gx/Framebuffer/GXSetTexCopyDst.html"><code>GXSetTexCopyDst</code></a></TD>
37<TD width="25%"><SPAN class="argument">Width and height</SPAN></TD>
38<TD width="45%">Fixed.</TD>
39    </tr>
40  <tr>
41<TD width="25%"><SPAN class="argument">Format</SPAN></TD>
42<TD width="45%"><CODE>GX_TF_RGBA8</CODE><strong> / <CODE>GX_TF_Z24X8</CODE></strong>.</TD>
43    </tr>
44  <tr>
45<TD width="25%"><SPAN class="argument">Mipmap filter</SPAN></TD>
46<TD width="45%"><CODE><font face="Courier New">GX_FALSE</font>.</CODE></TD>
47    </tr>
48  <tr>
49<TD rowspan="2" width="30%"><a href="../../../gx/Framebuffer/GXCopyTex.html"><code>GXCopyTex</code></a></TD>
50<TD width="25%"><SPAN class="argument">Image pointer.</SPAN></TD>
51<TD width="45%">Appropriate value.</TD>
52    </tr>
53  <tr>
54<TD width="25%"><SPAN class="argument">Clear operation</SPAN></TD>
55<TD width="45%"><CODE><font face="Courier New">GX_TRUE</font>.</CODE></TD>
56    </tr>
57  <tr>
58<TD rowspan="2" width="30%"><a href="../../../gx/Framebuffer/GXSetCopyClear.html"><code>GXSetCopyClear</code></a></TD>
59<TD width="25%"><SPAN class="argument">Color</SPAN></TD>
60<TD width="45%">Only one color.</TD>
61    </tr>
62  <tr>
63<TD width="25%"><SPAN class="argument">Z value</SPAN></TD>
64<TD width="45%">Always 0xFFFFFF.</TD>
65    </tr>
66  <tr>
67<TD rowspan="5" width="30%"><a href="../../../gx/Texture/GXInitTexObj.html"><code>GXInitTexObj</code></a></TD>
68<TD width="25%"><SPAN class="argument">Image pointer.</SPAN></TD>
69<TD width="45%">Appropriate value.</TD>
70    </tr>
71  <tr>
72<TD width="25%"><SPAN class="argument">Width and height</SPAN></TD>
73<TD width="45%">Fixed.</TD>
74    </tr>
75  <tr>
76<TD width="25%"><SPAN class="argument">Format</SPAN></TD>
77<TD width="45%"><CODE>GX_TF_RGBA8</CODE> / <CODE>GX_TF_Z24X8</CODE>.</TD>
78    </tr>
79  <tr>
80<TD width="25%"><SPAN class="argument">Wrap mode (s, t).</SPAN></TD>
81<TD width="45%"><CODE>GX_REPEAT</CODE></TD>
82    </tr>
83  <tr>
84<TD width="25%"><SPAN class="argument">Mipmap</SPAN></TD>
85<TD width="45%">Always <CODE>GX_FALSE</CODE>.</TD>
86    </tr>
87  <tr>
88<TD width="30%"><a href="../../../gx/Texture/GXLoadTexObj.html"><code><CODE>GXLoadTexObj</CODE></code></a></TD>
89<TD width="25%"><SPAN class="argument">Destination texture name.</SPAN></TD>
90<TD width="45%"><CODE>GX_TEXMAP0</CODE> / <CODE>GX_TEXMAP1</CODE>.</TD>
91    </tr>
92  <tr>
93<TD width="30%"><a href="../../../gx/Texture/GXInvalidateTexAll.html"><code>GXInvalidateTexAll</code></a></TD>
94<TD width="25%">None.</TD>
95      <TD width="45%"> </TD>
96    </tr>
97  <tr>
98<TD rowspan="3" width="30%"><code><a href="../../../gx/Tev/GXSetZTexture.html">GXSetZTexture</a></code></TD>
99<TD width="25%"><SPAN class="argument">Operations</SPAN></TD>
100<TD width="45%">Always <CODE>GX_ZT_ADD</CODE>.</TD>
101    </tr>
102  <tr>
103<TD width="25%"><SPAN class="argument">Format</SPAN></TD>
104<TD width="45%"><CODE>GX_TF_Z24X8</CODE></TD>
105    </tr>
106  <tr>
107<TD width="25%"><SPAN class="argument">bias</SPAN></TD>
108<TD width="45%">Fixed.</TD>
109    </tr>
110  <tr>
111<TD width="30%"><a href="../../../gx/Management/GXSetDrawSync.html"><code>GXSetDrawSync</code></a></TD>
112<TD width="25%"><SPAN class="argument">token number</SPAN></TD>
113<TD width="45%">Counts up in every frame.</TD>
114    </tr>
115  <tr>
116<TD width="30%"><a href="../../../gx/Management/GXReadDrawSync.html"><code>GXReadDrawSync</code></a></TD>
117<TD width="25%">None.</TD>
118      <TD width="45%"> </TD>
119    </tr>
120</TABLE>
121
122<h2>Using the Demo</h2>
123<P>PAUSE exits the test.</P>
124<P>The Control stick moves camera position.</P>
125
126<h2>Snapshot</h2>
127<P><IMG src="./images/frb-zcopy.jpg" alt="frb-zcopy.jpg (10907 bytes)" WIDTH="640" HEIGHT="480"></p>
128
129<h2>Required Data Files</h2>
130<p>None.</p>
131
132<H2>Revision History</H2>
133<P>
1342006/03/01 Initial version.<br>
135</P>
136
137<hr><p>CONFIDENTIAL</p></body>
138</html>