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 17 18<h2>Description</h2> 19 20<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's used to select a 1D texture line from a 2D texture map. This method can be used to perform cartoon lighting. 21</P> 22<h2>Coverage</h2> 23<TABLE border="1" cellpadding="3" cellspacing="0.1" width="640"> 24 <tr> 25<TD width="30%" bgcolor="#C0C0C0"><em><strong>Function</strong></em></TD> 26<TD width="25%" bgcolor="#C0C0C0"><em><strong>Parameters</strong></em></TD> 27<TD width="45%" bgcolor="#C0C0C0"><em><strong>Description</strong></em></TD> 28 </tr> 29 <tr> 30<TD width="30%"><a href="../../../gx/Lighting/GXInitLightPos.html"><code>GXInitLightPos</code></a></TD> 31<TD width="25%"><em><strong><font face="Courier New">Position coordinate (x, y, z)</font></strong></em></TD> 32<TD width="45%">Various values.</TD> 33 </tr> 34 <tr> 35<TD width="30%"><a href="../../../gx/Lighting/GXInitLightColor.html"><code>GXInitLightColor</code></a></TD> 36<TD width="25%"><em><strong><font face="Courier New">Light color</font></strong></em></TD> 37<TD width="45%">Appropriate value.</TD> 38 </tr> 39 <tr> 40<TD width="30%" rowspan="7"><a href="../../../gx/Lighting/GXSetChanCtrl.html"><code>GXSetChanCtrl</code></a></TD> 41<TD width="25%"><em><strong><font face="Courier New">Color channel ID</font></strong></em></TD> 42<TD width="45%">Always <font face="Courier New">GX_COLOR0A0</font>.</TD> 43 </tr> 44 <tr> 45<TD width="25%"><em><strong><font face="Courier New">Channel enable</font></strong></em></TD> 46<TD width="45%">Always <font face="Courier New">GX_ENABLE</font>.</TD> 47 </tr> 48 <tr> 49<TD width="25%"><em><strong><font face="Courier New">Ambient color source</font></strong></em></TD> 50<TD width="45%">Always register source.</TD> 51 </tr> 52 <tr> 53<TD width="25%"><em><strong><font face="Courier New">Material color source</font></strong></em></TD> 54<TD width="45%">Always register source.</TD> 55 </tr> 56 <tr> 57<TD width="25%"><em><strong><font face="Courier New">Light mask</font></strong></em></TD> 58<TD width="45%">Always <font face="Courier New">GX_LIGHT0</font>.</TD> 59 </tr> 60 <tr> 61<TD width="25%"><em><strong><font face="Courier New">Diffusion function</font></strong></em></TD> 62<TD width="45%">Always <strong><font face="Courier New">GX_DF_SIGN</font></strong>.</TD> 63 </tr> 64 <tr> 65<TD width="25%"><em><strong><font face="Courier New">Attenuation function</font></strong></em></TD> 66<TD width="45%">Always <font face="Courier New">GX_AF_NONE</font>.</TD> 67 </tr> 68 <tr> 69<TD width="30%"><a href="../../../gx/Lighting/GXSetChanAmbColor.html"><code>GXSetChanAmbColor</code></a></TD> 70<TD width="25%"><em><strong><font face="Courier New">Ambient color</font></strong></em></TD> 71<TD width="45%">Appropriate value.</TD> 72 </tr> 73 <tr> 74<TD width="30%"><a href="../../../gx/Lighting/GXSetChanMatColor.html"><code>GXSetChanMatColor</code></a></TD> 75<TD width="25%"><em><strong><font face="Courier New">Material color</font></strong></em></TD> 76<TD width="45%">Appropriate value.</TD> 77 </tr> 78 <tr> 79<TD width="30%" rowspan="4"><a href="../../TexCoordGen/GXSetTexCoordGen.html"><code>GXSetTexCoordGen</code></a></TD> 80<TD width="25%"><em><strong><font face="Courier New">Texture coordinate to be generated</font></strong></em></TD> 81<TD width="45%">Always <font face="Courier New">GX_TEXCOORD0</font>.</TD> 82 </tr> 83 <tr> 84<TD width="25%"><em><strong><font face="Courier New">Texture coordinate generation feature</font></strong></em></TD> 85<TD width="45%">Always <font face="Courier New"><strong>GX_TG_SRTG</strong></font>.</TD> 86 </tr> 87 <tr> 88<TD width="25%"><em><strong><font face="Courier New">Source</font></strong></em></TD> 89<TD width="45%">Always <font face="Courier New">GX_TG_COLOR0</font>.</TD> 90 </tr> 91 <tr> 92<TD width="25%"><em><strong><font face="Courier New">Matrices</font></strong></em></TD> 93<TD width="45%">Always <font face="Courier New">GX_IDENTITY</font>.</TD> 94 </tr> 95</TABLE> 96<h2>Operation Method</h2> 97 98<P>START exits the test.</P> 99<P>The Control Stick moves the light.<br> </P> 100<P>The C Stick rotates the model.<br> </P> 101<P>The A Button changes the model.<br> </P> 102<P>The B Button selects the 1D texture to use.<br> 103</P> 104<P>The X and Y Buttons select an item to control in the following order: Ambient, Light, Material. </P> 105<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. 106</P> 107<h2>Snapshot</h2> 108 109<P><IMG src="./images/lit-cartoon-0.jpg" alt="lit-cartoon-0.jpg (9458 bytes)" width="320" height="240"></p> 110 111<P><IMG src="./images/lit-cartoon-1.jpg" alt="lit-cartoon-1.jpg (8112 bytes)" width="320" height="240"></p> 112 113<P><IMG src="./images/lit-cartoon-2.jpg" alt="lit-cartoon-2.jpg (8998 bytes)" width="320" height="240"></p> 114 115<P><IMG src="./images/lit-cartoon-3.jpg" alt="lit-cartoon-3.jpg (11120 bytes)" width="320" height="240"></p> 116 117<h2>Required Data Files</h2> 118 119<p><font face="Courier New">$REVOLUTION_SDK_ROOT/dvddata/gxTests/lit-06.tpl</font></p> 120<H2>Revision History</H2> 121<P>2006/03/01 Initial version.</P> 122<hr> 123<P>CONFIDENTIAL</p> 124</BODY> 125</HTML>