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>lit-cartoon</title> 10</head> 11 12<body> 13 14<h1 align="left">lit-cartoon</h1> 15 16<h2>Description</h2> 17<P>This program tests texture coordinate generation with an unclamped diffuse function. The red component of lit color on each vertex is used to generate a coordinate for looking up a 1D texture map. The second texture coordinate can be generated by the green component; it is used to select a 1D texture line from a 2D texture map. This method can be used to express cel-shaded lighting (cartoon lighting). 18</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%"><a href="../../../gx/Lighting/GXInitLightPos.html"><code>GXInitLightPos</code></a></TD> 29<TD width="25%"><SPAN class="argument">Position coordinate (x, y, z)</SPAN></TD> 30<TD width="45%">Various values.</TD> 31 </tr> 32 <tr> 33<TD width="30%"><a href="../../../gx/Lighting/GXInitLightColor.html"><code>GXInitLightColor</code></a></TD> 34<TD width="25%"><SPAN class="argument">Light color</SPAN></TD> 35<TD width="45%">Appropriate value.</TD> 36 </tr> 37 <tr> 38<TD width="30%" rowspan="7"><a href="../../../gx/Lighting/GXSetChanCtrl.html"><code>GXSetChanCtrl</code></a></TD> 39<TD width="25%"><SPAN class="argument">Color channel ID</SPAN></TD> 40<TD width="45%">Always <CODE>GX_COLOR0A0</CODE>.</TD> 41 </tr> 42 <tr> 43<TD width="25%"><SPAN class="argument">Channel enable</SPAN></TD> 44<TD width="45%">Always <CODE>GX_ENABLE</CODE>.</TD> 45 </tr> 46 <tr> 47<TD width="25%"><SPAN class="argument">Ambient color source</SPAN></TD> 48<TD width="45%">Always register source.</TD> 49 </tr> 50 <tr> 51<TD width="25%"><SPAN class="argument">Material color source</SPAN></TD> 52<TD width="45%">Always register source.</TD> 53 </tr> 54 <tr> 55<TD width="25%"><SPAN class="argument">Light mask</SPAN></TD> 56<TD width="45%">Always <CODE>GX_LIGHT0</CODE>.</TD> 57 </tr> 58 <tr> 59<TD width="25%"><SPAN class="argument">Diffusion function</SPAN></TD> 60<TD width="45%">Always <strong><CODE>GX_DF_SIGN</CODE></strong>.</TD> 61 </tr> 62 <tr> 63<TD width="25%"><SPAN class="argument">Attenuation function</SPAN></TD> 64<TD width="45%">Always <CODE>GX_AF_NONE</CODE>.</TD> 65 </tr> 66 <tr> 67<TD width="30%"><a href="../../../gx/Lighting/GXSetChanAmbColor.html"><code>GXSetChanAmbColor</code></a></TD> 68<TD width="25%"><SPAN class="argument">Ambient color</SPAN></TD> 69<TD width="45%">Appropriate value.</TD> 70 </tr> 71 <tr> 72<TD width="30%"><a href="../../../gx/Lighting/GXSetChanMatColor.html"><code>GXSetChanMatColor</code></a></TD> 73<TD width="25%"><SPAN class="argument">Material color</SPAN></TD> 74<TD width="45%">Appropriate value.</TD> 75 </tr> 76 <tr> 77<TD width="30%" rowspan="4"><a href="../../TexCoordGen/GXSetTexCoordGen.html"><code>GXSetTexCoordGen</code></a></TD> 78<TD width="25%"><SPAN class="argument">Texture coordinate to be generated</SPAN></TD> 79<TD width="45%">Always <CODE>GX_TEXCOORD0</CODE>.</TD> 80 </tr> 81 <tr> 82<TD width="25%"><SPAN class="argument">Texture coordinate generation feature</SPAN></TD> 83<TD width="45%">Always <CODE><strong>GX_TG_SRTG</strong></CODE>.</TD> 84 </tr> 85 <tr> 86<TD width="25%"><SPAN class="argument">Source</SPAN></TD> 87<TD width="45%">Always <CODE>GX_TG_COLOR0</CODE>.</TD> 88 </tr> 89 <tr> 90<TD width="25%"><SPAN class="argument">Matrix</SPAN></TD> 91<TD width="45%">Always <CODE>GX_IDENTITY</CODE>.</TD> 92 </tr> 93</TABLE> 94 95<h2>Using the Demo</h2> 96<P>START exits the test.</P> 97<P>The Control Stick moves the light. </P> 98<P>The C Stick rotates the model. </P> 99<P>The A button changes the model. </P> 100<P>The B button selects the 1D texture to use.</P> 101<P>The X and Y buttons select an item to control in the following order:<BR>Ambient, Light, Material. </P> 102<P>The L and R buttons change the brightness value of the selected item. This value is used only as the red value of the selected item.</P> 103 104<h2>Snapshot</h2> 105<P><IMG src="./images/lit-cartoon-0.jpg" alt="lit-cartoon-0.jpg (9458 bytes)" width="320" height="240"></p> 106 107<P><IMG src="./images/lit-cartoon-1.jpg" alt="lit-cartoon-1.jpg (8112 bytes)" width="320" height="240"></p> 108 109<P><IMG src="./images/lit-cartoon-2.jpg" alt="lit-cartoon-2.jpg (8998 bytes)" width="320" height="240"></p> 110 111<P><IMG src="./images/lit-cartoon-3.jpg" alt="lit-cartoon-3.jpg (11120 bytes)" width="320" height="240"></p> 112 113<h2>Required Data Files</h2> 114<p><CODE>$REVOLUTION_SDK_ROOT/dvddata/gxTests/lit-06.tpl</CODE></p> 115 116<H2>Revision History</H2> 117<P> 1182006/03/01 Initial version.<br> 119</P> 120 121<hr><p>CONFIDENTIAL</p></body> 122</html>