The decoder configuration.
Optionaldecoder?: anyThe decoder object, such as the MeshoptDecoder exported by
the meshoptimizer package.
OptionalnumWorkers?: numberThe number of web workers to decode on. Defaults to 0, which decodes on the main thread.
Optionalurl?: stringThe URL of the decoder module. Ignored when decoder is set.
Initializes the decoder used to load glTF files compressed with the
EXT_meshopt_compressionorKHR_meshopt_compressionextensions, such as files produced by gltfpack or glTF-Transform. Without a decoder, these files fail to load unless they also contain uncompressed fallback data.The decoder is the meshoptimizer JavaScript decoder (
meshopt_decoder.mjs). Pass the decoder object itself, or the URL of the decoder module, which is then imported the first time a compressed file loads. Files usingKHR_meshopt_compressionneed meshoptimizer 1.0 or later.