|
@@ -2801,7 +2801,7 @@ function WebGLRenderer( parameters ) {
|
|
|
|
|
|
};
|
|
|
|
|
|
- this.copyTextureToTexture = function ( position, srcTexture, dstTexture, level ) {
|
|
|
+ this.copyTextureToTexture = function ( position, srcTexture, dstTexture, level = 0 ) {
|
|
|
|
|
|
var width = srcTexture.image.width;
|
|
|
var height = srcTexture.image.height;
|
|
@@ -2812,15 +2812,15 @@ function WebGLRenderer( parameters ) {
|
|
|
|
|
|
if ( srcTexture.isDataTexture ) {
|
|
|
|
|
|
- _gl.texSubImage2D( _gl.TEXTURE_2D, level || 0, position.x, position.y, width, height, glFormat, glType, srcTexture.image.data );
|
|
|
+ _gl.texSubImage2D( _gl.TEXTURE_2D, level, position.x, position.y, width, height, glFormat, glType, srcTexture.image.data );
|
|
|
|
|
|
} else {
|
|
|
|
|
|
- _gl.texSubImage2D( _gl.TEXTURE_2D, level || 0, position.x, position.y, glFormat, glType, srcTexture.image );
|
|
|
+ _gl.texSubImage2D( _gl.TEXTURE_2D, level, position.x, position.y, glFormat, glType, srcTexture.image );
|
|
|
|
|
|
}
|
|
|
|
|
|
- if (dstTexture.generateMipmaps) _gl.generateMipmap( _gl.TEXTURE_2D );
|
|
|
+ if ( level == 0 && dstTexture.generateMipmaps ) _gl.generateMipmap( _gl.TEXTURE_2D );
|
|
|
|
|
|
state.unbindTexture();
|
|
|
|