playcanvas / playcanvas/engine

Evaluate minidraco as an alternative to the WASM Draco decoder

Open
#9,373 0 comments 0 reactions 0 assignees View on GitHub

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 decodeDracoMesh API 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 existing WasmModule.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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.