Quellcode durchsuchen

Updated builds.

Mr.doob vor 3 Jahren
Ursprung
Commit
990bd07f76
3 geänderte Dateien mit 31 neuen und 25 gelöschten Zeilen
  1. 14 13
      build/three.js
  2. 0 0
      build/three.min.js
  3. 17 12
      build/three.module.js

+ 14 - 13
build/three.js

@@ -11652,6 +11652,7 @@
 		dispose() {
 			this._blurMaterial.dispose();
 
+			if (this._pingPongRenderTarget !== null) this._pingPongRenderTarget.dispose();
 			if (this._cubemapShader !== null) this._cubemapShader.dispose();
 			if (this._equirectShader !== null) this._equirectShader.dispose();
 
@@ -11662,8 +11663,6 @@
 
 
 		_cleanup(outputTarget) {
-			this._pingPongRenderTarget.dispose();
-
 			this._renderer.setRenderTarget(_oldTarget);
 
 			outputTarget.scissorTest = false;
@@ -11700,7 +11699,11 @@
 			const cubeUVRenderTarget = _createRenderTarget(params);
 
 			cubeUVRenderTarget.depthBuffer = texture ? false : true;
-			this._pingPongRenderTarget = _createRenderTarget(params);
+
+			if (this._pingPongRenderTarget === null) {
+				this._pingPongRenderTarget = _createRenderTarget(params);
+			}
+
 			return cubeUVRenderTarget;
 		}
 
@@ -11746,10 +11749,10 @@
 			for (let i = 0; i < 6; i++) {
 				const col = i % 3;
 
-				if (col == 0) {
+				if (col === 0) {
 					cubeCamera.up.set(0, upSign[i], 0);
 					cubeCamera.lookAt(forwardSign[i], 0, 0);
-				} else if (col == 1) {
+				} else if (col === 1) {
 					cubeCamera.up.set(0, 0, upSign[i]);
 					cubeCamera.lookAt(0, forwardSign[i], 0);
 				} else {
@@ -11780,13 +11783,13 @@
 			const isCubeTexture = texture.mapping === CubeReflectionMapping || texture.mapping === CubeRefractionMapping;
 
 			if (isCubeTexture) {
-				if (this._cubemapShader == null) {
+				if (this._cubemapShader === null) {
 					this._cubemapShader = _getCubemapShader();
 				}
 
 				this._cubemapShader.uniforms.flipEnvMap.value = texture.isRenderTargetTexture === false ? -1 : 1;
 			} else {
-				if (this._equirectShader == null) {
+				if (this._equirectShader === null) {
 					this._equirectShader = _getEquirectShader();
 				}
 			}
@@ -11866,7 +11869,7 @@
 				const weight = Math.exp(-x * x / 2);
 				weights.push(weight);
 
-				if (i == 0) {
+				if (i === 0) {
 					sum += weight;
 				} else if (i < samples) {
 					sum += 2 * weight;
@@ -11915,7 +11918,7 @@
 
 			if (i > LOD_MAX - LOD_MIN) {
 				sigma = EXTRA_LOD_SIGMA[i - LOD_MAX + LOD_MIN - 1];
-			} else if (i == 0) {
+			} else if (i === 0) {
 				sigma = 0;
 			}
 
@@ -15957,16 +15960,14 @@
 						needsUpdate = true;
 					}
 				} else {
-					if (drawBuffers.length !== 1 || drawBuffers[0] !== gl.COLOR_ATTACHMENT0) {
+					if (drawBuffers[0] !== gl.COLOR_ATTACHMENT0) {
 						drawBuffers[0] = gl.COLOR_ATTACHMENT0;
-						drawBuffers.length = 1;
 						needsUpdate = true;
 					}
 				}
 			} else {
-				if (drawBuffers.length !== 1 || drawBuffers[0] !== gl.BACK) {
+				if (drawBuffers[0] !== gl.BACK) {
 					drawBuffers[0] = gl.BACK;
-					drawBuffers.length = 1;
 					needsUpdate = true;
 				}
 			}

Datei-Diff unterdrückt, da er zu groß ist
+ 0 - 0
build/three.min.js


+ 17 - 12
build/three.module.js

@@ -15209,6 +15209,8 @@ class PMREMGenerator {
 
 		this._blurMaterial.dispose();
 
+		if ( this._pingPongRenderTarget !== null ) this._pingPongRenderTarget.dispose();
+
 		if ( this._cubemapShader !== null ) this._cubemapShader.dispose();
 		if ( this._equirectShader !== null ) this._equirectShader.dispose();
 
@@ -15224,7 +15226,6 @@ class PMREMGenerator {
 
 	_cleanup( outputTarget ) {
 
-		this._pingPongRenderTarget.dispose();
 		this._renderer.setRenderTarget( _oldTarget );
 		outputTarget.scissorTest = false;
 		_setViewport( outputTarget, 0, 0, outputTarget.width, outputTarget.height );
@@ -15257,7 +15258,13 @@ class PMREMGenerator {
 
 		const cubeUVRenderTarget = _createRenderTarget( params );
 		cubeUVRenderTarget.depthBuffer = texture ? false : true;
-		this._pingPongRenderTarget = _createRenderTarget( params );
+
+		if ( this._pingPongRenderTarget === null ) {
+
+			this._pingPongRenderTarget = _createRenderTarget( params );
+
+		}
+
 		return cubeUVRenderTarget;
 
 	}
@@ -15317,12 +15324,12 @@ class PMREMGenerator {
 		for ( let i = 0; i < 6; i ++ ) {
 
 			const col = i % 3;
-			if ( col == 0 ) {
+			if ( col === 0 ) {
 
 				cubeCamera.up.set( 0, upSign[ i ], 0 );
 				cubeCamera.lookAt( forwardSign[ i ], 0, 0 );
 
-			} else if ( col == 1 ) {
+			} else if ( col === 1 ) {
 
 				cubeCamera.up.set( 0, 0, upSign[ i ] );
 				cubeCamera.lookAt( 0, forwardSign[ i ], 0 );
@@ -15365,7 +15372,7 @@ class PMREMGenerator {
 
 		if ( isCubeTexture ) {
 
-			if ( this._cubemapShader == null ) {
+			if ( this._cubemapShader === null ) {
 
 				this._cubemapShader = _getCubemapShader();
 
@@ -15375,7 +15382,7 @@ class PMREMGenerator {
 
 		} else {
 
-			if ( this._equirectShader == null ) {
+			if ( this._equirectShader === null ) {
 
 				this._equirectShader = _getEquirectShader();
 
@@ -15494,7 +15501,7 @@ class PMREMGenerator {
 			const weight = Math.exp( - x * x / 2 );
 			weights.push( weight );
 
-			if ( i == 0 ) {
+			if ( i === 0 ) {
 
 				sum += weight;
 
@@ -15556,7 +15563,7 @@ function _createPlanes() {
 
 			sigma = EXTRA_LOD_SIGMA[ i - LOD_MAX + LOD_MIN - 1 ];
 
-		} else if ( i == 0 ) {
+		} else if ( i === 0 ) {
 
 			sigma = 0;
 
@@ -21330,10 +21337,9 @@ function WebGLState( gl, extensions, capabilities ) {
 
 			} else {
 
-				if ( drawBuffers.length !== 1 || drawBuffers[ 0 ] !== 36064 ) {
+				if ( drawBuffers[ 0 ] !== 36064 ) {
 
 					drawBuffers[ 0 ] = 36064;
-					drawBuffers.length = 1;
 
 					needsUpdate = true;
 
@@ -21343,10 +21349,9 @@ function WebGLState( gl, extensions, capabilities ) {
 
 		} else {
 
-			if ( drawBuffers.length !== 1 || drawBuffers[ 0 ] !== 1029 ) {
+			if ( drawBuffers[ 0 ] !== 1029 ) {
 
 				drawBuffers[ 0 ] = 1029;
-				drawBuffers.length = 1;
 
 				needsUpdate = true;
 

Einige Dateien werden nicht angezeigt, da zu viele Dateien in diesem Diff geändert wurden.