Skip to content

Commit

Permalink
KTX2Loader: fix data textures (#26679)
Browse files Browse the repository at this point in the history
* KTX2Loader: fix data textures

* remove redundant mipmap assignment

* use first mipmap unconditionally
  • Loading branch information
vlucendo committed Sep 4, 2023
1 parent 5207526 commit 55783cc
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions examples/jsm/loaders/KTX2Loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -865,17 +865,15 @@ 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 {

if ( container.pixelDepth > 0 ) throw new Error( 'THREE.KTX2Loader: Unsupported pixelDepth.' );

texture = new CompressedTexture( mipmaps, container.pixelWidth, container.pixelHeight );



}

texture.mipmaps = mipmaps;
Expand Down

0 comments on commit 55783cc

Please sign in to comment.