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>GXInitLightSpot</TITLE>
9</HEAD>
10<BODY>
11<H1 align="left">GXInitLightSpot</H1>
12
13<H2>Syntax</H2>
14<dl><dd><pre class="construction">
15#include &lt;revolution/gx.h&gt;
16
17void GXInitLightSpot(
18    <A href="../Structures/GXLightObj.html">GXLightObj</A>* lt_obj,
19    f32         cutoff,
20    <A href="../Enumerated_Types/GXSpotFn.html">GXSpotFn</A>    spot_func );
21</pre></dd></dl>
22
23<H2>Arguments</H2>
24<TABLE class="arguments" border="1" >
25  <TBODY>
26    <TR>
27      <TH>lt_obj</TH>
28      <TD>Pointer to a light object.</TD>
29    </TR>
30    <TR>
31      <TH>cutoff</TH>
32      <TD>Spotlight cutoff angle (in degrees).0 &lt; <SPAN class="argument">cutoff</SPAN> &lt;= 90.</TD>
33    </TR>
34    <TR>
35      <TH>spot_func</TH>
36      <TD>Types of light volume distribution functions. Accepted values are:<BR>
37      <TABLE class="arguments" border="1" >
38          <tr>
39            <TD bgcolor="#C0C0C0">Name</TD>
40            <TD bgcolor="#C0C0C0">Spot (Angular Attenuation) Function Types</TD>
41          </tr>
42          <tr>
43            <TH>GX_SP_OFF</TH>
44            <TD>No attenuation.</TD>
45          </tr>
46          <tr>
47            <TH>GX_SP_FLAT</TH>
48            <TD rowspan="6">See the figures below.</TD>
49          </tr>
50          <tr>
51            <TH>GX_SP_COS</TH>
52          </tr>
53          <tr>
54            <TH>GX_SP_COS2</TH>
55          </tr>
56          <tr>
57            <TH>GX_SP_SHARP</TH>
58          </tr>
59          <tr>
60            <TH>GX_SP_RING1</TH>
61          </tr>
62          <tr>
63            <TH>GX_SP_RING2</TH>
64          </tr>
65      </TABLE>
66      </TD>
67    </TR>
68  </TBODY>
69</TABLE>
70
71<H2>Return Values</H2>
72<P>None.</P>
73
74<H2>Description</H2>
75<P>This function sets coefficients for angular (spotlight) attenuation in light objects. This can be also set with the <A href="GXInitLightAttn.html"><CODE>GXInitLightAttn</CODE></A> function. This function uses two easy-to-control parameters instead of <SPAN class="argument">a0</SPAN>, <SPAN class="argument">a1</SPAN>, and <SPAN class="argument">a2</SPAN>, which are used by the <A href="GXInitLightAttn.html"><CODE>GXInitLightAttn</CODE></A> function.</P>
76<P>The <SPAN class="argument">cutoff</SPAN> argument specifies the spotlight's cutoff angle in degrees. The spotlight works when the angle between the ray for a vertex and the light direction given by the <a href="GXInitLightDir.html"><code>GXInitLightDir</code></a> function is smaller than this cutoff angle. The value used for <SPAN class="argument">cutoff</SPAN> should be 0 &lt; <SPAN class="argument">cutoff</SPAN> &lt;= 90.0. Otherwise, the given light object doesn't become a spotlight. (Some spotlight types require tighter range.)&nbsp;</P>
77<P>The <SPAN class="argument">spot_func</SPAN> argument defines the type of the illumination distribution to be used within the cutoff angle. The following graphs show the curves of the distribution functions given by acceptable values for <SPAN class="argument">spot_func</SPAN>. The value <CODE>GX_SP_OFF</CODE> turns the spotlight feature off even if the color channel setting uses <CODE>GX_AF_SPOT</CODE> (see the <A href="GXSetChanCtrl.html"><CODE>GXSetChanCtrl</CODE></A> function).</P>
78<DIV align="center">
79<CENTER>
80<table border="1" cellpadding="3" cellspacing="0" width="474">
81
82    <tr>
83      <td width="168" align="center">Graph</td>
84      <td width="144" align="center">
85      <IMG src="SpotFn1.gif" alt="SpotFn1.gif (1403 bytes)" width="128" height="128"></td>
86      <td width="141" align="center">
87      <IMG src="SpotFn2.gif" alt="SpotFn2.gif (1457 bytes)" width="128" height="128"></td>
88      <td width="166" align="center">
89      <IMG src="SpotFn3.gif" alt="SpotFn3.gif (1465 bytes)" width="128" height="128"></td>
90    </tr>
91    <tr>
92      <td width="168" align="center">Type</td>
93      <td width="144" align="center"><code>GX_SP_FLAT</code></td>
94      <td width="141" align="center"><code>GX_SP_COS</code></td>
95      <td width="166" align="center"><code>GX_SP_COS2</code></td>
96    </tr>
97    <tr>
98      <td width="168" align="center">Valid Range</td>
99      <td width="144" align="center">0 &lt; <SPAN class="argument">cutoff</SPAN> &lt;= 90</td>
100      <td width="141" align="center">0 &lt; <SPAN class="argument">cutoff</SPAN> &lt;= 90</td>
101      <td width="166" align="center">0 &lt; <SPAN class="argument">cutoff</SPAN> &lt;= 90</td>
102    </tr>
103    <tr>
104      <td width="168" align="center">Graph</td>
105      <td width="144" align="center">
106      <IMG src="SpotFn4.gif" alt="SpotFn4.gif (1460 bytes)" width="128" height="128"></td>
107      <td width="141" align="center">
108      <IMG src="SpotFn5.gif" alt="SpotFn5.gif (1554 bytes)" width="128" height="128"></td>
109      <td width="166" align="center">
110      <IMG src="SpotFn6.gif" alt="SpotFn6.gif (1557 bytes)" width="128" height="128"></td>
111    </tr>
112    <tr>
113      <td width="168" align="center">Type</td>
114      <td width="144" align="center"><code>GX_SP_SHARP</code></td>
115      <td width="141" align="center"><code>GX_SP_RING1</code></td>
116      <td width="166" align="center"><code>GX_SP_RING2</code></td>
117    </tr>
118    <tr>
119      <td width="168" align="center">Valid Range</td>
120      <td width="144" align="center">30 &lt; <SPAN class="argument">cutoff</SPAN> &lt;= 90</td>
121      <td width="141" align="center">30 &lt; <SPAN class="argument">cutoff</SPAN> &lt;= 90</td>
122      <td width="166" align="center">30 &lt; <SPAN class="argument">cutoff</SPAN> &lt;= 90</td>
123    </tr>
124
125</table>
126</CENTER>
127</DIV>
128<P>This function can generate only some kinds of simple spotlights. For more flexible control, use the <A href="GXInitLightAttn.html"><CODE>GXInitLightAttn</CODE></A> function and calculate the appropriate coefficients.</P>
129<P>This function sets parameters only for angular attenuation. Parameters for distance attenuation may be set using the <A href="GXInitLightDistAttn.html"><CODE>GXInitLightDistAttn</CODE></A> or <A href="GXInitLightAttnK.html"><CODE>GXInitLightAttnK</CODE></A> function.</P>
130<P>This function does not load any hardware registers directly.&nbsp;To load a light object into a hardware light, use the <a href="GXLoadLightObjImm.html"><code>GXLoadLightObjImm</code></a> or <a href="GXLoadLightObjIndx.html"><code>GXLoadLightObjIndx</code></a> function.</P>
131
132<H2>See Also</H2>
133<P class="reference">
134<A href="GXInitLightAttn.html">GXInitLightAttn</A>,
135<A href="GXInitLightAttnA.html">GXInitLightAttnA</A>,
136<A href="GXInitLightAttnK.html">GXInitLightAttnK</A>,
137<A href="GXInitLightDistAttn.html">GXInitLightDistAttn</A>,
138<A href="GXLightObjInitFlow.html">GXLightObj Initialization Flow</A>
139</P>
140
141<H2>Revision History</H2>
142<P>
1432006/03/01 Initial version.<br>
144</P>
145
146<hr><p>CONFIDENTIAL</p></body>
147</HTML>