Quellcode durchsuchen

Updated builds.

Mr.doob vor 9 Jahren
Ursprung
Commit
551b2264c6
2 geänderte Dateien mit 8 neuen und 14 gelöschten Zeilen
  1. 3 9
      build/three.js
  2. 5 5
      build/three.min.js

+ 3 - 9
build/three.js

@@ -26869,7 +26869,7 @@ THREE.WebGLShadowMap = function ( _renderer, _lights, _objects ) {
 
 			var light = _lights[ i ];
 
-			if ( ! light.castShadow ) continue;
+			if ( light.castShadow === false ) continue;
 
 			if ( light instanceof THREE.PointLight ) {
 
@@ -26912,7 +26912,7 @@ THREE.WebGLShadowMap = function ( _renderer, _lights, _objects ) {
 
 			}
 
-			if ( ! light.shadowMap ) {
+			if ( light.shadowMap === null ) {
 
 				var shadowFilter = THREE.LinearFilter;
 
@@ -26928,9 +26928,7 @@ THREE.WebGLShadowMap = function ( _renderer, _lights, _objects ) {
 
 				light.shadowMatrix = new THREE.Matrix4();
 
-			}
-
-			if ( light.shadowCamera.parent === null ) {
+				//
 
 				if ( light instanceof THREE.SpotLight ) {
 
@@ -26940,10 +26938,6 @@ THREE.WebGLShadowMap = function ( _renderer, _lights, _objects ) {
 
 				light.shadowCamera.updateProjectionMatrix();
 
-				scene.add( light.shadowCamera );
-
-				if ( scene.autoUpdate === true ) scene.updateMatrixWorld();
-
 			}
 
 			var shadowMap = light.shadowMap;

+ 5 - 5
build/three.min.js

@@ -657,11 +657,11 @@ THREE.WebGLShadowMap=function(a,b,c){function d(a,b,c,d){var e=a.geometry,f=null
 THREE.Mesh||a instanceof THREE.Line||a instanceof THREE.Points)&&a.castShadow&&(!1===a.frustumCulled||!0===h.intersectsObject(a))&&!0===a.material.visible&&(a.modelViewMatrix.multiplyMatrices(b.matrixWorldInverse,a.matrixWorld),p.push(a));for(var c=a.children,d=0,f=c.length;d<f;d++)e(c[d],b)}}var g=a.context,f=a.state,h=new THREE.Frustum,l=new THREE.Matrix4;new THREE.Vector3;new THREE.Vector3;for(var k=new THREE.Vector3,n=new THREE.Vector3,p=[],m=Array(4),q=Array(4),t=[new THREE.Vector3(1,0,0),new THREE.Vector3(-1,
 0,0),new THREE.Vector3(0,0,1),new THREE.Vector3(0,0,-1),new THREE.Vector3(0,1,0),new THREE.Vector3(0,-1,0)],s=[new THREE.Vector3(0,1,0),new THREE.Vector3(0,1,0),new THREE.Vector3(0,1,0),new THREE.Vector3(0,1,0),new THREE.Vector3(0,0,1),new THREE.Vector3(0,0,-1)],u=[new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4],x=new THREE.Vector4,v=THREE.ShaderLib.depthRGBA,D=THREE.UniformsUtils.clone(v.uniforms),w=THREE.ShaderLib.distanceRGBA,A=THREE.UniformsUtils.clone(w.uniforms),
 E=0;4!==E;++E){var z=0!==(E&1),B=0!==(E&2),O=new THREE.ShaderMaterial({uniforms:D,vertexShader:v.vertexShader,fragmentShader:v.fragmentShader,morphTargets:z,skinning:B});O._shadowPass=!0;m[E]=O;z=new THREE.ShaderMaterial({uniforms:A,vertexShader:w.vertexShader,fragmentShader:w.fragmentShader,morphTargets:z,skinning:B});z._shadowPass=!0;q[E]=z}var G=this;this.enabled=!1;this.autoUpdate=!0;this.needsUpdate=!1;this.type=THREE.PCFShadowMap;this.cullFace=THREE.CullFaceFront;this.render=function(m){var q,
-v;if(!1!==G.enabled&&(!1!==G.autoUpdate||!1!==G.needsUpdate)){g.clearColor(1,1,1,1);f.disable(g.BLEND);f.enable(g.CULL_FACE);g.frontFace(g.CCW);g.cullFace(G.cullFace===THREE.CullFaceFront?g.FRONT:g.BACK);f.setDepthTest(!0);a.getViewport(x);for(var w=0,D=b.length;w<D;w++){var y=b[w];if(y.castShadow){if(y instanceof THREE.PointLight){q=6;v=!0;var z=y.shadowMapWidth/4,A=y.shadowMapHeight/2;u[0].set(2*z,A,z,A);u[1].set(0,A,z,A);u[2].set(3*z,A,z,A);u[3].set(z,A,z,A);u[4].set(3*z,0,z,A);u[5].set(z,0,z,
-A)}else q=1,v=!1;y.shadowMap||(z=THREE.LinearFilter,G.type===THREE.PCFSoftShadowMap&&(z=THREE.NearestFilter),y.shadowMap=new THREE.WebGLRenderTarget(y.shadow.mapSize.x,y.shadow.mapSize.y,{minFilter:z,magFilter:z,format:THREE.RGBAFormat}),y.shadowMatrix=new THREE.Matrix4);null===y.shadowCamera.parent&&(y instanceof THREE.SpotLight&&(y.shadowCamera.aspect=y.shadow.mapSize.x/y.shadow.mapSize.y),y.shadowCamera.updateProjectionMatrix(),m.add(y.shadowCamera),!0===m.autoUpdate&&m.updateMatrixWorld());var B=
-y.shadowMap,z=y.shadowMatrix,A=y.shadowCamera;n.setFromMatrixPosition(y.matrixWorld);A.position.copy(n);a.setRenderTarget(B);a.clear();for(B=0;B<q;B++){if(v){k.copy(A.position);k.add(t[B]);A.up.copy(s[B]);A.lookAt(k);var E=u[B];a.setViewport(E.x,E.y,E.z,E.w)}else k.setFromMatrixPosition(y.target.matrixWorld),A.lookAt(k);A.updateMatrixWorld();A.matrixWorldInverse.getInverse(A.matrixWorld);z.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1);z.multiply(A.projectionMatrix);z.multiply(A.matrixWorldInverse);l.multiplyMatrices(A.projectionMatrix,
-A.matrixWorldInverse);h.setFromMatrix(l);p.length=0;e(m,A);for(var E=0,O=p.length;E<O;E++){var F=p[E],W=c.update(F),U=F.material;if(U instanceof THREE.MeshFaceMaterial)for(var Y=W.groups,U=U.materials,ca=0,fa=Y.length;ca<fa;ca++){var ea=Y[ca],$=U[ea.materialIndex];!0===$.visible&&($=d(F,$,v,n),a.renderBufferDirect(A,b,null,W,$,F,ea))}else $=d(F,U,v,n),a.renderBufferDirect(A,b,null,W,$,F,null)}}a.resetGLState()}}a.setViewport(x.x,x.y,x.z,x.w);m=a.getClearColor();q=a.getClearAlpha();a.setClearColor(m,
-q);f.enable(g.BLEND);G.cullFace===THREE.CullFaceFront&&g.cullFace(g.BACK);a.resetGLState();G.needsUpdate=!1}}};
+v;if(!1!==G.enabled&&(!1!==G.autoUpdate||!1!==G.needsUpdate)){g.clearColor(1,1,1,1);f.disable(g.BLEND);f.enable(g.CULL_FACE);g.frontFace(g.CCW);g.cullFace(G.cullFace===THREE.CullFaceFront?g.FRONT:g.BACK);f.setDepthTest(!0);a.getViewport(x);for(var w=0,D=b.length;w<D;w++){var y=b[w];if(!1!==y.castShadow){if(y instanceof THREE.PointLight){q=6;v=!0;var z=y.shadowMapWidth/4,A=y.shadowMapHeight/2;u[0].set(2*z,A,z,A);u[1].set(0,A,z,A);u[2].set(3*z,A,z,A);u[3].set(z,A,z,A);u[4].set(3*z,0,z,A);u[5].set(z,
+0,z,A)}else q=1,v=!1;null===y.shadowMap&&(z=THREE.LinearFilter,G.type===THREE.PCFSoftShadowMap&&(z=THREE.NearestFilter),y.shadowMap=new THREE.WebGLRenderTarget(y.shadow.mapSize.x,y.shadow.mapSize.y,{minFilter:z,magFilter:z,format:THREE.RGBAFormat}),y.shadowMatrix=new THREE.Matrix4,y instanceof THREE.SpotLight&&(y.shadowCamera.aspect=y.shadow.mapSize.x/y.shadow.mapSize.y),y.shadowCamera.updateProjectionMatrix());var B=y.shadowMap,z=y.shadowMatrix,A=y.shadowCamera;n.setFromMatrixPosition(y.matrixWorld);
+A.position.copy(n);a.setRenderTarget(B);a.clear();for(B=0;B<q;B++){if(v){k.copy(A.position);k.add(t[B]);A.up.copy(s[B]);A.lookAt(k);var E=u[B];a.setViewport(E.x,E.y,E.z,E.w)}else k.setFromMatrixPosition(y.target.matrixWorld),A.lookAt(k);A.updateMatrixWorld();A.matrixWorldInverse.getInverse(A.matrixWorld);z.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1);z.multiply(A.projectionMatrix);z.multiply(A.matrixWorldInverse);l.multiplyMatrices(A.projectionMatrix,A.matrixWorldInverse);h.setFromMatrix(l);p.length=
+0;e(m,A);for(var E=0,O=p.length;E<O;E++){var F=p[E],W=c.update(F),U=F.material;if(U instanceof THREE.MeshFaceMaterial)for(var Y=W.groups,U=U.materials,ca=0,fa=Y.length;ca<fa;ca++){var ea=Y[ca],$=U[ea.materialIndex];!0===$.visible&&($=d(F,$,v,n),a.renderBufferDirect(A,b,null,W,$,F,ea))}else $=d(F,U,v,n),a.renderBufferDirect(A,b,null,W,$,F,null)}}a.resetGLState()}}a.setViewport(x.x,x.y,x.z,x.w);m=a.getClearColor();q=a.getClearAlpha();a.setClearColor(m,q);f.enable(g.BLEND);G.cullFace===THREE.CullFaceFront&&
+g.cullFace(g.BACK);a.resetGLState();G.needsUpdate=!1}}};
 THREE.WebGLState=function(a,b,c){var d=this,e=new Uint8Array(16),g=new Uint8Array(16),f=new Uint8Array(16),h={},l=null,k=null,n=null,p=null,m=null,q=null,t=null,s=null,u=null,x=null,v=null,D=null,w=null,A=null,E=null,z=a.getParameter(a.MAX_TEXTURE_IMAGE_UNITS),B=void 0,O={};this.init=function(){a.clearColor(0,0,0,1);a.clearDepth(1);a.clearStencil(0);this.enable(a.DEPTH_TEST);a.depthFunc(a.LEQUAL);a.frontFace(a.CCW);a.cullFace(a.BACK);this.enable(a.CULL_FACE);this.enable(a.BLEND);a.blendEquation(a.FUNC_ADD);
 a.blendFunc(a.SRC_ALPHA,a.ONE_MINUS_SRC_ALPHA)};this.initAttributes=function(){for(var a=0,b=e.length;a<b;a++)e[a]=0};this.enableAttribute=function(c){e[c]=1;0===g[c]&&(a.enableVertexAttribArray(c),g[c]=1);0!==f[c]&&(b.get("ANGLE_instanced_arrays").vertexAttribDivisorANGLE(c,0),f[c]=0)};this.enableAttributeAndDivisor=function(b,c,d){e[b]=1;0===g[b]&&(a.enableVertexAttribArray(b),g[b]=1);f[b]!==c&&(d.vertexAttribDivisorANGLE(b,c),f[b]=c)};this.disableUnusedAttributes=function(){for(var b=0,c=g.length;b<
 c;b++)g[b]!==e[b]&&(a.disableVertexAttribArray(b),g[b]=0)};this.enable=function(b){!0!==h[b]&&(a.enable(b),h[b]=!0)};this.disable=function(b){!1!==h[b]&&(a.disable(b),h[b]=!1)};this.getCompressedTextureFormats=function(){if(null===l&&(l=[],b.get("WEBGL_compressed_texture_pvrtc")||b.get("WEBGL_compressed_texture_s3tc")))for(var c=a.getParameter(a.COMPRESSED_TEXTURE_FORMATS),d=0;d<c.length;d++)l.push(c[d]);return l};this.setBlending=function(b,d,e,f,g,h,l){b!==k&&(b===THREE.NoBlending?this.disable(a.BLEND):