1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US"><!-- InstanceBegin template="/Templates/default_template.dwt" codeOutsideHTMLIsLocked="false" -->
3<head>
4<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5<meta http-equiv="Content-Style-Type" content="text/css" />
6<!-- InstanceBeginEditable name="CSS の相対パス指定" -->
7<link href="../../../../common/manual.css" rel="stylesheet" type="text/css" />
8<!-- InstanceEndEditable --> <!-- InstanceBeginEditable name="ページのタイトル" -->
9<title>Fragment lighting</title>
10<!-- InstanceEndEditable -->
11</head>
12<body>
13<div>
14  <div class="body"> <!-- InstanceBeginEditable name="本文のタイトル" -->
15  <h1>Fragment lighting</h1>
16  <!-- InstanceEndEditable --> <!-- InstanceBeginEditable name="本文" -->
17  <p>This section describes fragment lighting.</p>
18  <h2>What is Fragment Lighting?</h2>
19  <!-- #BeginLibraryItem "/Library/glossary_fragment_lighting.lbi" --> <!-- フラグメントライティング ( fragment_lighting ) -->
20  <p><em>Fragment lighting</em> is a process that applies shadows on a per-fragment basis to information output from the vertex process. More complex lighting expressions are possible using lookup tables.</p>
21  <p>The figure below shows shading applied to fragments for interpolated normal vectors provided as input values from the vertex shader. The quality of the lighting result is not affected by the polygon density.</p>
22  <img class="user_guide_chart" src="../../material_pipeline/assets/material_pipeline_fragmentshader.png" alt="Fragment shader flow"/><!-- #EndLibraryItem -->
23  <p>The following figure shows the process flow up to the output of the primary color and secondary color that results from performing lighting calculations with the settings made for lights and materials based on the information input from the vertex process.</p>
24  <img class="user_guide_chart" src="assets/fragment_lighting_light_color.png" alt="Fragment lighting"/>
25  <h2>Primary Color and Secondary Color</h2>
26  <p>When using fragment lighting, lighting calculations are performed by taking information from the vertex shader as input values. The result is output as two types of color information: <em>primary color</em> and <em>secondary color</em></p>
27  <h3>Primary color</h3>
28  <p><em>Primary color</em> refers to the <em>ambient</em> and <em>diffuse</em> components resulting from polygon model lighting.</p>
29  <!-- アンビエント ( ambient ) -->
30  <p><em>Ambient</em> refers to the color used for shadows when light strikes an object. This is used to express the light reflected off other objects and light coming around the shaded side of an object. This is also called <I>environmental light</I>.</p>
31  <!-- ディフューズ ( diffuse ) -->
32  <p><em>Diffuse</em> refers to the color of an object surface that changes due to the intensity and angle of incidence of light as it strikes the object.<em>拡散光</em>とも呼ばれます。</p>
33  <h3>Secondary color</h3>
34  <p><em>Secondary color</em> refers to the <em>specular</em> component resulting from polygon model lighting. A lookup table can be used to calculate specular light.</p>
35  <!-- スペキュラー ( specular )-->
36  <p><em>Specular</em> is the highlight seen on shiny objects when illuminated. By using lookup tables you can express a range of effects, for example showing weak light as spreading and strong light as concentrated in a small point.<br /> This is also called <em>surface reflected light</em>.</p>
37  <!-- #BeginLibraryItem "/Library/glossary_lookup_tables.lbi" --> <!-- 参照テーブル ( lookup_tables ) -->
38  <p><em>Lookup tables</em> represent curves for which input and output has been set. Output values are pre-set for 256 input values. Tables are then used to calculate lighting or fog.</p>
39  <p>The figure below shows how a lookup table works.</p>
40  <img class="user_guide_chart" src="../../lookup_tables/assets/lookup_tables_mechanism.png" alt="Lookup tables"/>
41  <p></p>
42  <!-- #EndLibraryItem --><a name="fragment_lighting" id="fragment_lighting"></a>
43<h2>Fragment Lighting Settings</h2>
44  <p>This section describes settings for lights and materials when performing per-fragment lighting.</p>
45  <h3>Light Settings</h3>
46  <p>The table below lists the items which can  be set for each  type of light.</p>
47  <table>
48    <thead>
49      <tr>
50        <th>Category</th>
51        <th>Item</th>
52        <th>Description</th>
53      </tr>
54    </thead>
55    <tbody>
56      <tr>
57        <th rowspan="4" class="bgcolor_g">Light color</th>
58        <th>Ambient color <br />(environment light)</th>
59        <td>The color and alpha values for the light that will effect the ambient color of the material. Set with Fragment lighting.</td>
60      </tr>
61      <tr>
62        <th>Diffuse color <br />(scattered light)</th>
63        <td>The color and alpha values for the light that will effect the diffuse color of the material. Set with Fragment lighting.</td>
64      </tr>
65      <tr>
66        <th>Specular color 0<br /> (surface reflected light 0)</th>
67        <td>The color and alpha values for the light that will effect the specular color 0 of the material. Set with Fragment lighting.</td>
68      </tr>
69      <tr>
70        <th>Specular color 1<br /> (surface reflected light 1)</th>
71        <td>The color and alpha values for the light that will effect the specular color 1 of the material. Set with Fragment lighting.</td>
72      </tr>
73      <tr>
74        <th rowspan="2" class="bgcolor_y">Light orientation</th>
75        <th>Position</th>
76        <td>The light position. For fragment lighting, this is set in the world coordinate system.</td>
77      </tr>
78      <tr>
79        <th>Direction</th>
80        <td>The light direction. For fragment lighting, this is set in the world coordinate system. By combining the nodes and hierarchies of animations you can inherit values from the top level.</td>
81      </tr>
82      <tr>
83        <th rowspan="2" class="bgcolor_r">Light attenuation factors</th>
84        <th>Distance attenuation</th>
85        <td>Specifies how far the light will reach in terms of an attenuation rate Used for point lights and spotlights.</td>
86      </tr>
87      <tr>
88        <th>Spotlight attenuation</th>
89        <td>Specifies how wide the light will reach in terms of an attenuation rate using a lookup table Used for spotlights.</td>
90      </tr>
91      <tr>
92        <th class="bgcolor_b">Highlight adjustments </th>
93        <th>Geometric factor</th>
94        <td>Adjusts how specular is entered. Enabled/disabled depending on the material settings.</td>
95      </tr>
96    </tbody>
97  </table>
98  <h4>Type of usable lights</h4>
99  <p>The figure below depicts the kinds of lights that can be used for fragment lighting, and how light spreads from each kind of light.</p>
100  <!-- #BeginLibraryItem "/Library/performance_fragment_lighting.lbi" --> <!-- フラグメントライティングの処理負荷 ( performance_fragment_lighting ) -->
101  <p>The more lights you use, the greater the processing load for that fragment.</p>
102  <!-- #EndLibraryItem --><img class="user_guide_chart" src="assets/fragment_lighting_light_type.png" alt="Light Types"/>
103  <h4>Ambient light</h4>
104  <p><I>Ambient light </I>is light that shines evenly on the entire polygon model. For this reason, the light has no parameters for items like direction and attenuation.</p>
105  <h3>Material Settings</h3>
106  <p>The table below lists parameters that can be set for each material.</p>
107  <table>
108    <thead>
109      <tr>
110        <th>Category</th>
111        <th>Item</th>
112        <th>Description</th>
113      </tr>
114    </thead>
115    <tbody>
116      <tr>
117        <th rowspan="5" class="bgcolor_g">Material color</th>
118        <th>Emissive color<br /></th>
119        <td>The overall color illuminating the object. This is set in a material.</td>
120      </tr>
121      <tr>
122        <th>Ambient color <br /></th>
123        <td>Color expressing the shaded side of the object. This is set in a material.</td>
124      </tr>
125      <tr>
126        <th>Diffuse color <br /></th>
127        <td>Color expressing the surface &quot;feel&quot; of the object. This is set in a material.</td>
128      </tr>
129      <tr>
130        <th>Specular color 0<br /></th>
131        <td>Color expressing object highlights.  This is set in a material.</td>
132      </tr>
133      <tr>
134        <th>Specular color 1<br /></th>
135        <td>Color expressing object highlights.  This is set in a material.</td>
136      </tr>
137      <tr>
138        <th class="bgcolor_y">Environment light of entire scene</th>
139        <th>Global ambient color</th>
140        <td>Color expressing the ambient light that is blending of all objects in the scene. Set in a fragment light.</td>
141      </tr>
142      <tr>
143        <th rowspan="4"  class="bgcolor_r">Light Controls</th>
144        <th>Distribution 0</th>
145        <td>Uses lookup table to control highlight shape of Specular color 0.</td>
146      </tr>
147      <tr>
148        <th>Distribution 1</th>
149        <td>Uses lookup table to control highlight shape of Specular color 1.</td>
150      </tr>
151      <tr>
152        <th>Reflection</th>
153        <td>Uses lookup table to control the RGB color components of specular color.</td>
154      </tr>
155      <tr>
156        <th>Fresnel</th>
157        <td>Uses lookup table to control the Alpha component of specular.</td>
158      </tr>
159    </tbody>
160  </table>
161  <h4>Material color</h4>
162  <p><em>Material color</em> refers to the polygon model color required for fragment lighting calculations. Five colors can be set.</p>
163  <p>The figure below shows the position of each material color when light is shined on a spherical model from the upper-left direction.</p>
164  <img class="user_guide_chart" src="assets/fragment_lighting_material_color.png" alt="マテリアルカラーの部位"/> <a name="geometric_factor" id="geometric_factor"></a>
165  <h4>Geometric factor</h4>
166  <p><em>Geometric factor</em> is a feature for adjusting how the specular appears. Using this feature, specular can be made to appear weak when it comes from the front of the view direction, and strong when it comes from the side.<br /> Geometric factor 0 affects Specular color 0, while Geometric factor 1 affects Specular color 1.</p>
167  <p>In the figure below, the changing position of light is used to explain the difference in appearance when the Geometric factor feature is applied.</p>
168  <img class="user_guide_chart" src="assets/fragment_lighting_geometric_factor.png" alt="Geometric factor"/> <a name="distribution" id="distribution"></a>
169  <h4>Distribution (The shape of the specular component)</h4>
170  <p><em>Distribution</em> is the element used to apply changes to the shape of the specular as a secondary color calculation.  A lookup table is used to set the distribution.<br /> Distribution 0 affects Specular color 0, while Distribution 1 affects Specular color 1. </p>
171  <p>The following figure shows how the specular shape is controlled using a lookup table.</p>
172  <img class="user_guide_chart" src="assets/fragment_lighting_distribution.png" alt="Distribution"/> <a name="reflection" id="reflection"></a>
173  <h4>Reflection</h4>
174  <p><em>Reflection</em> is the element used to control the specular color as a secondary color calculation. A lookup table is used to set reflection.</p>
175  <p>The following figure shows how the specular color is controlled using a lookup table.</p>
176  <img class="user_guide_chart" src="assets/fragment_lighting_reflection.png" alt="Reflection"/>
177  <h4>Fresnel</h4>
178  <p><em>Fresnel</em> is an element used to control material transparency (alpha value) as a secondary color calculation. A lookup table is used to set Fresnel.</p>
179  <p>The following figure shows an expression using Fresnel.</p>
180  <img class="user_guide_chart" src="assets/fragment_lighting_fresnel.png" alt="Fresnel"/>
181  <h2>Fragment Lighting Formula</h2>
182  <p>This section describes the formula used when performing fragment lighting.<br /> Fragment lighting performs lighting calculations separately for the primary color and secondary color.</p>
183  <h4>Primary color</h4>
184<p>The figure below depicts the flow of the calculation for the primary color. The influence of emissive color and global ambient color are output even if light has not been configured.  </p>
185<p><img class="user_guide_chart" src="assets/fragment_lighting_primary_color.png" alt="Formula for primary color "/>  </p>
186<p> </p>
187<h4>Secondary color</h4>
188<p>The figure below depicts the flow of the calculation for the secondary color. The formula for the secondary color is comprised solely of the influences of the specular of each light.<br /> If light has not been configured, the secondary color is always 0 (black color). The formula for secondary color is shown below. </p>
189<p><img class="user_guide_chart" src="assets/fragment_lighting_secondary_color.png" alt="Formula for secondary color"/></p>
190  <!-- InstanceEndEditable --> </div>
191  <div class="footer" />
192</div>
193<hr><p>CONFIDENTIAL</p></body>
194<!-- InstanceEnd --></html>
195