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 http-equiv="Content-Style-Type" content="text/css"> 6<LINK rel="stylesheet" type="text/css" href="../../../CSS/revolution.css"> 7<TITLE>tg-shadow2</TITLE> 8</HEAD> 9<BODY> 10<H1 align="left">tg-shadow2</H1> 11 12<H2>Description</H2> 13<P>This program shows an example of complicated full-scene shadow generation. This method uses object IDs to determine which parts should become shadow. (For details, see the <a href="#Algorithm Details">Algorithm Details</a> section.))</P> 14 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%"><SPAN class="argument">Matrices</SPAN></TD> 27<TD width="45%">Appropriate projection matrix.</TD> 28 </TR> 29 <TR> 30<TD width="25%"><SPAN class="argument">Matrix destination.</SPAN></TD> 31<TD width="45%"><CODE>GX_TEXMTX0</CODE></TD> 32 </TR> 33 <TR> 34<TD width="25%"><SPAN class="argument">Types</SPAN></TD> 35<TD width="45%"><STRONG><CODE>GX_MTX3x4</CODE></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%"><SPAN class="argument">number of texgens</SPAN></TD> 40 <TD width="45%">1</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%"><SPAN class="argument">Destination coordinates.</SPAN></TD> 45<TD width="45%"><CODE><font face="Courier New">GX_TEXCOORD0</font>.</CODE></TD> 46 </TR> 47 <TR> 48<TD width="25%"><SPAN class="argument">Generation type.</SPAN></TD> 49<TD width="45%"><STRONG><CODE>GX_TG_MTX3x4</CODE></STRONG></TD> 50 </TR> 51 <TR> 52<TD width="25%"><SPAN class="argument">Generation source.</SPAN></TD> 53<TD width="45%"><STRONG><CODE>GX_TG_POS</CODE></STRONG></TD> 54 </TR> 55 <TR> 56<TD width="25%"><SPAN class="argument">Matrix source.</SPAN></TD> 57<TD width="45%"><CODE>GX_TEXMTX0</CODE></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%"><SPAN class="argument">Pointer to image data.</SPAN></TD> 62<TD width="45%">Appropriate value.</TD> 63 </TR> 64 <TR> 65<TD width="25%"><SPAN class="argument">Width and height</SPAN></TD> 66<TD width="45%">Some constant values</TD> 67 </TR> 68 <TR> 69<TD width="25%"><SPAN class="argument">Format</SPAN></TD> 70<TD width="45%"><CODE>GX_TF_RGBA8</CODE></TD> 71 </TR> 72 <TR> 73<TD width="25%"><SPAN class="argument">Wrap mode (s, t).</SPAN></TD> 74<TD width="45%"><CODE>GX_CLAMP</CODE></TD> 75 </TR> 76 <TR> 77<TD width="25%"><SPAN class="argument">Mipmap</SPAN></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><CODE>GXLoadTexObj</CODE></CODE></A></TD> 82<TD width="25%"><SPAN class="argument">Destination texture name.</SPAN></TD> 83<TD width="45%"><CODE>GX_TEXMAP0</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%"><SPAN class="argument">(No parameter)</SPAN></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%"><SPAN class="argument">top / left / width / height</SPAN></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%"><SPAN class="argument">Width and height</SPAN></TD> 98<TD width="45%">Some constant values</TD> 99 </TR> 100 <TR> 101<TD width="25%"><SPAN class="argument">Format</SPAN></TD> 102<TD width="45%"><CODE>GX_TF_RGBA8</CODE></TD> 103 </TR> 104 <TR> 105<TD width="25%"><SPAN class="argument">Mipmap filter</SPAN></TD> 106<TD width="45%"><CODE><font face="Courier New">GX_FALSE</font>.</CODE></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%"><SPAN class="argument">Pointer to image data.</SPAN></TD> 111<TD width="45%">Appropriate value.</TD> 112 </TR> 113 <TR> 114<TD width="25%"><SPAN class="argument">Clear operation</SPAN></TD> 115<TD width="45%"><CODE><font face="Courier New">GX_TRUE</font>.</CODE></TD> 116 </TR> 117 <TR> 118<TD width="30%"><A href="../../../gx/Tev/GXSetNumTevStages.html"><CODE><CODE>GXSetNumTevStages</CODE></CODE></A></TD> 119<TD width="25%"><SPAN class="argument">Number of TEV Stages</SPAN></TD> 120 <TD width="45%">2</TD> 121 </TR> 122 <TR> 123<TD width="30%"><A href="../../../gx/Tev/GXSetTevOrder.html"><CODE><CODE>GXSetTevOrder</CODE></CODE></A></TD> 124<TD width="25%"><SPAN class="argument">Each argument</SPAN></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"><CODE>GXSetTevColorIn</CODE></A></CODE></TD> 129<TD width="25%"><SPAN class="argument">Each argument</SPAN></TD> 130<TD width="45%"><A href="#Algorithm Details">See algorithm details</A></TD> 131 </TR> 132 <TR> 133<TD width="30%" rowspan="2"><CODE><A href="../../../gx/Tev/GXSetTevColorOp.html"><CODE>GXSetTevColorOp</CODE></A></CODE></TD> 134<TD width="25%"><SPAN class="argument">Each argument</SPAN></TD> 135<TD width="45%"><A href="#Algorithm Details">See algorithm details</A></TD> 136 </TR> 137 <TR> 138<TD width="25%"><SPAN class="argument">clamp mode</SPAN></TD> 139<TD width="45%"><strong><CODE>GX_TC_EQ</CODE></strong>(stage0), <CODE>GX_TC_LINEAR</CODE>(stage1)<br> <a href="#Algorithm Details">See algorithm details</a></TD> 140 </TR> 141 <TR> 142<TD width="30%" rowspan="2"><CODE><A href="../../../gx/Tev/GXSetTevColor.html"><CODE>GXSetTevColor</CODE></A></CODE></TD> 143<TD width="25%"><SPAN class="argument">TEV Color Register</SPAN></TD> 144<TD width="45%"><CODE>GX_TEVREG0</CODE></TD> 145 </TR> 146 <TR> 147<TD width="25%"><SPAN class="argument">Color value</SPAN></TD> 148<TD width="45%">Appropriate value.</TD> 149 </TR> 150 <TR> 151<TD width="30%"><A href="../../../gx/Management/GXPixModeSync.html"><CODE>GXPixModeSync</CODE></A></TD> 152<TD width="25%"><SPAN class="argument">(No parameter)</SPAN></TD> 153 <TD width="45%"> </TD> 154 </TR> 155 </TBODY> 156</TABLE> 157<H2>Using the Demo</H2> 158<P>End the test with START.</P> 159<P>The main stick moves camera position.<br>The sub stick moves light position.</P> 160<P>The A Button changes display modes.<br>The B Button switches the shadow projection type (perspective/orthographic).<br>The X Button toggles the model size adjustment ON/OFF.<br>The Y Button changes the size of shadow map.</P> 161 162<H2>Snapshot</H2> 163<P><IMG src="./images/tg-shadow2-00.jpg" alt="tg-shadow2-00.jpg (29082 bytes)" width="640" height="480"></P> 164 165<H2>Required Data Files</H2> 166<P>None.</P> 167 168<H2><A name="Algorithm Details">Algorithm Details</A></H2> 169<P>See Section "7.2 ID-Based Full-Scene Shadow Mapping" in "Graphics Library [Application Edition]."</P> 170 171<H2>Revision History</H2> 172<P> 1732006/03/01 Initial version.<br> 174</P> 175 176<hr><p>CONFIDENTIAL</p></body> 177</HTML>