2
0
Mr.doob 5 жил өмнө
parent
commit
1cd928aafc
3 өөрчлөгдсөн 231 нэмэгдсэн , 207 устгасан
  1. 14 2
      build/three.js
  2. 203 203
      build/three.min.js
  3. 14 2
      build/three.module.js

+ 14 - 2
build/three.js

@@ -20683,6 +20683,8 @@
 				var light = lights[ i ];
 				var shadow = light.shadow;
 
+				if ( shadow.autoUpdate === false && shadow.needsUpdate === false ) { continue; }
+
 				if ( shadow === undefined ) {
 
 					console.warn( 'THREE.WebGLShadowMap:', light, 'has no shadow.' );
@@ -20776,6 +20778,8 @@
 
 				}
 
+				shadow.needsUpdate = false;
+
 			}
 
 			scope.needsUpdate = false;
@@ -26686,6 +26690,12 @@
 
 			textures.setTexture2D( dstTexture, 0 );
 
+			// As another texture upload may have changed pixelStorei
+			// parameters, make sure they are correct for the dstTexture
+			_gl.pixelStorei( 37440, dstTexture.flipY );
+			_gl.pixelStorei( 37441, dstTexture.premultiplyAlpha );
+			_gl.pixelStorei( 3317, dstTexture.unpackAlignment );
+
 			if ( srcTexture.isDataTexture ) {
 
 				_gl.texSubImage2D( 3553, level, position.x, position.y, width, height, glFormat, glType, srcTexture.image.data );
@@ -39614,6 +39624,9 @@
 		this.mapPass = null;
 		this.matrix = new Matrix4();
 
+		this.autoUpdate = true;
+		this.needsUpdate = false;
+
 		this._frustum = new Frustum();
 		this._frameExtents = new Vector2( 1, 1 );
 
@@ -48782,8 +48795,7 @@
 			this._pingPongRenderTarget.dispose();
 			this._renderer.setRenderTarget( _oldTarget );
 			outputTarget.scissorTest = false;
-			// reset viewport and scissor
-			outputTarget.setSize( outputTarget.width, outputTarget.height );
+			_setViewport( outputTarget, 0, 0, outputTarget.width, outputTarget.height );
 
 		},
 

Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 203 - 203
build/three.min.js


+ 14 - 2
build/three.module.js

@@ -20648,6 +20648,8 @@ function WebGLShadowMap( _renderer, _objects, maxTextureSize ) {
 			const light = lights[ i ];
 			const shadow = light.shadow;
 
+			if ( shadow.autoUpdate === false && shadow.needsUpdate === false ) continue;
+
 			if ( shadow === undefined ) {
 
 				console.warn( 'THREE.WebGLShadowMap:', light, 'has no shadow.' );
@@ -20741,6 +20743,8 @@ function WebGLShadowMap( _renderer, _objects, maxTextureSize ) {
 
 			}
 
+			shadow.needsUpdate = false;
+
 		}
 
 		scope.needsUpdate = false;
@@ -26656,6 +26660,12 @@ function WebGLRenderer( parameters ) {
 
 		textures.setTexture2D( dstTexture, 0 );
 
+		// As another texture upload may have changed pixelStorei
+		// parameters, make sure they are correct for the dstTexture
+		_gl.pixelStorei( 37440, dstTexture.flipY );
+		_gl.pixelStorei( 37441, dstTexture.premultiplyAlpha );
+		_gl.pixelStorei( 3317, dstTexture.unpackAlignment );
+
 		if ( srcTexture.isDataTexture ) {
 
 			_gl.texSubImage2D( 3553, level, position.x, position.y, width, height, glFormat, glType, srcTexture.image.data );
@@ -39582,6 +39592,9 @@ function LightShadow( camera ) {
 	this.mapPass = null;
 	this.matrix = new Matrix4();
 
+	this.autoUpdate = true;
+	this.needsUpdate = false;
+
 	this._frustum = new Frustum();
 	this._frameExtents = new Vector2( 1, 1 );
 
@@ -48744,8 +48757,7 @@ PMREMGenerator.prototype = {
 		this._pingPongRenderTarget.dispose();
 		this._renderer.setRenderTarget( _oldTarget );
 		outputTarget.scissorTest = false;
-		// reset viewport and scissor
-		outputTarget.setSize( outputTarget.width, outputTarget.height );
+		_setViewport( outputTarget, 0, 0, outputTarget.width, outputTarget.height );
 
 	},
 

Энэ ялгаанд хэт олон файл өөрчлөгдсөн тул зарим файлыг харуулаагүй болно