From a3eca4aae00e6bae8fa14e8e79b14c7c5480b07b Mon Sep 17 00:00:00 2001 From: alteredq Date: Sat, 22 Dec 2012 02:50:14 +0100 Subject: [PATCH] WebGLDeferredRenderer: taking into account material color and light intensity for area lights. Also added forgotten AreaLight.js --- build/three.js | 6 ++++-- build/three.min.js | 2 +- examples/js/ShaderDeferred.js | 12 ++++++++--- .../webgl_lights_deferred_arealights.html | 8 +++---- src/lights/AreaLight.js | 21 +++++++++++++++++++ 5 files changed, 39 insertions(+), 10 deletions(-) create mode 100644 src/lights/AreaLight.js diff --git a/build/three.js b/build/three.js index 2a306e309a..685f5c4012 100644 --- a/build/three.js +++ b/build/three.js @@ -7976,16 +7976,18 @@ THREE.AmbientLight = function ( hex ) { THREE.AmbientLight.prototype = Object.create( THREE.Light.prototype ); /** * @author MPanknin / http://www.redplant.de/ + * @author alteredq / http://alteredqualia.com/ */ -THREE.AreaLight = function ( hex ) { +THREE.AreaLight = function ( hex, intensity ) { THREE.Light.call( this, hex ); this.normal = new THREE.Vector3( 0, -1, 0 ); this.right = new THREE.Vector3( 1, 0, 0 ); - this.intensity = 1.0; + this.intensity = ( intensity !== undefined ) ? intensity : 1; + this.width = 1.0; this.height = 1.0; diff --git a/build/three.min.js b/build/three.min.js index 3cdcc6cc8d..746f708db3 100644 --- a/build/three.min.js +++ b/build/three.min.js @@ -163,7 +163,7 @@ this.attributes.uv)console.warn("Missing required attributes (index, position, n var n,p,m,r,s,l,q,u,B,x,t,F,C,z,A,f=new THREE.Vector3,g=new THREE.Vector3,H,G,I,$,D,L,y,K=this.offsets;I=0;for($=K.length;I<$;++I){G=K[I].start;D=K[I].count;var J=K[I].index;H=G;for(G+=D;H