|
@@ -26319,6 +26319,8 @@ function WebGLRenderer( parameters ) {
|
|
|
|
|
|
this.copyTextureToTexture = function ( position, srcTexture, dstTexture, level ) {
|
|
this.copyTextureToTexture = function ( position, srcTexture, dstTexture, level ) {
|
|
|
|
|
|
|
|
+ if ( level === undefined ) level = 0;
|
|
|
|
+
|
|
var width = srcTexture.image.width;
|
|
var width = srcTexture.image.width;
|
|
var height = srcTexture.image.height;
|
|
var height = srcTexture.image.height;
|
|
var glFormat = utils.convert( dstTexture.format );
|
|
var glFormat = utils.convert( dstTexture.format );
|
|
@@ -26328,14 +26330,16 @@ function WebGLRenderer( parameters ) {
|
|
|
|
|
|
if ( srcTexture.isDataTexture ) {
|
|
if ( srcTexture.isDataTexture ) {
|
|
|
|
|
|
- _gl.texSubImage2D( 3553, level || 0, position.x, position.y, width, height, glFormat, glType, srcTexture.image.data );
|
|
|
|
|
|
+ _gl.texSubImage2D( 3553, level, position.x, position.y, width, height, glFormat, glType, srcTexture.image.data );
|
|
|
|
|
|
} else {
|
|
} else {
|
|
|
|
|
|
- _gl.texSubImage2D( 3553, level || 0, position.x, position.y, glFormat, glType, srcTexture.image );
|
|
|
|
|
|
+ _gl.texSubImage2D( 3553, level, position.x, position.y, glFormat, glType, srcTexture.image );
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ if ( level === 0 && dstTexture.generateMipmaps ) _gl.generateMipmap( 3553 );
|
|
|
|
+
|
|
state.unbindTexture();
|
|
state.unbindTexture();
|
|
|
|
|
|
};
|
|
};
|