Creates a new KTX2TextureLoader instance.
Initializes the MSC transcoder module required for texture transcoding. Logs an error if the MSC_TRANSCODER function is not available.
Transcodes a KTX2 texture from the provided byte array.
This method parses the KTX2 container, validates its format constraints, and transcodes the texture data to a format suitable for the current GPU.
The KTX2 texture data as a Uint8Array
A promise that resolves to the transcoded texture data
Static
getGets the singleton instance of KTX2TextureLoader.
The singleton KTX2TextureLoader instance
A texture loader for KTX2 format files that handles transcoding of compressed texture data.
KTX2 is a container format for GPU textures that supports various compression formats including Basis Universal (ETC1S and UASTC). This loader can transcode KTX2 textures to device-specific formats based on available GPU extensions.
The loader supports:
Example