playcanvas / playcanvas/engine
Evaluate minidraco as an alternative to the WASM Draco decoder
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 16.8k
- Forks
- 2k
- Avg merge
- 4h 32m
- Merged PRs (30d)
- 222
Description
Proposal
Consider using minidraco, a pure TypeScript Draco mesh decoder, in place of the current WebAssembly decoder for KHR_draco_mesh_compression.
The engine currently downloads the Draco JavaScript glue and WASM binary, compiles the WASM module, and decodes meshes in workers. A JavaScript decoder could simplify deployment by removing the separate WASM asset and reduce download and initialization costs.
Potential benefits
According to the upstream README and benchmarks:
- Brotli download size is approximately 22 KB for the single-threaded decoder or 45 KB with its worker pool, compared with 81 KB for the official WASM decoder in their comparison.
- Across 18 models, the reported median Chrome single-threaded decode speed is 1.26× faster than the official WASM decoder. Their Three.js loader benchmark reports 1.23× faster cold loading and 1.03× faster loading with a warm worker pool.
- The project reports support for all Draco triangle-mesh encodings, prediction schemes, and attribute types, with bit-identical output verified in its tests. Point clouds are unsupported.
- It is MIT licensed and exposes a standalone
decodeDracoMeshAPI without requiring Three.js.
These are upstream results; the benefits need validating with PlayCanvas workloads.
Evaluation
- Benchmark representative Draco GLBs on desktop and mobile browsers, including cold startup, warm decoding, memory use, and total compressed payload after integration.
- Verify decoded geometry and attributes against the current decoder, including attribute IDs, component types, normalized attributes, skinning, and meshes without normals.
- Evaluate integration with the engine's existing worker queue and lazy initialization, plus browser and Node.js support.
- Assess package maturity and maintenance, and determine how to preserve compatibility with
dracoInitialize()and existingWasmModule.setConfig('DracoDecoderModule', ...)configurations.
Use the results to decide whether minidraco should replace the WASM decoder or initially be available as an optional backend.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by benchmarking representative Draco GLBs against the current WebAssembly decoder, covering cold and warm workers, mobile and desktop browsers, memory, and compressed payload size. Verify geometry and attribute compatibility, then assess integration with the existing worker queue, lazy initialization, dracoInitialize(), and WasmModule.setConfig('DracoDecoderModule', ...). Done means a documented decision to replace the decoder or offer minidraco as an optional backend.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, typescript, wasm
- Domain
- computer-graphics, performance, web-dev
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100