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-specular</title> 10</head> 11 12<body> 13 14<h1 align="left">lit-specular</h1> 15 16<h2>Description</h2> 17<P>This program does a demonstration of specular lighting. It also uses two light channels to show the overlay of diffuse and specular light colors. A specified light object for a specular light can also act as a pseudo parallel light if used in the diffuse light channel. This property is used in the demo; the same light object (<CODE>GX_LIGHT0</CODE>) is applied to both channels.</P> 18<h2>Coverage</h2> 19<TABLE border="1" cellpadding="3" cellspacing="0.1" width="640"> 20 <tr> 21<TD width="30%" bgcolor="#C0C0C0"><em><strong>Functions</strong></em></TD> 22<TD width="25%" bgcolor="#C0C0C0"><em><strong>Parameters</strong></em></TD> 23<TD width="45%" bgcolor="#C0C0C0"><em><strong>Description</strong></em></TD> 24 </tr> 25 <tr> 26<TD width="30%"><a href="../../../gx/Lighting/GXInitLightPos.html"><code>GXInitLightPos</code></a></TD> 27<TD width="25%"><SPAN class="argument">Position coordinate (x, y, z)</SPAN></TD> 28<TD width="45%">Appropriate value.</TD> 29 </tr> 30 <tr> 31<TD width="30%"><A href="../../../gx/Lighting/GXInitSpecularDir.html"><CODE>GXInitSpecularDir</CODE></A></TD> 32<TD width="25%"><SPAN class="argument">Light direction (nx, ny, nz)</SPAN></TD> 33<TD width="45%">Appropriate value.</TD> 34 </tr> 35 <tr> 36<TD width="30%"><A href="../../../gx/Lighting/GXInitLightShininess.html"><CODE>GXInitLightShininess</CODE></A></TD> 37<TD width="25%"><SPAN class="argument">Shininess parameter</SPAN></TD> 38<TD width="45%">Values ranging from 4.0 through 256.0.</TD> 39 </tr> 40 <tr> 41<TD width="30%"><a href="../../../gx/Lighting/GXSetNumChans.html"><code>GXSetNumChans</code></a></TD> 42<TD width="25%"><SPAN class="argument">Number of color channels.</SPAN></TD> 43 <TD width="45%">1, 2</TD> 44 </tr> 45 <tr> 46<TD width="30%" rowspan="7"><a href="../../../gx/Lighting/GXSetChanCtrl.html"><code>GXSetChanCtrl</code></a></TD> 47<TD width="25%"><SPAN class="argument">Color channel ID</SPAN></TD> 48<TD width="45%"><CODE>GX_COLOR0</CODE>, <CODE>GX_COLOR1</CODE></TD> 49 </tr> 50 <tr> 51<TD width="25%"><SPAN class="argument">Channel enable</SPAN></TD> 52<TD width="45%">Always <CODE>GX_ENABLE</CODE>.</TD> 53 </tr> 54 <tr> 55<TD width="25%"><SPAN class="argument">Ambient color source</SPAN></TD> 56<TD width="45%">Always <CODE>GX_SRC_REG</CODE>.</TD> 57 </tr> 58 <tr> 59<TD width="25%"><SPAN class="argument">Material color source</SPAN></TD> 60<TD width="45%">Always <CODE>GX_SRC_REG</CODE>.</TD> 61 </tr> 62 <tr> 63<TD width="25%"><SPAN class="argument">Light mask</SPAN></TD> 64<TD width="45%"><CODE>GX_LIGHT0</CODE> for both channels.</TD> 65 </tr> 66 <tr> 67<TD width="25%"><SPAN class="argument">Diffusion function</SPAN></TD> 68<TD width="45%"><CODE>GX_DF_NONE</CODE>, <CODE>GX_DF_CLAMP</CODE></TD> 69 </tr> 70 <tr> 71<TD width="25%"><SPAN class="argument">Attenuation function</SPAN></TD> 72<TD width="45%"><CODE>GX_AF_NONE</CODE>, <CODE>GX_AF_SPOT</CODE>, <CODE><strong>GX_AF_SPEC</strong></CODE></TD> 73 </tr> 74 <tr> 75<TD width="30%" rowspan="2"><a href="../../../gx/Lighting/GXSetChanAmbColor.html"><code>GXSetChanAmbColor</code></a></TD> 76<TD width="25%"><SPAN class="argument">Color channel ID</SPAN></TD> 77<TD width="45%"><CODE><strong>GX_COLOR0</strong></CODE>, <CODE><strong>GX_COLOR1</strong></CODE></TD> 78 </tr> 79 <tr> 80<TD width="25%"><SPAN class="argument">Material color</SPAN></TD> 81<TD width="45%">Only one color.</TD> 82 </tr> 83 <tr> 84<TD width="30%" rowspan="2"><a href="../../../gx/Lighting/GXSetChanMatColor.html"><code>GXSetChanMatColor</code></a></TD> 85<TD width="25%"><SPAN class="argument">Color channel ID</SPAN></TD> 86<TD width="45%"><CODE><strong>GX_COLOR0</strong></CODE>, <CODE><strong>GX_COLOR1</strong></CODE></TD> 87 </tr> 88 <tr> 89<TD width="25%"><SPAN class="argument">Material color</SPAN></TD> 90<TD width="45%">Only one color.</TD> 91 </tr> 92</TABLE> 93 94<h2>Using the Demo</h2> 95<P>End the test with START.</P> 96<P>The Control Stick moves the light.</P> 97<P>The C Stick rotates the object.</P> 98<P>The B Button changes the model.</P> 99<P>The L and R Buttons adjust the shininess of specular light.</P> 100<P>The Y button changes the display mode in the following order:<BR>Specular only, diffuse only, specular/diffuse added, specular/diffuse blended</P> 101 102<h2>Snapshot</h2> 103<p>Specular light color only.</p> 104<P><IMG src="./images/lit-specular-0.jpg" alt="lit-specular-0.jpg (4563 bytes)" width="320" height="240"></p> 105 106<P>Uses two color channels. Diffuse light color is added to specular light color.</P> 107<P><IMG src="./images/lit-specular-1.jpg" alt="lit-specular-1.jpg (5116 bytes)" width="320" height="240"></P> 108 109<h2>Required Data Files</h2> 110<p>None.</p> 111 112<H2>Revision History</H2> 113<P> 1142006/03/01 Initial version.<br> 115</P> 116 117<hr><p>CONFIDENTIAL</p></body> 118</html>