Skip to content

Commit 9d3cf8c

Browse files
committed
Merge branch 'physical_lights' of http://github.com/bhouston/three.js into dev
# Conflicts: # src/renderers/shaders/ShaderChunk/ambient_pars.glsl
2 parents 0e76fd2 + 5815127 commit 9d3cf8c

27 files changed

Lines changed: 514 additions & 54 deletions

docs/api/lights/AmbientLight.html

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ <h2>Example</h2>
2424
<div>[example:canvas_sandbox sandbox ]</div>
2525
<div>[example:webgl_animation_cloth animation / cloth ]</div>
2626
<div>[example:webgl_animation_skinning_blending animation / skinning / blending ]</div>
27-
27+
2828
<code>var light = new THREE.AmbientLight( 0x404040 ); // soft white light
2929
scene.add( light );</code>
3030

@@ -39,19 +39,29 @@ <h3>[name]( [page:Integer hex] )</h3>
3939
This creates an Ambientlight with a color.
4040
</div>
4141

42+
<h2>Properties</h2>
43+
44+
<h3>[property:Float intensity]</h3>
45+
<div>
46+
Light's intensity.<br />
47+
In "physically correct" mode, the product of color * intensity is interpreted as luminous irradiance measured in lux at the material surface.<br/>
48+
Default — *1.0*.
49+
</div>
50+
51+
4252
<h2>Methods</h2>
43-
53+
4454
<h3>[method:AmbientLight clone]()</h3>
4555
<div>
4656
<br />
4757
It returns a clone of Ambientlight.
4858
</div>
49-
59+
5060
<h3>[method:JSON toJSON]()</h3>
5161
<div>
5262
Return Ambientlight data in JSON format.
5363
</div>
54-
64+
5565
<h2>Source</h2>
5666

5767
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]

docs/api/lights/DirectionalLight.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ <h3>[property:Object3D target]</h3>
6060
<h3>[property:Float intensity]</h3>
6161
<div>
6262
Light's intensity.<br />
63+
In "physically correct" mode, the product of intensity * color is interpreted as luminous irradiance measured in lux at the material's surface.<br/>
6364
Default — *1.0*.
6465
</div>
6566

docs/api/lights/HemisphereLight.html

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,16 @@
1313
<h1>[name]</h1>
1414

1515
<div class="desc">A light source positioned directly above the scene.</div>
16-
16+
1717
<h2>Example</h2>
18-
18+
1919
<div>[example:webgl_lights_hemisphere lights / hemisphere ]</div>
2020
<div>[example:misc_controls_pointerlock controls / pointerlock ]</div>
2121
<div>[example:webgl_decals decals ]</div>
2222
<div>[example:webgl_loader_collada_kinematics loader / collada / kinematics ]</div>
2323
<div>[example:webgl_materials_lightmap materials / lightmap ]</div>
2424
<div>[example:webgl_shaders_ocean shaders / ocean ]</div>
25-
25+
2626
<code>var light = new THREE.HemisphereLight( 0xffffbb, 0x080820, 1 );
2727
scene.add( light );</code>
2828

@@ -47,17 +47,18 @@ <h3>[property:Float groundColor]</h3>
4747
<h3>[property:Float intensity]</h3>
4848
<div>
4949
Light's intensity.<br />
50+
In "physically correct" mode, the product of intensity * color (or intensity * groundColor) is interpreted as luminous irradiance measured in lux at the material's surface.<br/>
5051
Default — *1.0*.
5152
</div>
5253

5354
<h2>Methods</h2>
54-
55+
5556
<h3>[method:HemisphereLight clone]()</h3>
5657
<div>
5758
<br />
5859
It returns a clone of HemisphereLight.
5960
</div>
60-
61+
6162
<h3>[method:JSON toJSON]()</h3>
6263
<div>
6364
Return HemisphereLight data in JSON format.

docs/api/lights/PointLight.html

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ <h2>Example</h2>
2828
<div>[example:webgl_geometry_large_mesh geometry / large / mesh ]</div>
2929
<div>[example:webgl_geometry_text geometry / text ]</div>
3030
<div>[example:webgl_lensflares lensflares ]</div>
31-
31+
3232
<code>var light = new THREE.PointLight( 0xff0000, 1, 100 );
3333
light.position.set( 50, 50, 50 );
3434
scene.add( light );</code>
@@ -46,7 +46,7 @@ <h3>[name]([page:Integer hex], [page:Float intensity], [page:Number distance], [
4646
</div>
4747
<div>
4848
Creates a light at a specific position in the scene. The light shines in all directions (roughly similar to a light bulb.)
49-
49+
5050
</div>
5151

5252

@@ -55,29 +55,38 @@ <h2>Properties</h2>
5555
<h3>[property:Float intensity]</h3>
5656
<div>
5757
Light's intensity.<br />
58+
In "physically correct" mode, the product of color * intensity is interpreted as luminous intensity measured in candela.<br/>
5859
Default - *1.0*.
5960
</div>
6061

62+
<h3>[property:Float power]</h3>
63+
<div>
64+
Light's power.<br />
65+
In "physically correct" mode, the luminous power of the light measured in lumens.<br/>
66+
Default - *4PI*.
67+
</div>
68+
6169
<h3>[property:Float distance]</h3>
6270
<div>
6371
If non-zero, light will attenuate linearly from maximum intensity at light *position* down to zero at *distance*.<br />
6472
Default — *0.0*.
6573
</div>
66-
74+
6775
<h3>[property:Float decay]</h3>
6876
<div>
6977
The amount the light dims along the distance of the light<br />
78+
In "physically correct" mode, decay = 2 leads to physically realistic light falloff.<br/>
7079
Default — *1*.
7180
</div>
72-
81+
7382
<h2>Methods</h2>
74-
83+
7584
<h3>[method:PointLight clone]()</h3>
7685
<div>
7786
<br />
7887
It returns a clone of PointLight.
7988
</div>
80-
89+
8190
<h3>[method:JSON toJSON]()</h3>
8291
<div>
8392
Return PointLight data in JSON format.

docs/api/lights/SpotLight.html

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,17 @@ <h3>[property:Object3D target]</h3>
7777
<h3>[property:Float intensity]</h3>
7878
<div>
7979
Light's intensity.<br />
80+
In "physically correct" mode, the product of color * intensity is interpreted as luminous intensity measured in candela.<br/>
8081
Default — *1.0*.
8182
</div>
8283

84+
<h3>[property:Float power]</h3>
85+
<div>
86+
Light's power.<br />
87+
In "physically correct" mode, the luminous power of the light measured in lumens.<br/>
88+
Default - *4PI*.
89+
</div>
90+
8391
<h3>[property:Float distance]</h3>
8492
<div>
8593
If non-zero, light will attenuate linearly from maximum intensity at light *position* down to zero at *distance*.<br />
@@ -101,6 +109,7 @@ <h3>[property:Float penumbra]</h3>
101109
<h3>[property:Float decay]</h3>
102110
<div>
103111
The amount the light dims along the distance of the light<br />
112+
In "physically correct" mode, decay = 2 leads to physically realistic light falloff.<br/>
104113
Default — *1*.
105114
</div>
106115

examples/files.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ var files = {
5757
"webgl_kinect",
5858
"webgl_lensflares",
5959
"webgl_lights_hemisphere",
60+
"webgl_lights_physical",
6061
"webgl_lights_pointlights",
6162
"webgl_lights_pointlights2",
6263
"webgl_lines_colors",
115 KB
Loading
404 KB
Loading
143 KB
Loading

0 commit comments

Comments
 (0)