Ver Fonte

Updated builds.

Mr.doob há 9 anos atrás
pai
commit
ef7d141a7d
2 ficheiros alterados com 8 adições e 3 exclusões
  1. 7 2
      build/three.js
  2. 1 1
      build/three.min.js

+ 7 - 2
build/three.js

@@ -25211,9 +25211,13 @@ THREE.WebGLRenderer = function ( parameters ) {
 
 
 		}
 		}
 
 
-		if ( geometry instanceof THREE.InstancedBufferGeometry && geometry.maxInstancedCount > 0 ) {
+		if ( geometry instanceof THREE.InstancedBufferGeometry ) {
+
+			if ( geometry.maxInstancedCount > 0 ) {
 
 
-			renderer.renderInstances( geometry, drawStart, drawCount );
+				renderer.renderInstances( geometry, drawStart, drawCount );
+
+			}
 
 
 		} else {
 		} else {
 
 
@@ -26024,6 +26028,7 @@ THREE.WebGLRenderer = function ( parameters ) {
 				_gl.uniform1f( p_uniforms.toneMappingWhitePoint, _this.toneMappingWhitePoint );
 				_gl.uniform1f( p_uniforms.toneMappingWhitePoint, _this.toneMappingWhitePoint );
 
 
 			}
 			}
+
 		}
 		}
 
 
 		// skinning uniforms must be set even if material didn't change
 		// skinning uniforms must be set even if material didn't change

+ 1 - 1
build/three.min.js

@@ -646,7 +646,7 @@ a=Da;if(h){a:{var h=void 0,n;if(c instanceof THREE.InstancedBufferGeometry&&(n=V
 THREE.InterleavedBufferAttribute){var E=u.data,y=E.stride,u=u.offset;E instanceof THREE.InstancedInterleavedBuffer?(J.enableAttributeAndDivisor(s,E.meshPerAttribute,n),void 0===c.maxInstancedCount&&(c.maxInstancedCount=E.meshPerAttribute*E.count)):J.enableAttribute(s);r.bindBuffer(r.ARRAY_BUFFER,x);r.vertexAttribPointer(s,w,r.FLOAT,!1,y*E.array.BYTES_PER_ELEMENT,(h*y+u)*E.array.BYTES_PER_ELEMENT)}else u instanceof THREE.InstancedBufferAttribute?(J.enableAttributeAndDivisor(s,u.meshPerAttribute,n),
 THREE.InterleavedBufferAttribute){var E=u.data,y=E.stride,u=u.offset;E instanceof THREE.InstancedInterleavedBuffer?(J.enableAttributeAndDivisor(s,E.meshPerAttribute,n),void 0===c.maxInstancedCount&&(c.maxInstancedCount=E.meshPerAttribute*E.count)):J.enableAttribute(s);r.bindBuffer(r.ARRAY_BUFFER,x);r.vertexAttribPointer(s,w,r.FLOAT,!1,y*E.array.BYTES_PER_ELEMENT,(h*y+u)*E.array.BYTES_PER_ELEMENT)}else u instanceof THREE.InstancedBufferAttribute?(J.enableAttributeAndDivisor(s,u.meshPerAttribute,n),
 void 0===c.maxInstancedCount&&(c.maxInstancedCount=u.meshPerAttribute*u.count)):J.enableAttribute(s),r.bindBuffer(r.ARRAY_BUFFER,x),r.vertexAttribPointer(s,w,r.FLOAT,!1,0,h*w*4)}else if(void 0!==p&&(w=p[q],void 0!==w))switch(w.length){case 2:r.vertexAttrib2fv(s,w);break;case 3:r.vertexAttrib3fv(s,w);break;case 4:r.vertexAttrib4fv(s,w);break;default:r.vertexAttrib1fv(s,w)}}}J.disableUnusedAttributes()}null!==b&&r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,pa.getAttributeBuffer(b))}n=Infinity;null!==b?n=b.count:
 void 0===c.maxInstancedCount&&(c.maxInstancedCount=u.meshPerAttribute*u.count)):J.enableAttribute(s),r.bindBuffer(r.ARRAY_BUFFER,x),r.vertexAttribPointer(s,w,r.FLOAT,!1,0,h*w*4)}else if(void 0!==p&&(w=p[q],void 0!==w))switch(w.length){case 2:r.vertexAttrib2fv(s,w);break;case 3:r.vertexAttrib3fv(s,w);break;case 4:r.vertexAttrib4fv(s,w);break;default:r.vertexAttrib1fv(s,w)}}}J.disableUnusedAttributes()}null!==b&&r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,pa.getAttributeBuffer(b))}n=Infinity;null!==b?n=b.count:
 void 0!==k&&(n=k.count);q=c.drawRange.start;b=c.drawRange.count;k=null!==f?f.start:0;h=null!==f?f.count:Infinity;f=Math.max(0,q,k);n=Math.min(0+n,q+b,k+h)-1;n=Math.max(0,n-f+1);if(e instanceof THREE.Mesh)if(!0===d.wireframe)J.setLineWidth(d.wireframeLinewidth*(null===ea?$:1)),a.setMode(r.LINES);else switch(e.drawMode){case THREE.TrianglesDrawMode:a.setMode(r.TRIANGLES);break;case THREE.TriangleStripDrawMode:a.setMode(r.TRIANGLE_STRIP);break;case THREE.TriangleFanDrawMode:a.setMode(r.TRIANGLE_FAN)}else e instanceof
 void 0!==k&&(n=k.count);q=c.drawRange.start;b=c.drawRange.count;k=null!==f?f.start:0;h=null!==f?f.count:Infinity;f=Math.max(0,q,k);n=Math.min(0+n,q+b,k+h)-1;n=Math.max(0,n-f+1);if(e instanceof THREE.Mesh)if(!0===d.wireframe)J.setLineWidth(d.wireframeLinewidth*(null===ea?$:1)),a.setMode(r.LINES);else switch(e.drawMode){case THREE.TrianglesDrawMode:a.setMode(r.TRIANGLES);break;case THREE.TriangleStripDrawMode:a.setMode(r.TRIANGLE_STRIP);break;case THREE.TriangleFanDrawMode:a.setMode(r.TRIANGLE_FAN)}else e instanceof
-THREE.Line?(d=d.linewidth,void 0===d&&(d=1),J.setLineWidth(d*(null===ea?$: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,n):a.render(f,n)};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;na="";ra=-1;la=null;!0===
+THREE.Line?(d=d.linewidth,void 0===d&&(d=1),J.setLineWidth(d*(null===ea?$: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,n):a.render(f,n)};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;na="";ra=-1;la=null;!0===
 a.autoUpdate&&a.updateMatrixWorld();null===b.parent&&b.updateMatrixWorld();b.matrixWorldInverse.getInverse(b.matrixWorld);sa.multiplyMatrices(b.projectionMatrix,b.matrixWorldInverse);ya.setFromMatrix(sa);R.length=0;W=F=-1;ca.length=0;ia.length=0;q(a,b);I.length=F+1;U.length=W+1;!0===X.sortObjects&&(I.sort(n),U.sort(p));var f=R,g,h,k,l=0,m=0,s=0,t,v,w,x=b.matrixWorldInverse,E=0,y=0,A=0,Z=0,B=0;g=S.shadowsPointLight=0;for(h=f.length;g<h;g++)if(k=f[g],t=k.color,v=k.intensity,w=k.distance,k instanceof
 a.autoUpdate&&a.updateMatrixWorld();null===b.parent&&b.updateMatrixWorld();b.matrixWorldInverse.getInverse(b.matrixWorld);sa.multiplyMatrices(b.projectionMatrix,b.matrixWorldInverse);ya.setFromMatrix(sa);R.length=0;W=F=-1;ca.length=0;ia.length=0;q(a,b);I.length=F+1;U.length=W+1;!0===X.sortObjects&&(I.sort(n),U.sort(p));var f=R,g,h,k,l=0,m=0,s=0,t,v,w,x=b.matrixWorldInverse,E=0,y=0,A=0,Z=0,B=0;g=S.shadowsPointLight=0;for(h=f.length;g<h;g++)if(k=f[g],t=k.color,v=k.intensity,w=k.distance,k instanceof
 THREE.AmbientLight)l+=t.r*v,m+=t.g*v,s+=t.b*v;else if(k instanceof THREE.DirectionalLight){var z=wa.get(k);z.color.copy(k.color).multiplyScalar(k.intensity);z.direction.setFromMatrixPosition(k.matrixWorld);Y.setFromMatrixPosition(k.target.matrixWorld);z.direction.sub(Y);z.direction.transformDirection(x);if(z.shadow=k.castShadow)z.shadowBias=k.shadow.bias,z.shadowRadius=k.shadow.radius,z.shadowMapSize=k.shadow.mapSize,S.shadows[B++]=k;S.directionalShadowMap[E]=k.shadow.map;S.directionalShadowMatrix[E]=
 THREE.AmbientLight)l+=t.r*v,m+=t.g*v,s+=t.b*v;else if(k instanceof THREE.DirectionalLight){var z=wa.get(k);z.color.copy(k.color).multiplyScalar(k.intensity);z.direction.setFromMatrixPosition(k.matrixWorld);Y.setFromMatrixPosition(k.target.matrixWorld);z.direction.sub(Y);z.direction.transformDirection(x);if(z.shadow=k.castShadow)z.shadowBias=k.shadow.bias,z.shadowRadius=k.shadow.radius,z.shadowMapSize=k.shadow.mapSize,S.shadows[B++]=k;S.directionalShadowMap[E]=k.shadow.map;S.directionalShadowMatrix[E]=
 k.shadow.matrix;S.directional[E++]=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=w;z.direction.setFromMatrixPosition(k.matrixWorld);Y.setFromMatrixPosition(k.target.matrixWorld);z.direction.sub(Y);z.direction.transformDirection(x);z.coneCos=Math.cos(k.angle);z.penumbraCos=Math.cos(k.angle*(1-k.penumbra));z.decay=0===k.distance?0:k.decay;if(z.shadow=k.castShadow)z.shadowBias=
 k.shadow.matrix;S.directional[E++]=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=w;z.direction.setFromMatrixPosition(k.matrixWorld);Y.setFromMatrixPosition(k.target.matrixWorld);z.direction.sub(Y);z.direction.transformDirection(x);z.coneCos=Math.cos(k.angle);z.penumbraCos=Math.cos(k.angle*(1-k.penumbra));z.decay=0===k.distance?0:k.decay;if(z.shadow=k.castShadow)z.shadowBias=