API

Class KhronosTextureContainer2EncoderExperimental

Encodes Babylon textures to KTX2 through a shared pool of Basis Universal workers. This is groundwork for future glTF export; encoding is internal for now. Configure URLConfig, WorkerPool, and constructor options before the first construction, which fixes the automatic configuration. Fatally failed automatic workers are terminated and replaced for the next job. Normal encode-error replies and cancellation do not terminate healthy workers. Caller-provided pools remain caller-owned. Each worker starts with approximately 128 MiB of WASM memory. The official Basis v2_50 factory requires CSP 'unsafe-eval' for Embind.

Index
DefaultEncoderOptions: DefaultKTX2EncoderOptions = ...

Encoder-wide options. Defined values override per-call options for the usages they apply to.

DefaultNumWorkers: number = ...

Default number of workers: half the logical processors, from 1 to 2.

URLConfig: {
    jsBasisEncoder: string;
    jsEncoderModule: string;
    wasmBasisEncoder: string;
} = ...

URLs of the Babylon encoder module and its Basis Universal v2_50 dependencies. Each URL is resolved with Tools.GetBabylonScriptURL. Configure before the first construction.

Worker pool to use instead of creating one. Its workers must already be initialized with the encoder worker protocol; this release has no public worker bootstrap. Each instance captures this setting at construction and never disposes the pool.