Browse Source

Updated builds.

Mr.doob 9 years ago
parent
commit
da6a8cfe46
2 changed files with 12 additions and 6 deletions
  1. 9 3
      build/three.js
  2. 3 3
      build/three.min.js

+ 9 - 3
build/three.js

@@ -27665,10 +27665,10 @@ THREE.WebGLRenderer = function ( parameters ) {
 					uniforms.shadowMatrix = light.shadow.matrix;
 
 					_lights.shadows[ shadowsLength ++ ] = light;
-					_lights.directionalShadow[ directionalLength ] = light.shadow.map;
 
 				}
 
+				_lights.directionalShadow[ directionalLength ] = light.shadow.map;
 				_lights.directional[ directionalLength ++ ] = uniforms;
 
 			} else if ( light instanceof THREE.SpotLight ) {
@@ -27700,10 +27700,10 @@ THREE.WebGLRenderer = function ( parameters ) {
 					uniforms.shadowMatrix = light.shadow.matrix;
 
 					_lights.shadows[ shadowsLength ++ ] = light;
-					_lights.spotShadow[ spotLength ] = light.shadow.map;
 
 				}
 
+				_lights.spotShadow[ spotLength ] = light.shadow.map;
 				_lights.spot[ spotLength ++ ] = uniforms;
 
 			} else if ( light instanceof THREE.PointLight ) {
@@ -27731,10 +27731,10 @@ THREE.WebGLRenderer = function ( parameters ) {
 					uniforms.shadowMatrix.identity().setPosition( _vector3 );
 
 					_lights.shadows[ shadowsLength ++ ] = light;
-					_lights.pointShadow[ pointLength ] = light.shadow.map;
 
 				}
 
+				_lights.pointShadow[ pointLength ] = light.shadow.map;
 				_lights.point[ pointLength ++ ] = uniforms;
 
 			} else if ( light instanceof THREE.HemisphereLight ) {
@@ -29870,6 +29870,9 @@ THREE.WebGLProgram = ( function () {
 		var vertexGlsl = prefixVertex + vertexShader;
 		var fragmentGlsl = prefixFragment + fragmentShader;
 
+		// console.log( '*VERTEX*', vertexGlsl );
+		// console.log( '*FRAGMENT*', fragmentGlsl );
+
 		var glVertexShader = THREE.WebGLShader( gl, gl.VERTEX_SHADER, vertexGlsl );
 		var glFragmentShader = THREE.WebGLShader( gl, gl.FRAGMENT_SHADER, fragmentGlsl );
 
@@ -29898,6 +29901,9 @@ THREE.WebGLProgram = ( function () {
 		var runnable = true;
 		var haveDiagnostics = true;
 
+		// console.log( '**VERTEX**', gl.getExtension( 'WEBGL_debug_shaders' ).getTranslatedShaderSource( glVertexShader ) );
+		// console.log( '**FRAGMENT**', gl.getExtension( 'WEBGL_debug_shaders' ).getTranslatedShaderSource( glFragmentShader ) );
+
 		if ( gl.getProgramParameter( program, gl.LINK_STATUS ) === false ) {
 
 			runnable = false;

+ 3 - 3
build/three.min.js

@@ -654,9 +654,9 @@ oa.getAttributeBuffer(b))}p=Infinity;null!==b?p=b.count:void 0!==k&&(p=k.count);
 case THREE.TriangleFanDrawMode:a.setMode(r.TRIANGLE_FAN)}else e instanceof THREE.Line?(d=d.linewidth,void 0===d&&(d=1),H.setLineWidth(d*(null===ba?$:1)),e instanceof THREE.LineSegments?a.setMode(r.LINES):a.setMode(r.LINE_STRIP)):e instanceof THREE.Points&&a.setMode(r.POINTS);c instanceof THREE.InstancedBufferGeometry&&0<c.maxInstancedCount?a.renderInstances(c,f,p):a.render(f,p)};this.render=function(a,b,c,d){if(!1===b instanceof THREE.Camera)console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");
 else{var e=a.fog;ma="";qa=-1;la=null;!0===a.autoUpdate&&a.updateMatrixWorld();null===b.parent&&b.updateMatrixWorld();b.matrixWorldInverse.getInverse(b.matrixWorld);ra.multiplyMatrices(b.projectionMatrix,b.matrixWorldInverse);ya.setFromMatrix(ra);R.length=0;X=E=-1;ia.length=0;da.length=0;q(a,b);J.length=E+1;V.length=X+1;!0===Y.sortObjects&&(J.sort(m),V.sort(p));var f=R,g,h,k,l=0,n=0,w=0,t,v,u,x=b.matrixWorldInverse,C=0,y=0,A=0,F=0,B=0;g=S.shadowsPointLight=0;for(h=f.length;g<h;g++)if(k=f[g],t=k.color,
 v=k.intensity,u=k.distance,k instanceof THREE.AmbientLight)l+=t.r*v,n+=t.g*v,w+=t.b*v;else if(k instanceof THREE.DirectionalLight){var z=wa.get(k);z.direction.setFromMatrixPosition(k.matrixWorld);W.setFromMatrixPosition(k.target.matrixWorld);z.direction.sub(W);z.direction.transformDirection(x);z.color.copy(k.color).multiplyScalar(k.intensity);if(z.shadowEnabled=k.castShadow)z.shadowBias=k.shadow.bias,z.shadowRadius=k.shadow.radius,z.shadowMapSize=k.shadow.mapSize,z.shadowMatrix=k.shadow.matrix,S.shadows[B++]=
-k,S.directionalShadow[C]=k.shadow.map;S.directional[C++]=z}else if(k instanceof THREE.SpotLight){z=wa.get(k);z.position.setFromMatrixPosition(k.matrixWorld);z.position.applyMatrix4(x);z.color.copy(t).multiplyScalar(v);z.distance=u;z.direction.setFromMatrixPosition(k.matrixWorld);W.setFromMatrixPosition(k.target.matrixWorld);z.direction.sub(W);z.direction.transformDirection(x);z.angleCos=Math.cos(k.angle);z.exponent=k.exponent;z.decay=0===k.distance?0:k.decay;if(z.shadowEnabled=k.castShadow)z.shadowBias=
-k.shadow.bias,z.shadowRadius=k.shadow.radius,z.shadowMapSize=k.shadow.mapSize,z.shadowMatrix=k.shadow.matrix,S.shadows[B++]=k,S.spotShadow[A]=k.shadow.map;S.spot[A++]=z}else if(k instanceof THREE.PointLight){z=wa.get(k);z.position.setFromMatrixPosition(k.matrixWorld);z.position.applyMatrix4(x);z.color.copy(k.color).multiplyScalar(k.intensity);z.distance=k.distance;z.decay=0===k.distance?0:k.decay;if(z.shadowEnabled=k.castShadow)z.shadowBias=k.shadow.bias,z.shadowRadius=k.shadow.radius,z.shadowMapSize=
-k.shadow.mapSize,W.setFromMatrixPosition(k.matrixWorld).negate(),z.shadowMatrix.identity().setPosition(W),S.shadows[B++]=k,S.pointShadow[y]=k.shadow.map;S.point[y++]=z}else k instanceof THREE.HemisphereLight&&(z=wa.get(k),z.direction.setFromMatrixPosition(k.matrixWorld),z.direction.transformDirection(x),z.direction.normalize(),z.skyColor.copy(k.color).multiplyScalar(v),z.groundColor.copy(k.groundColor).multiplyScalar(v),S.hemi[F++]=z);S.ambient[0]=l;S.ambient[1]=n;S.ambient[2]=w;S.directional.length=
+k;S.directionalShadow[C]=k.shadow.map;S.directional[C++]=z}else if(k instanceof THREE.SpotLight){z=wa.get(k);z.position.setFromMatrixPosition(k.matrixWorld);z.position.applyMatrix4(x);z.color.copy(t).multiplyScalar(v);z.distance=u;z.direction.setFromMatrixPosition(k.matrixWorld);W.setFromMatrixPosition(k.target.matrixWorld);z.direction.sub(W);z.direction.transformDirection(x);z.angleCos=Math.cos(k.angle);z.exponent=k.exponent;z.decay=0===k.distance?0:k.decay;if(z.shadowEnabled=k.castShadow)z.shadowBias=
+k.shadow.bias,z.shadowRadius=k.shadow.radius,z.shadowMapSize=k.shadow.mapSize,z.shadowMatrix=k.shadow.matrix,S.shadows[B++]=k;S.spotShadow[A]=k.shadow.map;S.spot[A++]=z}else if(k instanceof THREE.PointLight){z=wa.get(k);z.position.setFromMatrixPosition(k.matrixWorld);z.position.applyMatrix4(x);z.color.copy(k.color).multiplyScalar(k.intensity);z.distance=k.distance;z.decay=0===k.distance?0:k.decay;if(z.shadowEnabled=k.castShadow)z.shadowBias=k.shadow.bias,z.shadowRadius=k.shadow.radius,z.shadowMapSize=
+k.shadow.mapSize,W.setFromMatrixPosition(k.matrixWorld).negate(),z.shadowMatrix.identity().setPosition(W),S.shadows[B++]=k;S.pointShadow[y]=k.shadow.map;S.point[y++]=z}else k instanceof THREE.HemisphereLight&&(z=wa.get(k),z.direction.setFromMatrixPosition(k.matrixWorld),z.direction.transformDirection(x),z.direction.normalize(),z.skyColor.copy(k.color).multiplyScalar(v),z.groundColor.copy(k.groundColor).multiplyScalar(v),S.hemi[F++]=z);S.ambient[0]=l;S.ambient[1]=n;S.ambient[2]=w;S.directional.length=
 C;S.point.length=y;S.spot.length=A;S.hemi.length=F;S.shadows.length=B;S.hash=C+","+y+","+A+","+F+","+B;Ba.render(a,b);ea.calls=0;ea.vertices=0;ea.faces=0;ea.points=0;void 0===c&&(c=null);this.setRenderTarget(c);(this.autoClear||d)&&this.clear(this.autoClearColor,this.autoClearDepth,this.autoClearStencil);a.overrideMaterial?(d=a.overrideMaterial,s(J,b,e,d),s(V,b,e,d)):(H.setBlending(THREE.NoBlending),s(J,b,e),s(V,b,e));Fa.render(a,b);Ga.render(a,b,ja);c&&(a=c.texture,a.generateMipmaps&&D(c)&&a.minFilter!==
 THREE.NearestFilter&&a.minFilter!==THREE.LinearFilter&&(a=c instanceof THREE.WebGLRenderTargetCube?r.TEXTURE_CUBE_MAP:r.TEXTURE_2D,c=T.get(c.texture).__webglTexture,H.bindTexture(a,c),r.generateMipmap(a),H.bindTexture(a,null)));H.setDepthTest(!0);H.setDepthWrite(!0);H.setColorWrite(!0)}};this.setFaceCulling=function(a,b){a===THREE.CullFaceNone?H.disable(r.CULL_FACE):(b===THREE.FrontFaceDirectionCW?r.frontFace(r.CW):r.frontFace(r.CCW),a===THREE.CullFaceBack?r.cullFace(r.BACK):a===THREE.CullFaceFront?
 r.cullFace(r.FRONT):r.cullFace(r.FRONT_AND_BACK),H.enable(r.CULL_FACE))};this.setTexture=function(a,b){var c=T.get(a);if(0<a.version&&c.__version!==a.version){var d=a.image;if(void 0===d)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined",a);else if(!1===d.complete)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete",a);else{void 0===c.__webglInit&&(c.__webglInit=!0,a.addEventListener("dispose",f),c.__webglTexture=r.createTexture(),