Bläddra i källkod

Updated builds.

Mr.doob 5 år sedan
förälder
incheckning
c6d9ebc40b
3 ändrade filer med 8 tillägg och 4 borttagningar
  1. 2 0
      build/three.js
  2. 4 4
      build/three.min.js
  3. 2 0
      build/three.module.js

+ 2 - 0
build/three.js

@@ -23815,6 +23815,8 @@
 
 			animation.stop();
 
+			this.forceContextLoss();
+
 		};
 
 		// Events

+ 4 - 4
build/three.min.js

@@ -205,10 +205,10 @@ function(){var a=ra.get("WEBGL_lose_context");a&&a.loseContext()};this.forceCont
 (S=a,J=b,v.width=Math.floor(a*Q),v.height=Math.floor(b*Q),!1!==c&&(v.style.width=a+"px",v.style.height=b+"px"),this.setViewport(0,0,a,b))};this.getDrawingBufferSize=function(a){void 0===a&&(console.warn("WebGLRenderer: .getdrawingBufferSize() now requires a Vector2 as an argument"),a=new u);return a.set(S*Q,J*Q).floor()};this.setDrawingBufferSize=function(a,b,c){S=a;J=b;Q=c;v.width=Math.floor(a*c);v.height=Math.floor(b*c);this.setViewport(0,0,a,b)};this.getCurrentViewport=function(a){void 0===a&&
 (console.warn("WebGLRenderer: .getCurrentViewport() now requires a Vector4 as an argument"),a=new ka);return a.copy(aa)};this.getViewport=function(a){return a.copy(R)};this.setViewport=function(a,b,c,d){a.isVector4?R.set(a.x,a.y,a.z,a.w):R.set(a,b,c,d);Z.viewport(aa.copy(R).multiplyScalar(Q).floor())};this.getScissor=function(a){return a.copy(ja)};this.setScissor=function(a,b,c,d){a.isVector4?ja.set(a.x,a.y,a.z,a.w):ja.set(a,b,c,d);Z.scissor(U.copy(ja).multiplyScalar(Q).floor())};this.getScissorTest=
 function(){return jg};this.setScissorTest=function(a){Z.setScissorTest(jg=a)};this.setOpaqueSort=function(a){la=a};this.setTransparentSort=function(a){ma=a};this.getClearColor=function(){return pa.getClearColor()};this.setClearColor=function(){pa.setClearColor.apply(pa,arguments)};this.getClearAlpha=function(){return pa.getClearAlpha()};this.setClearAlpha=function(){pa.setClearAlpha.apply(pa,arguments)};this.clear=function(a,b,c){var d=0;if(void 0===a||a)d|=16384;if(void 0===b||b)d|=256;if(void 0===
-c||c)d|=1024;I.clear(d)};this.clearColor=function(){this.clear(!0,!1,!1)};this.clearDepth=function(){this.clear(!1,!0,!1)};this.clearStencil=function(){this.clear(!1,!1,!0)};this.dispose=function(){v.removeEventListener("webglcontextlost",d,!1);v.removeEventListener("webglcontextrestored",e,!1);wa.dispose();va.dispose();Y.dispose();sa.dispose();ua.dispose();za.stop()};this.renderBufferImmediate=function(a,b){Z.initAttributes();var c=Y.get(a);a.hasPositions&&!c.position&&(c.position=I.createBuffer());
-a.hasNormals&&!c.normal&&(c.normal=I.createBuffer());a.hasUvs&&!c.uv&&(c.uv=I.createBuffer());a.hasColors&&!c.color&&(c.color=I.createBuffer());b=b.getAttributes();a.hasPositions&&(I.bindBuffer(34962,c.position),I.bufferData(34962,a.positionArray,35048),Z.enableAttribute(b.position),I.vertexAttribPointer(b.position,3,5126,!1,0,0));a.hasNormals&&(I.bindBuffer(34962,c.normal),I.bufferData(34962,a.normalArray,35048),Z.enableAttribute(b.normal),I.vertexAttribPointer(b.normal,3,5126,!1,0,0));a.hasUvs&&
-(I.bindBuffer(34962,c.uv),I.bufferData(34962,a.uvArray,35048),Z.enableAttribute(b.uv),I.vertexAttribPointer(b.uv,2,5126,!1,0,0));a.hasColors&&(I.bindBuffer(34962,c.color),I.bufferData(34962,a.colorArray,35048),Z.enableAttribute(b.color),I.vertexAttribPointer(b.color,3,5126,!1,0,0));Z.disableUnusedAttributes();I.drawArrays(4,0,a.count);a.count=0};var Ga=new ob;this.renderBufferDirect=function(a,c,d,e,f,g){null===c&&(c=Ga);var h=f.isMesh&&0>f.matrixWorld.determinant(),l=x(a,c,e,f);Z.setMaterial(e,h);
-var m=!1;if(b!==d.id||ha!==l.id||Pe!==(!0===e.wireframe))b=d.id,ha=l.id,Pe=!0===e.wireframe,m=!0;if(e.morphTargets||e.morphNormals)ya.update(f,d,e,l),m=!0;a=d.index;c=d.attributes.position;if(null===a){if(void 0===c||0===c.count)return}else if(0===a.count)return;var t=1;!0===e.wireframe&&(a=xa.getWireframeAttribute(d),t=2);h=Aa;if(null!==a){var p=oa.get(a);h=Ba;h.setIndex(p)}if(m){if(!1!==Fa.isWebGL2||!f.isInstancedMesh&&!d.isInstancedBufferGeometry||null!==ra.get("ANGLE_instanced_arrays")){Z.initAttributes();
+c||c)d|=1024;I.clear(d)};this.clearColor=function(){this.clear(!0,!1,!1)};this.clearDepth=function(){this.clear(!1,!0,!1)};this.clearStencil=function(){this.clear(!1,!1,!0)};this.dispose=function(){v.removeEventListener("webglcontextlost",d,!1);v.removeEventListener("webglcontextrestored",e,!1);wa.dispose();va.dispose();Y.dispose();sa.dispose();ua.dispose();za.stop();this.forceContextLoss()};this.renderBufferImmediate=function(a,b){Z.initAttributes();var c=Y.get(a);a.hasPositions&&!c.position&&(c.position=
+I.createBuffer());a.hasNormals&&!c.normal&&(c.normal=I.createBuffer());a.hasUvs&&!c.uv&&(c.uv=I.createBuffer());a.hasColors&&!c.color&&(c.color=I.createBuffer());b=b.getAttributes();a.hasPositions&&(I.bindBuffer(34962,c.position),I.bufferData(34962,a.positionArray,35048),Z.enableAttribute(b.position),I.vertexAttribPointer(b.position,3,5126,!1,0,0));a.hasNormals&&(I.bindBuffer(34962,c.normal),I.bufferData(34962,a.normalArray,35048),Z.enableAttribute(b.normal),I.vertexAttribPointer(b.normal,3,5126,
+!1,0,0));a.hasUvs&&(I.bindBuffer(34962,c.uv),I.bufferData(34962,a.uvArray,35048),Z.enableAttribute(b.uv),I.vertexAttribPointer(b.uv,2,5126,!1,0,0));a.hasColors&&(I.bindBuffer(34962,c.color),I.bufferData(34962,a.colorArray,35048),Z.enableAttribute(b.color),I.vertexAttribPointer(b.color,3,5126,!1,0,0));Z.disableUnusedAttributes();I.drawArrays(4,0,a.count);a.count=0};var Ga=new ob;this.renderBufferDirect=function(a,c,d,e,f,g){null===c&&(c=Ga);var h=f.isMesh&&0>f.matrixWorld.determinant(),l=x(a,c,e,f);
+Z.setMaterial(e,h);var m=!1;if(b!==d.id||ha!==l.id||Pe!==(!0===e.wireframe))b=d.id,ha=l.id,Pe=!0===e.wireframe,m=!0;if(e.morphTargets||e.morphNormals)ya.update(f,d,e,l),m=!0;a=d.index;c=d.attributes.position;if(null===a){if(void 0===c||0===c.count)return}else if(0===a.count)return;var t=1;!0===e.wireframe&&(a=xa.getWireframeAttribute(d),t=2);h=Aa;if(null!==a){var p=oa.get(a);h=Ba;h.setIndex(p)}if(m){if(!1!==Fa.isWebGL2||!f.isInstancedMesh&&!d.isInstancedBufferGeometry||null!==ra.get("ANGLE_instanced_arrays")){Z.initAttributes();
 m=d.attributes;l=l.getAttributes();var k=e.defaultAttributeValues;for(T in l){var q=l[T];if(0<=q){var r=m[T];if(void 0!==r){var n=r.normalized,v=r.itemSize,w=oa.get(r);if(void 0!==w){var C=w.buffer,y=w.type;w=w.bytesPerElement;if(r.isInterleavedBufferAttribute){var F=r.data,u=F.stride;r=r.offset;F&&F.isInstancedInterleavedBuffer?(Z.enableAttributeAndDivisor(q,F.meshPerAttribute),void 0===d.maxInstancedCount&&(d.maxInstancedCount=F.meshPerAttribute*F.count)):Z.enableAttribute(q);I.bindBuffer(34962,
 C);I.vertexAttribPointer(q,v,y,n,u*w,r*w)}else r.isInstancedBufferAttribute?(Z.enableAttributeAndDivisor(q,r.meshPerAttribute),void 0===d.maxInstancedCount&&(d.maxInstancedCount=r.meshPerAttribute*r.count)):Z.enableAttribute(q),I.bindBuffer(34962,C),I.vertexAttribPointer(q,v,y,n,0,0)}}else if("instanceMatrix"===T)w=oa.get(f.instanceMatrix),void 0!==w&&(C=w.buffer,y=w.type,Z.enableAttributeAndDivisor(q+0,1),Z.enableAttributeAndDivisor(q+1,1),Z.enableAttributeAndDivisor(q+2,1),Z.enableAttributeAndDivisor(q+
 3,1),I.bindBuffer(34962,C),I.vertexAttribPointer(q+0,4,y,!1,64,0),I.vertexAttribPointer(q+1,4,y,!1,64,16),I.vertexAttribPointer(q+2,4,y,!1,64,32),I.vertexAttribPointer(q+3,4,y,!1,64,48));else if(void 0!==k&&(n=k[T],void 0!==n))switch(n.length){case 2:I.vertexAttrib2fv(q,n);break;case 3:I.vertexAttrib3fv(q,n);break;case 4:I.vertexAttrib4fv(q,n);break;default:I.vertexAttrib1fv(q,n)}}}Z.disableUnusedAttributes()}null!==a&&I.bindBuffer(34963,p.buffer)}var T=d.drawRange.start*t;m=null!==g?g.start*t:0;

+ 2 - 0
build/three.module.js

@@ -23807,6 +23807,8 @@ function WebGLRenderer( parameters ) {
 
 		animation.stop();
 
+		this.forceContextLoss();
+
 	};
 
 	// Events