diff --git a/docs/api/lights/RectAreaLight.html b/docs/api/lights/RectAreaLight.html
index a8fa3f9b3f9680d0e5184f54578bca443eb42685..7ad232112d33815317c48a79cfa1b58537091fb1 100644
--- a/docs/api/lights/RectAreaLight.html
+++ b/docs/api/lights/RectAreaLight.html
@@ -13,27 +13,25 @@
[name]
- This light gets emitted uniformly across the face a rectangular plane. This can be
- used to simulate things like bright windows or strip lighting.
-
- NOTE: this class is currently under active development and is probably not
- production ready yet (as of r83). Check back in a month or two! And feel free to try it out in the meantime.
+ RectAreaLight emits light uniformly across the face a rectangular plane. This light type can be
+ used to simulate light sources such as bright windows or strip lighting.
+ RectAreaLight does not support shadows.
-
Examples
[example:webgl_lights_rectarealight WebGL / rectarealight ]
-var width = 2;
+var width = 10;
var height = 10;
-var rectLight = new THREE.RectAreaLight( 0xffffff, undefined, width, height );
-rectLight.intensity = 70.0;
+var intensity = 1;
+var rectLight = new THREE.RectAreaLight( 0xffffff, intensity, width, height );
rectLight.position.set( 5, 5, 0 );
+rectLight.lookAt( 0, 0, 0 );
scene.add( rectLight )
rectLightHelper = new THREE.RectAreaLightHelper( rectLight );
@@ -43,16 +41,13 @@ scene.add( rectLightHelper );
-
-
-
Constructor
[name]( [page:Integer color], [page:Float intensity], [page:Float width], [page:Float height] )
[page:Integer color] - (optional) hexadecimal color of the light. Default is 0xffffff (white).
- [page:Float intensity] - (optional) numeric value of the light's strength/intensity. Default is 1.
+ [page:Float intensity] - (optional) the light's intensity, or brightness. Default is 1.
[page:Float width] - (optional) width of the light. Default is 10.
[page:Float height] - (optional) height of the light. Default is 10.
@@ -64,29 +59,6 @@ scene.add( rectLightHelper );
See the base [page:Light Light] class for common properties.
-
- [property:Boolean castShadow]
-
- Note: this is not yet implemented for this light type! (r83)
-
-
- [property:Float decay]
-
- The amount the light dims along the distance of the light.
- In [page:WebGLRenderer.physicallyCorrectLights physically correct] mode, decay = 2 leads to
- physically realistic light falloff. The default is *1*.
-
- Note: this is not yet implemented for this light type! (r83)
-
-
- [property:Float distance]
-
- If non-zero, light will attenuate linearly from maximum intensity at the light's
- position down to zero at this distance from the light. Default is *0.0*.
-
- Note: this is not yet implemented for this light type! (r83)
-
-
[property:Boolean isRectAreaLight]
Used to check whether this or derived classes are RectAreaLights. Default is *true*.
@@ -94,37 +66,6 @@ scene.add( rectLightHelper );
You should not change this, as it used internally for optimisation.
- [property:Vector3 position]
-
- This is set equal to [page:Object3D.DefaultUp] (0, 1, 0), so that the light shines from the top down.
-
-
- [property:Object3D target]
-
- The RectAreaLight points from its [page:.position position] to target.position. The default
- position of the target is *(0, 0, 0)*.
-
- *Note*: For the the target's position to be changed to anything other than the default,
- it must be added to the [page:Scene scene] using
-
- scene.add( light.target );
-
-
- This is so that the target's [page:Object3D.matrixWorld matrixWorld] gets automatically
- updated each frame.
-
- It is also possible to set the target to be another object in the scene (anything with a
- [page:Object3D.position position] property), like so:
-
-var targetObject = new THREE.Object3D();
-scene.add(targetObject);
-
-light.target = targetObject;
-
- The RectAreaLight will now track the target object.
-
-
-
Methods
See the base [page:Light Light] class for common methods.
diff --git a/examples/webgl_lights_rectarealight.html b/examples/webgl_lights_rectarealight.html
index 172e3a66563ed55a04248a2cee6d3f0064275b1e..573cc9f77e7252faa753994fc050c2299dbe148e 100644
--- a/examples/webgl_lights_rectarealight.html
+++ b/examples/webgl_lights_rectarealight.html
@@ -125,16 +125,12 @@
camera.position.set( 0, 20, 35 );
- rectLight = new THREE.RectAreaLight( 0xffffff, 200, 10, 10 );
+ rectLight = new THREE.RectAreaLight( 0xffffff, 1, 10, 10 );
rectLight.position.set( 5, 5, 0 );
- // TODO: ensure RectAreaLight handles target param correctly
-
rectLightHelper = new THREE.RectAreaLightHelper( rectLight );
scene.add( rectLightHelper );
- // TODO (abelnation): rect light shadow
-
scene.add( camera );
scene.add( origin );
@@ -246,13 +242,13 @@
var lightFolder = gui.addFolder( 'Light' );
- lightFolder.add( param, 'width', 0.1, 20 ).onChange( function ( val ) {
+ lightFolder.add( param, 'width', 1, 20 ).step( 0.1 ).onChange( function ( val ) {
rectLight.width = val;
} );
- lightFolder.add( param, 'height', 0.1, 20 ).onChange( function ( val ) {
+ lightFolder.add( param, 'height', 1, 20 ).step( 0.1 ).onChange( function ( val ) {
rectLight.height = val;
@@ -264,7 +260,7 @@
} );
- lightFolder.add( param, 'intensity', 0.0, 400 ).onChange( function ( val ) {
+ lightFolder.add( param, 'intensity', 0.0, 2 ).step( 0.01 ).onChange( function ( val ) {
rectLight.intensity = val;
diff --git a/src/lights/RectAreaLight.js b/src/lights/RectAreaLight.js
index bb21d43b95af6c3b904b592accce97b2d0be390b..d65f35b1306dde87c559bdf99d72fcf6186777b2 100644
--- a/src/lights/RectAreaLight.js
+++ b/src/lights/RectAreaLight.js
@@ -10,21 +10,11 @@ function RectAreaLight( color, intensity, width, height ) {
this.type = 'RectAreaLight';
- this.position.set( 0, 1, 0 );
- this.updateMatrix();
-
this.width = ( width !== undefined ) ? width : 10;
this.height = ( height !== undefined ) ? height : 10;
- // TODO (abelnation): distance/decay
-
- // TODO (abelnation): update method for RectAreaLight to update transform to lookat target
-
- // TODO (abelnation): shadows
-
}
-// TODO (abelnation): RectAreaLight update when light shape is changed
RectAreaLight.prototype = Object.assign( Object.create( Light.prototype ), {
constructor: RectAreaLight,
diff --git a/src/renderers/webgl/WebGLLights.js b/src/renderers/webgl/WebGLLights.js
index 64818eddabecfa265fe61a9aa6fdc7651eb1a3f3..ec2565c96212b06365e5727b1059b4762a0c296a 100644
--- a/src/renderers/webgl/WebGLLights.js
+++ b/src/renderers/webgl/WebGLLights.js
@@ -224,13 +224,11 @@ function WebGLLights() {
var uniforms = cache.get( light );
- // (a) intensity controls irradiance of entire light
- uniforms.color
- .copy( color )
- .multiplyScalar( intensity / ( light.width * light.height ) );
+ // (a) intensity is the total visible light emitted
+ //uniforms.color.copy( color ).multiplyScalar( intensity / ( light.width * light.height * Math.PI ) );
- // (b) intensity controls the radiance per light area
- // uniforms.color.copy( color ).multiplyScalar( intensity );
+ // (b) intensity is the brightness of the light
+ uniforms.color.copy( color ).multiplyScalar( intensity );
uniforms.position.setFromMatrixPosition( light.matrixWorld );
uniforms.position.applyMatrix4( viewMatrix );