1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 2<HTML> 3<HEAD> 4<META http-equiv="Content-Type" content="text/html; charset=windows-1252"> 5<META name="GENERATOR" content="Microsoft FrontPage 5.0"> 6<META http-equiv="Content-Style-Type" content="text/css"> 7<LINK rel="stylesheet" type="text/css" href="../../../CSS/revolution.css"> 8<TITLE>tg-shadow3</TITLE> 9</HEAD> 10<BODY> 11<H1 align="left">tg-shadow3</H1> 12 13<H2>Description</H2> 14<P>This program shows an example of complicated full-scene shadow generation. This demo uses depth buffer-based method, which can also produce self-shadowing effect. (For details, see the <a href="#Algorithm Details">Algorithm Details</a> section.)</P> 15<H2>Coverage</H2> 16<P>This list doesn't contain settings for drawing other than full-scene shadows.</P> 17<TABLE border="1" cellpadding="3" cellspacing="0.1" width="640"> 18 <TBODY> 19 <TR> 20<TD width="30%" bgcolor="#C0C0C0"><EM><STRONG>Functions</STRONG></EM></TD> 21<TD width="25%" bgcolor="#C0C0C0"><EM><STRONG>Parameters</STRONG></EM></TD> 22<TD width="45%" bgcolor="#C0C0C0"><EM><STRONG>Description</STRONG></EM></TD> 23 </TR> 24 <TR> 25<TD width="30%" rowspan="3"><A href="../../../gx/Transform/GXLoadTexMtxImm.html"><CODE>GXLoadTexMtxImm</CODE></A></TD> 26<TD width="25%">Matrices</TD> 27<TD width="45%">appropriate projection mtx</TD> 28 </TR> 29 <TR> 30<TD width="25%">matrix destination</TD> 31<TD width="45%">GX_TEXMTX0, GX_TEXMTX1</TD> 32 </TR> 33 <TR> 34<TD width="25%">Types</TD> 35<TD width="45%"><STRONG><FONT face="Courier New">GX_MTX3x4</FONT></STRONG></TD> 36 </TR> 37 <TR> 38<TD width="30%"><A href="../../../gx/TexCoordGen/GXSetNumTexGens.html"><CODE>GXSetNumTexGens</CODE></A></TD> 39<TD width="25%">number of texgens</TD> 40 <TD width="45%">2</TD> 41 </TR> 42 <TR> 43<TD width="30%" rowspan="4"><A href="../../../gx/TexCoordGen/GXSetTexCoordGen.html"><CODE>GXSetTexCoordGen</CODE></A></TD> 44<TD width="25%">destination coord</TD> 45<TD width="45%">GX_TEXCOORD0, GX_TEXCOORD1</TD> 46 </TR> 47 <TR> 48<TD width="25%">texgen type</TD> 49<TD width="45%"><STRONG><FONT face="Courier New">GX_TG_MTX3x4</FONT></STRONG></TD> 50 </TR> 51 <TR> 52<TD width="25%">texgen src</TD> 53<TD width="45%"><STRONG><FONT face="Courier New">GX_TG_POS</FONT></STRONG></TD> 54 </TR> 55 <TR> 56<TD width="25%">mtx src</TD> 57<TD width="45%">GX_TEXMTX0, GX_TEXMTX1</TD> 58 </TR> 59 <TR> 60<TD width="30%" rowspan="5"><A href="../../../gx/Texture/GXInitTexObj.html"><CODE>GXInitTexObj</CODE></A></TD> 61<TD width="25%">Pointer to image data.</TD> 62<TD width="45%">Appropriate.</TD> 63 </TR> 64 <TR> 65<TD width="25%">width / height</TD> 66<TD width="45%">some constant values</TD> 67 </TR> 68 <TR> 69<TD width="25%">Format</TD> 70<TD width="45%"><FONT face="Courier New">GX_TF_RGBA8</FONT></TD> 71 </TR> 72 <TR> 73<TD width="25%">wrap mode(s, t)</TD> 74<TD width="45%"><FONT face="Courier New">GX_CLAMP</FONT></TD> 75 </TR> 76 <TR> 77<TD width="25%">mipmap</TD> 78<TD width="45%">Always <CODE>GX_FALSE</CODE>.</TD> 79 </TR> 80 <TR> 81<TD width="30%"><A href="../../../gx/Texture/GXLoadTexObj.html"><CODE>GXLoadTexObj</CODE></A></TD> 82<TD width="25%">Destination texture name.</TD> 83<TD width="45%"><CODE>GX_TEXMAP0</CODE>, <CODE>GX_TEXMAP1</CODE></TD> 84 </TR> 85 <TR> 86<TD width="30%"><A href="../../../gx/Texture/GXInvalidateTexAll.html"><CODE>GXInvalidateTexAll</CODE></A></TD> 87<TD width="25%">(no parameter)</TD> 88 <TD width="45%"> </TD> 89 </TR> 90 <TR> 91<TD width="30%"><A href="../../../gx/Framebuffer/GXSetTexCopySrc.html"><CODE>GXSetTexCopySrc</CODE></A></TD> 92<TD width="25%">top / left / width / height</TD> 93<TD width="45%">some constant values</TD> 94 </TR> 95 <TR> 96<TD width="30%" rowspan="3"><A href="../../../gx/Framebuffer/GXSetTexCopyDst.html"><CODE>GXSetTexCopyDst</CODE></A></TD> 97<TD width="25%">width / height</TD> 98<TD width="45%">some constant values</TD> 99 </TR> 100 <TR> 101<TD width="25%">Format</TD> 102<TD width="45%"><STRONG><FONT face="Courier New">GX_TF_Z24X8</FONT></STRONG></TD> 103 </TR> 104 <TR> 105<TD width="25%">mipmap filter</TD> 106<TD width="45%"><FONT face="Courier New">GX_FALSE</FONT></TD> 107 </TR> 108 <TR> 109<TD width="30%" rowspan="2"><A href="../../../gx/Framebuffer/GXCopyTex.html"><CODE>GXCopyTex</CODE></A></TD> 110<TD width="25%">Pointer to image data.</TD> 111<TD width="45%">Appropriate.</TD> 112 </TR> 113 <TR> 114<TD width="25%">clear operation</TD> 115<TD width="45%"><STRONG><FONT face="Courier New">GX_TRUE</FONT></STRONG></TD> 116 </TR> 117 <TR> 118<TD width="30%"><A href="../../../gx/Tev/GXSetNumTevStages.html"><CODE>GXSetNumTevStages</CODE></A></TD> 119<TD width="25%">number of TEV stages</TD> 120<TD width="45%">3 (for 8bit compare mode),<br> 5 (for 16bit compare mode)</TD> 121 </TR> 122 <TR> 123<TD width="30%"><A href="../../../gx/Tev/GXSetTevOrder.html"><CODE>GXSetTevOrder</CODE></A></TD> 124<TD width="25%">each argument</TD> 125<TD width="45%"><A href="#Algorithm Details">see algorithm details</A></TD> 126 </TR> 127 <TR> 128<TD width="30%"><CODE><A href="../../../gx/Tev/GXSetTevColorIn.html">GXSetTevColorIn</A></CODE></TD> 129<TD width="25%">each argument</TD> 130<TD width="45%"><A href="#Algorithm Details">see algorithm details</A></TD> 131 </TR> 132 <TR> 133<TD width="30%"><CODE><A href="../../../gx/Tev/GXSetTevColorOp.html">GXSetTevColorOp</A></CODE></TD> 134<TD width="25%">each argument</TD> 135<TD width="45%"><A href="#Algorithm Details">see algorithm details</A></TD> 136 </TR> 137 <TR> 138<TD width="30%"><CODE><A href="../../../gx/Tev/GXSetTevAlphaIn.html">GXSetTevAlphaIn</A></CODE></TD> 139<TD width="25%">each argument</TD> 140<TD width="45%"><A href="#Algorithm Details">see algorithm details</A></TD> 141 </TR> 142 <TR> 143<TD width="30%"><CODE><A href="../../../gx/Tev/GXSetTevAlphaOp.html">GXSetTevAlphaOp</A></CODE></TD> 144<TD width="25%">each argument</TD> 145<TD width="45%"><A href="#Algorithm Details">see algorithm details</A></TD> 146 </TR> 147 <TR> 148<TD width="30%" rowspan="2"><CODE><A href="../../../gx/Tev/GXSetTevColor.html">GXSetTevColor</A></CODE></TD> 149<TD width="25%">tev color register</TD> 150<TD width="45%">GX_TEVREG0, GX_TEVREG2</TD> 151 </TR> 152 <TR> 153<TD width="25%">color value</TD> 154<TD width="45%">Appropriate.</TD> 155 </TR> 156 <TR> 157<TD width="30%"><CODE><A href="../../../gx/Culling/GXSetCullMode.html">GXSetCullMode</A></CODE></TD> 158<TD width="25%">culling mode</TD> 159<TD width="45%">GX_CULL_FRONT, GX_CULL_BACK</TD> 160 </TR> 161 <TR> 162<TD width="30%"><CODE><A href="../../../gx/PixelProc/GXSetColorUpdate.html">GXSetColorUpdate</A></CODE></TD> 163<TD width="25%">color update mode</TD> 164<TD width="45%"><font face="Courier New">GX_ENABLE</font> / <font face="Courier New">GX_DISABLE</font>.</TD> 165 </TR> 166 <TR> 167<TD width="30%"><A href="../../../gx/Management/GXPixModeSync.html"><CODE>GXPixModeSync</CODE></A></TD> 168<TD width="25%">(no parameter)</TD> 169 <TD width="45%"> </TD> 170 </TR> 171 </TBODY> 172</TABLE> 173<H2>Operation Method</H2> 174<P>The Menu button exits the test.</P> 175<P>The main stick moves camera position.<br>The sub stick moves light position.</P> 176<P>The A button changes display modes.<br>The B button switches the shadow projection type (perspective/orthographic).<br>The Y button changes the size of shadow map.</P> 177<H2>Snapshot</H2> 178<P><IMG src="./images/tg-shadow3-00.jpg" alt="tg-shadow3-00.jpg (56135 bytes)" width="640" height="480"></P> 179<H2>Required Data Files</H2> 180<P>None.</P> 181<H2><A name="Algorithm Details">Algorithm Details</A></H2> 182<P>See Section "7.1 Depth-Based Full-Scene Shadow Mapping" in "Graphics Library [Application Edition]."</P> 183<H2>Revision History</H2> 184<P>2006/03/01 Initial version.</P> 185<hr> 186<P>CONFIDENTIAL</p> 187</BODY> 188</HTML>