API

Class KhronosTextureContainer2

Class for loading KTX2 files

Index
DefaultDecoderOptions: DefaultKTX2DecoderOptions = ...

Default configuration for the KTX2 decoder. The options defined in this way have priority over those passed when creating a KTX2 texture with new Texture(...).

DefaultNumWorkers: number = ...

Default number of workers used to handle data decoding

URLConfig: {
    jsDecoderModule: string;
    jsMSCTranscoder: Nullable<string>;
    wasmMSCTranscoder: Nullable<string>;
    wasmUASTCToASTC: Nullable<string>;
    wasmUASTCToBC7: Nullable<string>;
    wasmUASTCToR8_UNORM: Nullable<string>;
    wasmUASTCToRG8_UNORM: Nullable<string>;
    wasmUASTCToRGBA_SRGB: Nullable<string>;
    wasmUASTCToRGBA_UNORM: Nullable<string>;
    wasmZSTDDecoder: Nullable<string>;
} = ...

URLs to use when loading the KTX2 decoder module as well as its dependencies If a url is null, the default url is used (pointing to https://preview.babylonjs.com) Note that jsDecoderModule can't be null and that the other dependencies will only be loaded if necessary Urls you can change: URLConfig.jsDecoderModule URLConfig.wasmUASTCToASTC URLConfig.wasmUASTCToBC7 URLConfig.wasmUASTCToRGBA_UNORM URLConfig.wasmUASTCToRGBA_SRGB URLConfig.wasmUASTCToR8_UNORM URLConfig.wasmUASTCToRG8_UNORM URLConfig.jsMSCTranscoder URLConfig.wasmMSCTranscoder URLConfig.wasmZSTDDecoder You can see their default values in this PG: https://playground.babylonjs.com/#EIJH8L#29

If provided, this worker pool will be used instead of creating a new one. This is useful when loading the WASM and the js modules on your own and you want to use the ktxTextureLoader and not construct this class directly.