Class KhronosTextureContainer2
Constructors
constructor
-
new KhronosTextureContainer2(
engine: AbstractEngine,
numWorkersOrOptions?: number | IKhronosTextureContainer2Options,
): KhronosTextureContainer2Constructor
Parameters
- engine: AbstractEngine
The engine to use
- numWorkersOrOptions: number | IKhronosTextureContainer2Options = KhronosTextureContainer2.DefaultNumWorkers
The number of workers for async operations. Specify
0to disable web workers and run synchronously in the current context.
Returns KhronosTextureContainer2
- engine: AbstractEngine
Properties
StaticDefault Decoder Options
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(...).
StaticDefault Num Workers
Default number of workers used to handle data decoding
StaticURL Config
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
Static OptionalWorker Pool
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.
Class for loading KTX2 files