Browse Source

Updated builds.

Mr.doob 9 years ago
parent
commit
1866efc99b
2 changed files with 7 additions and 6 deletions
  1. 4 3
      build/three.js
  2. 3 3
      build/three.min.js

+ 4 - 3
build/three.js

@@ -14195,7 +14195,7 @@ Object.defineProperties( THREE.Light.prototype, {
 	},
 	shadowDarkness: {
 		set: function ( value ) {
-			console.warn( 'THREE.Light: .shadowDarkness has been removed.' );
+			this.shadow.darkness = value;
 		}
 	},
 	shadowMapWidth: {
@@ -14248,6 +14248,7 @@ THREE.LightShadow = function ( camera ) {
 	this.camera = camera;
 
 	this.bias = 0;
+	this.darkness = 1;
 
 	this.mapSize = new THREE.Vector2( 512, 512 );
 
@@ -23451,11 +23452,11 @@ THREE.WebGLRenderer = function ( parameters ) {
 						shadow.matrix.identity().setPosition( _vector3 );
 
 						// for point lights we set the sign of the shadowDarkness uniform to be negative
-						uniforms.shadowDarkness.value[ j ] = - 1.0;
+						uniforms.shadowDarkness.value[ j ] = - shadow.darkness;
 
 					} else {
 
-						uniforms.shadowDarkness.value[ j ] = 1.0;
+						uniforms.shadowDarkness.value[ j ] = shadow.darkness;
 
 					}
 

+ 3 - 3
build/three.min.js

@@ -310,10 +310,10 @@ THREE.PerspectiveCamera.prototype.updateProjectionMatrix=function(){var a=THREE.
 this.aspect,this.near,this.far)};THREE.PerspectiveCamera.prototype.copy=function(a){THREE.Camera.prototype.copy.call(this,a);this.fov=a.fov;this.aspect=a.aspect;this.near=a.near;this.far=a.far;this.zoom=a.zoom;return this};THREE.PerspectiveCamera.prototype.toJSON=function(a){a=THREE.Object3D.prototype.toJSON.call(this,a);a.object.zoom=this.zoom;a.object.fov=this.fov;a.object.aspect=this.aspect;a.object.near=this.near;a.object.far=this.far;return a};
 THREE.Light=function(a){THREE.Object3D.call(this);this.type="Light";this.color=new THREE.Color(a);this.receiveShadow=void 0};THREE.Light.prototype=Object.create(THREE.Object3D.prototype);THREE.Light.prototype.constructor=THREE.Light;
 Object.defineProperties(THREE.Light.prototype,{onlyShadow:{set:function(a){console.warn("THREE.Light: .onlyShadow has been removed.")}},shadowCameraFov:{set:function(a){this.shadow.camera.fov=a}},shadowCameraLeft:{set:function(a){this.shadow.camera.left=a}},shadowCameraRight:{set:function(a){this.shadow.camera.right=a}},shadowCameraTop:{set:function(a){this.shadow.camera.top=a}},shadowCameraBottom:{set:function(a){this.shadow.camera.bottom=a}},shadowCameraNear:{set:function(a){this.shadow.camera.near=
-a}},shadowCameraFar:{set:function(a){this.shadow.camera.far=a}},shadowCameraVisible:{set:function(a){console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow ) instead.")}},shadowBias:{set:function(a){this.shadow.bias=a}},shadowDarkness:{set:function(a){console.warn("THREE.Light: .shadowDarkness has been removed.")}},shadowMapWidth:{set:function(a){this.shadow.mapSize.width=a}},shadowMapHeight:{set:function(a){this.shadow.mapSize.height=a}}});
+a}},shadowCameraFar:{set:function(a){this.shadow.camera.far=a}},shadowCameraVisible:{set:function(a){console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow ) instead.")}},shadowBias:{set:function(a){this.shadow.bias=a}},shadowDarkness:{set:function(a){this.shadow.darkness=a}},shadowMapWidth:{set:function(a){this.shadow.mapSize.width=a}},shadowMapHeight:{set:function(a){this.shadow.mapSize.height=a}}});
 THREE.Light.prototype.copy=function(a){THREE.Object3D.prototype.copy.call(this,a);this.color.copy(a.color);return this};
 THREE.Light.prototype.toJSON=function(a){a=THREE.Object3D.prototype.toJSON.call(this,a);a.object.color=this.color.getHex();void 0!==this.groundColor&&(a.object.groundColor=this.groundColor.getHex());void 0!==this.intensity&&(a.object.intensity=this.intensity);void 0!==this.distance&&(a.object.distance=this.distance);void 0!==this.angle&&(a.object.angle=this.angle);void 0!==this.decay&&(a.object.decay=this.decay);void 0!==this.exponent&&(a.object.exponent=this.exponent);return a};
-THREE.LightShadow=function(a){this.camera=a;this.bias=0;this.mapSize=new THREE.Vector2(512,512);this.matrix=this.map=null};THREE.LightShadow.prototype={constructor:THREE.LightShadow,copy:function(a){this.camera=a.camera.clone();this.bias=a.bias;this.darkness=a.darkness;this.mapSize.copy(a.mapSize)},clone:function(){return(new this.constructor).copy(this)}};THREE.AmbientLight=function(a){THREE.Light.call(this,a);this.type="AmbientLight"};THREE.AmbientLight.prototype=Object.create(THREE.Light.prototype);
+THREE.LightShadow=function(a){this.camera=a;this.bias=0;this.darkness=1;this.mapSize=new THREE.Vector2(512,512);this.matrix=this.map=null};THREE.LightShadow.prototype={constructor:THREE.LightShadow,copy:function(a){this.camera=a.camera.clone();this.bias=a.bias;this.darkness=a.darkness;this.mapSize.copy(a.mapSize)},clone:function(){return(new this.constructor).copy(this)}};THREE.AmbientLight=function(a){THREE.Light.call(this,a);this.type="AmbientLight"};THREE.AmbientLight.prototype=Object.create(THREE.Light.prototype);
 THREE.AmbientLight.prototype.constructor=THREE.AmbientLight;THREE.DirectionalLight=function(a,b){THREE.Light.call(this,a);this.type="DirectionalLight";this.position.set(0,1,0);this.updateMatrix();this.target=new THREE.Object3D;this.intensity=void 0!==b?b:1;this.shadow=new THREE.LightShadow(new THREE.OrthographicCamera(-500,500,500,-500,50,5E3))};THREE.DirectionalLight.prototype=Object.create(THREE.Light.prototype);THREE.DirectionalLight.prototype.constructor=THREE.DirectionalLight;
 THREE.DirectionalLight.prototype.copy=function(a){THREE.Light.prototype.copy.call(this,a);this.intensity=a.intensity;this.target=a.target.clone();this.shadow=a.shadow.clone();return this};THREE.HemisphereLight=function(a,b,c){THREE.Light.call(this,a);this.type="HemisphereLight";this.position.set(0,1,0);this.updateMatrix();this.groundColor=new THREE.Color(b);this.intensity=void 0!==c?c:1};THREE.HemisphereLight.prototype=Object.create(THREE.Light.prototype);
 THREE.HemisphereLight.prototype.constructor=THREE.HemisphereLight;THREE.HemisphereLight.prototype.copy=function(a){THREE.Light.prototype.copy.call(this,a);this.groundColor.copy(a.groundColor);this.intensity=a.intensity;return this};THREE.PointLight=function(a,b,c,d){THREE.Light.call(this,a);this.type="PointLight";this.intensity=void 0!==b?b:1;this.distance=void 0!==c?c:0;this.decay=void 0!==d?d:1;this.shadow=new THREE.LightShadow(new THREE.PerspectiveCamera(90,1,1,500))};
@@ -550,7 +550,7 @@ d instanceof THREE.MeshLambertMaterial||d instanceof THREE.MeshPhongMaterial){k.
 d.emissiveMap);void 0!==P&&(P instanceof THREE.WebGLRenderTarget&&(P=P.texture),m=P.offset,P=P.repeat,k.offsetRepeat.value.set(m.x,m.y,P.x,P.y));k.envMap.value=d.envMap;k.flipEnvMap.value=d.envMap instanceof THREE.WebGLRenderTargetCube?1:-1;k.reflectivity.value=d.reflectivity;k.refractionRatio.value=d.refractionRatio}d instanceof THREE.LineBasicMaterial?(k.diffuse.value=d.color,k.opacity.value=d.opacity):d instanceof THREE.LineDashedMaterial?(k.diffuse.value=d.color,k.opacity.value=d.opacity,k.dashSize.value=
 d.dashSize,k.totalSize.value=d.dashSize+d.gapSize,k.scale.value=d.scale):d instanceof THREE.PointsMaterial?(k.psColor.value=d.color,k.opacity.value=d.opacity,k.size.value=d.size,k.scale.value=N.height/2,k.map.value=d.map,null!==d.map&&(a=d.map.offset,P=d.map.repeat,k.offsetRepeat.value.set(a.x,a.y,P.x,P.y))):d instanceof THREE.MeshPhongMaterial?(k.specular.value=d.specular,k.shininess.value=Math.max(d.shininess,1E-4),d.lightMap&&(k.lightMap.value=d.lightMap,k.lightMapIntensity.value=d.lightMapIntensity),
 d.emissiveMap&&(k.emissiveMap.value=d.emissiveMap),d.bumpMap&&(k.bumpMap.value=d.bumpMap,k.bumpScale.value=d.bumpScale),d.normalMap&&(k.normalMap.value=d.normalMap,k.normalScale.value.copy(d.normalScale)),d.displacementMap&&(k.displacementMap.value=d.displacementMap,k.displacementScale.value=d.displacementScale,k.displacementBias.value=d.displacementBias)):d instanceof THREE.MeshDepthMaterial?(k.mNear.value=a.near,k.mFar.value=a.far,k.opacity.value=d.opacity):d instanceof THREE.MeshNormalMaterial&&
-(k.opacity.value=d.opacity);if(e.receiveShadow&&!d._shadowPass&&k.shadowMatrix)for(a=d=0,P=b.length;a<P;a++)m=b[a],!1!==m.castShadow&&(m instanceof THREE.PointLight||m instanceof THREE.SpotLight||m instanceof THREE.DirectionalLight)&&(c=m.shadow,m instanceof THREE.PointLight?(V.setFromMatrixPosition(m.matrixWorld).negate(),c.matrix.identity().setPosition(V),k.shadowDarkness.value[d]=-1):k.shadowDarkness.value[d]=1,k.shadowMatrix.value[d]=c.matrix,k.shadowMap.value[d]=c.map,k.shadowMapSize.value[d]=
+(k.opacity.value=d.opacity);if(e.receiveShadow&&!d._shadowPass&&k.shadowMatrix)for(a=d=0,P=b.length;a<P;a++)m=b[a],!1!==m.castShadow&&(m instanceof THREE.PointLight||m instanceof THREE.SpotLight||m instanceof THREE.DirectionalLight)&&(c=m.shadow,m instanceof THREE.PointLight?(V.setFromMatrixPosition(m.matrixWorld).negate(),c.matrix.identity().setPosition(V),k.shadowDarkness.value[d]=-c.darkness):k.shadowDarkness.value[d]=c.darkness,k.shadowMatrix.value[d]=c.matrix,k.shadowMap.value[d]=c.map,k.shadowMapSize.value[d]=
 c.mapSize,k.shadowBias.value[d]=c.bias,d++);b=f.uniformsList;f=0;for(d=b.length;f<d;f++)if(a=b[f][0],!1!==a.needsUpdate)switch(k=a.type,c=a.value,P=b[f][1],k){case "1i":r.uniform1i(P,c);break;case "1f":r.uniform1f(P,c);break;case "2f":r.uniform2f(P,c[0],c[1]);break;case "3f":r.uniform3f(P,c[0],c[1],c[2]);break;case "4f":r.uniform4f(P,c[0],c[1],c[2],c[3]);break;case "1iv":r.uniform1iv(P,c);break;case "3iv":r.uniform3iv(P,c);break;case "1fv":r.uniform1fv(P,c);break;case "2fv":r.uniform2fv(P,c);break;
 case "3fv":r.uniform3fv(P,c);break;case "4fv":r.uniform4fv(P,c);break;case "Matrix3fv":r.uniformMatrix3fv(P,!1,c);break;case "Matrix4fv":r.uniformMatrix4fv(P,!1,c);break;case "i":r.uniform1i(P,c);break;case "f":r.uniform1f(P,c);break;case "v2":r.uniform2f(P,c.x,c.y);break;case "v3":r.uniform3f(P,c.x,c.y,c.z);break;case "v4":r.uniform4f(P,c.x,c.y,c.z,c.w);break;case "c":r.uniform3f(P,c.r,c.g,c.b);break;case "iv1":r.uniform1iv(P,c);break;case "iv":r.uniform3iv(P,c);break;case "fv1":r.uniform1fv(P,c);
 break;case "fv":r.uniform3fv(P,c);break;case "v2v":void 0===a._array&&(a._array=new Float32Array(2*c.length));n=k=0;for(m=c.length;k<m;k++,n+=2)a._array[n+0]=c[k].x,a._array[n+1]=c[k].y;r.uniform2fv(P,a._array);break;case "v3v":void 0===a._array&&(a._array=new Float32Array(3*c.length));n=k=0;for(m=c.length;k<m;k++,n+=3)a._array[n+0]=c[k].x,a._array[n+1]=c[k].y,a._array[n+2]=c[k].z;r.uniform3fv(P,a._array);break;case "v4v":void 0===a._array&&(a._array=new Float32Array(4*c.length));n=k=0;for(m=c.length;k<