|
@@ -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 );
|
|
|
|
|
|
},
|
|
|
|