CompressedTextureLoader
Loader for compressed textures in the PVR file format
Loader | Characteristic |
---|---|
File Format | PVR, DDS, KTX |
File Extension | .dds , .pvr , .ktx , .ktx2 |
File Type | Binary |
Data Format | Array of compressed image data objects |
Supported APIs | load , parse |
Usage​
import {CompressedTextureLoader} from '@loaders.gl/textures';
import {load} from '@loaders.gl/core';
const mipLevels = await load(url, CompressedTextureLoader);
for (const image of mipLevels) {
...
}
Data Format​
Returns an array of image data objects representing mip levels.
{compressed: true, format, width, height, data: ..., levelSize}
Options​
Option | Type | Default | Description |
---|---|---|---|
compressed-texture.useBasis | Boolean | false | Use BasisLoader to decode KTX2 texture |
Basis loader​
From v3.1 BasisLoader supports decoding KTX2 format. Applying BasisLoader for KTX2 files can possibly give results when internal ktx parser can't parse an image for some reason.