浏览代码

WebGLRenderer: Fixed compressed partial update on texture3D (#27771)

* Fixed compressed partial update on texture3D and add example to e2e tests

* removed example
Renaud Rohlinger 1 年之前
父节点
当前提交
cfdd878cf7
共有 1 个文件被更改,包括 3 次插入4 次删除
  1. 3 4
      src/renderers/WebGLRenderer.js

+ 3 - 4
src/renderers/WebGLRenderer.js

@@ -2440,8 +2440,8 @@ class WebGLRenderer {
 
 			}
 
-			const width = sourceBox.max.x - sourceBox.min.x + 1;
-			const height = sourceBox.max.y - sourceBox.min.y + 1;
+			const width = Math.round( sourceBox.max.x - sourceBox.min.x );
+			const height = Math.round( sourceBox.max.y - sourceBox.min.y );
 			const depth = sourceBox.max.z - sourceBox.min.z + 1;
 			const glFormat = utils.convert( dstTexture.format );
 			const glType = utils.convert( dstTexture.type );
@@ -2488,9 +2488,8 @@ class WebGLRenderer {
 
 			} else {
 
-				if ( srcTexture.isCompressedArrayTexture ) {
+				if ( dstTexture.isCompressedArrayTexture ) {
 
-					console.warn( 'THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture.' );
 					_gl.compressedTexSubImage3D( glTarget, level, position.x, position.y, position.z, width, height, depth, glFormat, image.data );
 
 				} else {