Class KhronosTextureContainer2EncoderExperimental
Constructors
constructor
-
new KhronosTextureContainer2Encoder(
numWorkersOrOptions?: number | IKhronosTextureContainer2EncoderOptions,
): KhronosTextureContainer2EncoderExperimentalConfigures the shared encoder without loading scripts or creating workers. The first construction without a worker pool fixes the automatic worker count, URLs, and dependencies.
Parameters
- numWorkersOrOptions: number | IKhronosTextureContainer2EncoderOptions = KhronosTextureContainer2Encoder.DefaultNumWorkers
The number of workers, or encoder options. Specify
0to encode on the main thread.
Returns KhronosTextureContainer2Encoder
- numWorkersOrOptions: number | IKhronosTextureContainer2EncoderOptions = KhronosTextureContainer2Encoder.DefaultNumWorkers
Properties
Static ExperimentalDefault Encoder Options
Encoder-wide options. Defined values override per-call options for the usages they apply to.
Static ExperimentalDefault Num Workers
Default number of workers: half the logical processors, from 1 to 2.
Static ExperimentalURL Config
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.
Static Optional ExperimentalWorker Pool
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.
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.