소스 검색

KTX2Loader: fix data textures (#26679)

* KTX2Loader: fix data textures

* remove redundant mipmap assignment

* use first mipmap unconditionally
Vicente Lucendo 2 년 전
부모
커밋
984040363f
1개의 변경된 파일2개의 추가작업 그리고 4개의 파일을 삭제
  1. 2 4
      examples/jsm/loaders/KTX2Loader.js

+ 2 - 4
examples/jsm/loaders/KTX2Loader.js

@@ -865,8 +865,8 @@ async function createRawTexture( container ) {
 	if ( UNCOMPRESSED_FORMATS.has( FORMAT_MAP[ vkFormat ] ) ) {
 
 		texture = container.pixelDepth === 0
-		? new DataTexture( mipmaps, container.pixelWidth, container.pixelHeight )
-		: new Data3DTexture( mipmaps, container.pixelWidth, container.pixelHeight, container.pixelDepth );
+		? new DataTexture( mipmaps[ 0 ].data, container.pixelWidth, container.pixelHeight )
+		: new Data3DTexture( mipmaps[ 0 ].data, container.pixelWidth, container.pixelHeight, container.pixelDepth );
 
 	} else {
 
@@ -874,8 +874,6 @@ async function createRawTexture( container ) {
 
 		texture = new CompressedTexture( mipmaps, container.pixelWidth, container.pixelHeight );
 
-
-
 	}
 
 	texture.mipmaps = mipmaps;