Browse Source

Updated builds.

Mr.doob 9 years ago
parent
commit
22dc2088db
2 changed files with 14 additions and 13 deletions
  1. 2 1
      build/three.js
  2. 12 12
      build/three.min.js

+ 2 - 1
build/three.js

@@ -30495,7 +30495,8 @@ THREE.WebGLState = function ( gl, extensions, paramThreeToGL ) {
 		var texture = gl.createTexture();
 
 		gl.bindTexture( type, texture );
-		gl.texParameteri( type, gl.TEXTURE_MIN_FILTER, gl.LINEAR );
+		gl.texParameteri( type, gl.TEXTURE_MIN_FILTER, gl.NEAREST );
+		gl.texParameteri( type, gl.TEXTURE_MAG_FILTER, gl.NEAREST );
 
 		for ( var i = 0; i < count; i ++ ) {
 

+ 12 - 12
build/three.min.js

@@ -736,18 +736,18 @@ THREE.Points)&&a.castShadow&&(!1===a.frustumCulled||!0===h.intersectsObject(a))&
 1,1,1);g.disable(f.BLEND);g.setDepthTest(!0);g.setScissorTest(!1);for(var s,u,x=0,y=m.length;x<y;x++){var A=m[x],G=A.shadow,O=G.camera;n.copy(G.mapSize);if(A instanceof THREE.PointLight){s=6;u=!0;var B=n.x,C=n.y;D[0].set(2*B,C,B,C);D[1].set(0,C,B,C);D[2].set(3*B,C,B,C);D[3].set(B,C,B,C);D[4].set(3*B,0,B,C);D[5].set(B,0,B,C);n.x*=4;n.y*=2}else s=1,u=!1;null===G.map&&(G.map=new THREE.WebGLRenderTarget(n.x,n.y,{minFilter:THREE.NearestFilter,magFilter:THREE.NearestFilter,format:THREE.RGBAFormat}),O.updateProjectionMatrix());
 G instanceof THREE.SpotLightShadow&&G.update(A);B=G.map;G=G.matrix;l.setFromMatrixPosition(A.matrixWorld);O.position.copy(l);a.setRenderTarget(B);a.clear();for(B=0;B<s;B++){u?(p.copy(O.position),p.add(w[B]),O.up.copy(v[B]),O.lookAt(p),g.viewport(D[B])):(p.setFromMatrixPosition(A.target.matrixWorld),O.lookAt(p));O.updateMatrixWorld();O.matrixWorldInverse.getInverse(O.matrixWorld);G.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1);G.multiply(O.projectionMatrix);G.multiply(O.matrixWorldInverse);k.multiplyMatrices(O.projectionMatrix,
 O.matrixWorldInverse);h.setFromMatrix(k);q.length=0;e(b,r,O);for(var C=0,F=q.length;C<F;C++){var M=q[C],T=c.update(M),Y=M.material;if(Y instanceof THREE.MultiMaterial)for(var fa=T.groups,Y=Y.materials,da=0,W=fa.length;da<W;da++){var Z=fa[da],ca=Y[Z.materialIndex];!0===ca.visible&&(ca=d(M,ca,u,l),a.renderBufferDirect(O,null,T,ca,M,Z))}else ca=d(M,Y,u,l),a.renderBufferDirect(O,null,T,ca,M,null)}}}s=a.getClearColor();u=a.getClearAlpha();a.setClearColor(s,u);E.needsUpdate=!1}}};
-THREE.WebGLState=function(a,b,c){function d(b,c,d){var e=new Uint8Array(3),f=a.createTexture();a.bindTexture(b,f);a.texParameteri(b,a.TEXTURE_MIN_FILTER,a.LINEAR);for(b=0;b<d;b++)a.texImage2D(c+b,0,a.RGB,1,1,0,a.RGB,a.UNSIGNED_BYTE,e);return f}var e=this,f=new THREE.Vector4,g=a.getParameter(a.MAX_VERTEX_ATTRIBS),h=new Uint8Array(g),k=new Uint8Array(g),m=new Uint8Array(g),n={},p=null,l=null,q=null,r=null,s=null,u=null,w=null,v=null,D=!1,x=null,B=null,A=null,y=null,C=null,M=null,E=null,z=null,I=null,
-Q=null,N=null,H=null,L=null,J=null,G=null,O=null,R=a.getParameter(a.MAX_TEXTURE_IMAGE_UNITS),P=null,F={},$=new THREE.Vector4,T=null,Y=null,fa=new THREE.Vector4,da=new THREE.Vector4,W={};W[a.TEXTURE_2D]=d(a.TEXTURE_2D,a.TEXTURE_2D,1);W[a.TEXTURE_CUBE_MAP]=d(a.TEXTURE_CUBE_MAP,a.TEXTURE_CUBE_MAP_POSITIVE_X,6);this.init=function(){this.clearColor(0,0,0,1);this.clearDepth(1);this.clearStencil(0);this.enable(a.DEPTH_TEST);this.setDepthFunc(THREE.LessEqualDepth);this.setFlipSided(!1);this.setCullFace(THREE.CullFaceBack);
-this.enable(a.CULL_FACE);this.enable(a.BLEND);this.setBlending(THREE.NormalBlending)};this.initAttributes=function(){for(var a=0,b=h.length;a<b;a++)h[a]=0};this.enableAttribute=function(c){h[c]=1;0===k[c]&&(a.enableVertexAttribArray(c),k[c]=1);0!==m[c]&&(b.get("ANGLE_instanced_arrays").vertexAttribDivisorANGLE(c,0),m[c]=0)};this.enableAttributeAndDivisor=function(b,c,d){h[b]=1;0===k[b]&&(a.enableVertexAttribArray(b),k[b]=1);m[b]!==c&&(d.vertexAttribDivisorANGLE(b,c),m[b]=c)};this.disableUnusedAttributes=
-function(){for(var b=0,c=k.length;b!==c;++b)k[b]!==h[b]&&(a.disableVertexAttribArray(b),k[b]=0)};this.enable=function(b){!0!==n[b]&&(a.enable(b),n[b]=!0)};this.disable=function(b){!1!==n[b]&&(a.disable(b),n[b]=!1)};this.getCompressedTextureFormats=function(){if(null===p&&(p=[],b.get("WEBGL_compressed_texture_pvrtc")||b.get("WEBGL_compressed_texture_s3tc")||b.get("WEBGL_compressed_texture_etc1")))for(var c=a.getParameter(a.COMPRESSED_TEXTURE_FORMATS),d=0;d<c.length;d++)p.push(c[d]);return p};this.setBlending=
-function(b,d,e,f,g,h,k,m){if(b!==THREE.NoBlending){this.enable(a.BLEND);if(b!==l||m!==D)b===THREE.AdditiveBlending?m?(a.blendEquationSeparate(a.FUNC_ADD,a.FUNC_ADD),a.blendFuncSeparate(a.ONE,a.ONE,a.ONE,a.ONE)):(a.blendEquation(a.FUNC_ADD),a.blendFunc(a.SRC_ALPHA,a.ONE)):b===THREE.SubtractiveBlending?m?(a.blendEquationSeparate(a.FUNC_ADD,a.FUNC_ADD),a.blendFuncSeparate(a.ZERO,a.ZERO,a.ONE_MINUS_SRC_COLOR,a.ONE_MINUS_SRC_ALPHA)):(a.blendEquation(a.FUNC_ADD),a.blendFunc(a.ZERO,a.ONE_MINUS_SRC_COLOR)):
-b===THREE.MultiplyBlending?m?(a.blendEquationSeparate(a.FUNC_ADD,a.FUNC_ADD),a.blendFuncSeparate(a.ZERO,a.ZERO,a.SRC_COLOR,a.SRC_ALPHA)):(a.blendEquation(a.FUNC_ADD),a.blendFunc(a.ZERO,a.SRC_COLOR)):m?(a.blendEquationSeparate(a.FUNC_ADD,a.FUNC_ADD),a.blendFuncSeparate(a.ONE,a.ONE_MINUS_SRC_ALPHA,a.ONE,a.ONE_MINUS_SRC_ALPHA)):(a.blendEquationSeparate(a.FUNC_ADD,a.FUNC_ADD),a.blendFuncSeparate(a.SRC_ALPHA,a.ONE_MINUS_SRC_ALPHA,a.ONE,a.ONE_MINUS_SRC_ALPHA)),l=b,D=m;if(b===THREE.CustomBlending){g=g||
-d;h=h||e;k=k||f;if(d!==q||g!==u)a.blendEquationSeparate(c(d),c(g)),q=d,u=g;if(e!==r||f!==s||h!==w||k!==v)a.blendFuncSeparate(c(e),c(f),c(h),c(k)),r=e,s=f,w=h,v=k}else v=w=u=s=r=q=null}else this.disable(a.BLEND),l=b};this.setDepthFunc=function(b){if(x!==b){if(b)switch(b){case THREE.NeverDepth:a.depthFunc(a.NEVER);break;case THREE.AlwaysDepth:a.depthFunc(a.ALWAYS);break;case THREE.LessDepth:a.depthFunc(a.LESS);break;case THREE.LessEqualDepth:a.depthFunc(a.LEQUAL);break;case THREE.EqualDepth:a.depthFunc(a.EQUAL);
-break;case THREE.GreaterEqualDepth:a.depthFunc(a.GEQUAL);break;case THREE.GreaterDepth:a.depthFunc(a.GREATER);break;case THREE.NotEqualDepth:a.depthFunc(a.NOTEQUAL);break;default:a.depthFunc(a.LEQUAL)}else a.depthFunc(a.LEQUAL);x=b}};this.setDepthTest=function(b){b?this.enable(a.DEPTH_TEST):this.disable(a.DEPTH_TEST)};this.setDepthWrite=function(b){B!==b&&(a.depthMask(b),B=b)};this.setColorWrite=function(b){A!==b&&(a.colorMask(b,b,b,b),A=b)};this.setStencilFunc=function(b,c,d){if(C!==b||M!==c||E!==
-d)a.stencilFunc(b,c,d),C=b,M=c,E=d};this.setStencilOp=function(b,c,d){if(z!==b||I!==c||Q!==d)a.stencilOp(b,c,d),z=b,I=c,Q=d};this.setStencilTest=function(b){b?this.enable(a.STENCIL_TEST):this.disable(a.STENCIL_TEST)};this.setStencilWrite=function(b){y!==b&&(a.stencilMask(b),y=b)};this.setFlipSided=function(b){N!==b&&(b?a.frontFace(a.CW):a.frontFace(a.CCW),N=b)};this.setCullFace=function(b){b!==THREE.CullFaceNone?(this.enable(a.CULL_FACE),b!==H&&(b===THREE.CullFaceBack?a.cullFace(a.BACK):b===THREE.CullFaceFront?
-a.cullFace(a.FRONT):a.cullFace(a.FRONT_AND_BACK))):this.disable(a.CULL_FACE);H=b};this.setLineWidth=function(b){b!==L&&(a.lineWidth(b),L=b)};this.setPolygonOffset=function(b,c,d){if(b){if(this.enable(a.POLYGON_OFFSET_FILL),J!==c||G!==d)a.polygonOffset(c,d),J=c,G=d}else this.disable(a.POLYGON_OFFSET_FILL)};this.getScissorTest=function(){return O};this.setScissorTest=function(b){(O=b)?this.enable(a.SCISSOR_TEST):this.disable(a.SCISSOR_TEST)};this.activeTexture=function(b){void 0===b&&(b=a.TEXTURE0+
-R-1);P!==b&&(a.activeTexture(b),P=b)};this.bindTexture=function(b,c){null===P&&e.activeTexture();var d=F[P];void 0===d&&(d={type:void 0,texture:void 0},F[P]=d);if(d.type!==b||d.texture!==c)a.bindTexture(b,c||W[b]),d.type=b,d.texture=c};this.compressedTexImage2D=function(){try{a.compressedTexImage2D.apply(a,arguments)}catch(b){console.error(b)}};this.texImage2D=function(){try{a.texImage2D.apply(a,arguments)}catch(b){console.error(b)}};this.clearColor=function(b,c,d,e){f.set(b,c,d,e);!1===$.equals(f)&&
-(a.clearColor(b,c,d,e),$.copy(f))};this.clearDepth=function(b){T!==b&&(a.clearDepth(b),T=b)};this.clearStencil=function(b){Y!==b&&(a.clearStencil(b),Y=b)};this.scissor=function(b){!1===fa.equals(b)&&(a.scissor(b.x,b.y,b.z,b.w),fa.copy(b))};this.viewport=function(b){!1===da.equals(b)&&(a.viewport(b.x,b.y,b.z,b.w),da.copy(b))};this.reset=function(){for(var b=0;b<k.length;b++)1===k[b]&&(a.disableVertexAttribArray(b),k[b]=0);n={};P=p=null;F={};H=N=y=B=A=l=null}};
+THREE.WebGLState=function(a,b,c){function d(b,c,d){var e=new Uint8Array(3),f=a.createTexture();a.bindTexture(b,f);a.texParameteri(b,a.TEXTURE_MIN_FILTER,a.NEAREST);a.texParameteri(b,a.TEXTURE_MAG_FILTER,a.NEAREST);for(b=0;b<d;b++)a.texImage2D(c+b,0,a.RGB,1,1,0,a.RGB,a.UNSIGNED_BYTE,e);return f}var e=this,f=new THREE.Vector4,g=a.getParameter(a.MAX_VERTEX_ATTRIBS),h=new Uint8Array(g),k=new Uint8Array(g),m=new Uint8Array(g),n={},p=null,l=null,q=null,r=null,s=null,u=null,w=null,v=null,D=!1,x=null,B=null,
+A=null,y=null,C=null,M=null,E=null,z=null,I=null,Q=null,N=null,H=null,L=null,J=null,G=null,O=null,R=a.getParameter(a.MAX_TEXTURE_IMAGE_UNITS),P=null,F={},$=new THREE.Vector4,T=null,Y=null,fa=new THREE.Vector4,da=new THREE.Vector4,W={};W[a.TEXTURE_2D]=d(a.TEXTURE_2D,a.TEXTURE_2D,1);W[a.TEXTURE_CUBE_MAP]=d(a.TEXTURE_CUBE_MAP,a.TEXTURE_CUBE_MAP_POSITIVE_X,6);this.init=function(){this.clearColor(0,0,0,1);this.clearDepth(1);this.clearStencil(0);this.enable(a.DEPTH_TEST);this.setDepthFunc(THREE.LessEqualDepth);
+this.setFlipSided(!1);this.setCullFace(THREE.CullFaceBack);this.enable(a.CULL_FACE);this.enable(a.BLEND);this.setBlending(THREE.NormalBlending)};this.initAttributes=function(){for(var a=0,b=h.length;a<b;a++)h[a]=0};this.enableAttribute=function(c){h[c]=1;0===k[c]&&(a.enableVertexAttribArray(c),k[c]=1);0!==m[c]&&(b.get("ANGLE_instanced_arrays").vertexAttribDivisorANGLE(c,0),m[c]=0)};this.enableAttributeAndDivisor=function(b,c,d){h[b]=1;0===k[b]&&(a.enableVertexAttribArray(b),k[b]=1);m[b]!==c&&(d.vertexAttribDivisorANGLE(b,
+c),m[b]=c)};this.disableUnusedAttributes=function(){for(var b=0,c=k.length;b!==c;++b)k[b]!==h[b]&&(a.disableVertexAttribArray(b),k[b]=0)};this.enable=function(b){!0!==n[b]&&(a.enable(b),n[b]=!0)};this.disable=function(b){!1!==n[b]&&(a.disable(b),n[b]=!1)};this.getCompressedTextureFormats=function(){if(null===p&&(p=[],b.get("WEBGL_compressed_texture_pvrtc")||b.get("WEBGL_compressed_texture_s3tc")||b.get("WEBGL_compressed_texture_etc1")))for(var c=a.getParameter(a.COMPRESSED_TEXTURE_FORMATS),d=0;d<
+c.length;d++)p.push(c[d]);return p};this.setBlending=function(b,d,e,f,g,h,k,m){if(b!==THREE.NoBlending){this.enable(a.BLEND);if(b!==l||m!==D)b===THREE.AdditiveBlending?m?(a.blendEquationSeparate(a.FUNC_ADD,a.FUNC_ADD),a.blendFuncSeparate(a.ONE,a.ONE,a.ONE,a.ONE)):(a.blendEquation(a.FUNC_ADD),a.blendFunc(a.SRC_ALPHA,a.ONE)):b===THREE.SubtractiveBlending?m?(a.blendEquationSeparate(a.FUNC_ADD,a.FUNC_ADD),a.blendFuncSeparate(a.ZERO,a.ZERO,a.ONE_MINUS_SRC_COLOR,a.ONE_MINUS_SRC_ALPHA)):(a.blendEquation(a.FUNC_ADD),
+a.blendFunc(a.ZERO,a.ONE_MINUS_SRC_COLOR)):b===THREE.MultiplyBlending?m?(a.blendEquationSeparate(a.FUNC_ADD,a.FUNC_ADD),a.blendFuncSeparate(a.ZERO,a.ZERO,a.SRC_COLOR,a.SRC_ALPHA)):(a.blendEquation(a.FUNC_ADD),a.blendFunc(a.ZERO,a.SRC_COLOR)):m?(a.blendEquationSeparate(a.FUNC_ADD,a.FUNC_ADD),a.blendFuncSeparate(a.ONE,a.ONE_MINUS_SRC_ALPHA,a.ONE,a.ONE_MINUS_SRC_ALPHA)):(a.blendEquationSeparate(a.FUNC_ADD,a.FUNC_ADD),a.blendFuncSeparate(a.SRC_ALPHA,a.ONE_MINUS_SRC_ALPHA,a.ONE,a.ONE_MINUS_SRC_ALPHA)),
+l=b,D=m;if(b===THREE.CustomBlending){g=g||d;h=h||e;k=k||f;if(d!==q||g!==u)a.blendEquationSeparate(c(d),c(g)),q=d,u=g;if(e!==r||f!==s||h!==w||k!==v)a.blendFuncSeparate(c(e),c(f),c(h),c(k)),r=e,s=f,w=h,v=k}else v=w=u=s=r=q=null}else this.disable(a.BLEND),l=b};this.setDepthFunc=function(b){if(x!==b){if(b)switch(b){case THREE.NeverDepth:a.depthFunc(a.NEVER);break;case THREE.AlwaysDepth:a.depthFunc(a.ALWAYS);break;case THREE.LessDepth:a.depthFunc(a.LESS);break;case THREE.LessEqualDepth:a.depthFunc(a.LEQUAL);
+break;case THREE.EqualDepth:a.depthFunc(a.EQUAL);break;case THREE.GreaterEqualDepth:a.depthFunc(a.GEQUAL);break;case THREE.GreaterDepth:a.depthFunc(a.GREATER);break;case THREE.NotEqualDepth:a.depthFunc(a.NOTEQUAL);break;default:a.depthFunc(a.LEQUAL)}else a.depthFunc(a.LEQUAL);x=b}};this.setDepthTest=function(b){b?this.enable(a.DEPTH_TEST):this.disable(a.DEPTH_TEST)};this.setDepthWrite=function(b){B!==b&&(a.depthMask(b),B=b)};this.setColorWrite=function(b){A!==b&&(a.colorMask(b,b,b,b),A=b)};this.setStencilFunc=
+function(b,c,d){if(C!==b||M!==c||E!==d)a.stencilFunc(b,c,d),C=b,M=c,E=d};this.setStencilOp=function(b,c,d){if(z!==b||I!==c||Q!==d)a.stencilOp(b,c,d),z=b,I=c,Q=d};this.setStencilTest=function(b){b?this.enable(a.STENCIL_TEST):this.disable(a.STENCIL_TEST)};this.setStencilWrite=function(b){y!==b&&(a.stencilMask(b),y=b)};this.setFlipSided=function(b){N!==b&&(b?a.frontFace(a.CW):a.frontFace(a.CCW),N=b)};this.setCullFace=function(b){b!==THREE.CullFaceNone?(this.enable(a.CULL_FACE),b!==H&&(b===THREE.CullFaceBack?
+a.cullFace(a.BACK):b===THREE.CullFaceFront?a.cullFace(a.FRONT):a.cullFace(a.FRONT_AND_BACK))):this.disable(a.CULL_FACE);H=b};this.setLineWidth=function(b){b!==L&&(a.lineWidth(b),L=b)};this.setPolygonOffset=function(b,c,d){if(b){if(this.enable(a.POLYGON_OFFSET_FILL),J!==c||G!==d)a.polygonOffset(c,d),J=c,G=d}else this.disable(a.POLYGON_OFFSET_FILL)};this.getScissorTest=function(){return O};this.setScissorTest=function(b){(O=b)?this.enable(a.SCISSOR_TEST):this.disable(a.SCISSOR_TEST)};this.activeTexture=
+function(b){void 0===b&&(b=a.TEXTURE0+R-1);P!==b&&(a.activeTexture(b),P=b)};this.bindTexture=function(b,c){null===P&&e.activeTexture();var d=F[P];void 0===d&&(d={type:void 0,texture:void 0},F[P]=d);if(d.type!==b||d.texture!==c)a.bindTexture(b,c||W[b]),d.type=b,d.texture=c};this.compressedTexImage2D=function(){try{a.compressedTexImage2D.apply(a,arguments)}catch(b){console.error(b)}};this.texImage2D=function(){try{a.texImage2D.apply(a,arguments)}catch(b){console.error(b)}};this.clearColor=function(b,
+c,d,e){f.set(b,c,d,e);!1===$.equals(f)&&(a.clearColor(b,c,d,e),$.copy(f))};this.clearDepth=function(b){T!==b&&(a.clearDepth(b),T=b)};this.clearStencil=function(b){Y!==b&&(a.clearStencil(b),Y=b)};this.scissor=function(b){!1===fa.equals(b)&&(a.scissor(b.x,b.y,b.z,b.w),fa.copy(b))};this.viewport=function(b){!1===da.equals(b)&&(a.viewport(b.x,b.y,b.z,b.w),da.copy(b))};this.reset=function(){for(var b=0;b<k.length;b++)1===k[b]&&(a.disableVertexAttribArray(b),k[b]=0);n={};P=p=null;F={};H=N=y=B=A=l=null}};
 THREE.WebGLUniforms=function(){var a=[],b=[],c=function(b,c,d){var e=b[0];if(0>=e||0<e)return b;var f=c*d,g=a[f];void 0===g&&(g=new Float32Array(f),a[f]=g);if(0!==c)for(e.toArray(g,0),e=1,f=0;e!==c;++e)f+=d,b[e].toArray(g,f);return g},d=function(a,c){var d=b[c];void 0===d&&(d=new Int32Array(c),b[c]=d);for(var e=0;e!==c;++e)d[e]=a.allocTextureUnit();return d},e=function(a,b){a.uniform1f(this.addr,b)},f=function(a,b){a.uniform1i(this.addr,b)},g=function(a,b){void 0===b.x?a.uniform2fv(this.addr,b):a.uniform2f(this.addr,
 b.x,b.y)},h=function(a,b){void 0!==b.x?a.uniform3f(this.addr,b.x,b.y,b.z):void 0!==b.r?a.uniform3f(this.addr,b.r,b.g,b.b):a.uniform3fv(this.addr,b)},k=function(a,b){void 0===b.x?a.uniform4fv(this.addr,b):a.uniform4f(this.addr,b.x,b.y,b.z,b.w)},m=function(a,b){a.uniformMatrix2fv(this.addr,!1,b.elements||b)},n=function(a,b){a.uniformMatrix3fv(this.addr,!1,b.elements||b)},p=function(a,b){a.uniformMatrix4fv(this.addr,!1,b.elements||b)},l=function(a,b,c){var d=c.allocTextureUnit();a.uniform1i(this.addr,
 d);b&&c.setTexture2D(b,d)},q=function(a,b,c){var d=c.allocTextureUnit();a.uniform1i(this.addr,d);b&&c.setTextureCube(b,d)},r=function(a,b){a.uniform2iv(this.addr,b)},s=function(a,b){a.uniform3iv(this.addr,b)},u=function(a,b){a.uniform4iv(this.addr,b)},w=function(a){switch(a){case 5126:return e;case 35664:return g;case 35665:return h;case 35666:return k;case 35674:return m;case 35675:return n;case 35676:return p;case 35678:return l;case 35680:return q;case 5124:case 35670:return f;case 35667:case 35671:return r;