[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-83055":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":15,"subscribersCount":15,"size":15,"stars1d":16,"stars7d":17,"stars30d":18,"stars90d":15,"forks30d":15,"starsTrendScore":19,"compositeScore":20,"rankGlobal":10,"rankLanguage":10,"license":21,"archived":22,"fork":22,"defaultBranch":23,"hasWiki":22,"hasPages":24,"topics":25,"createdAt":10,"pushedAt":10,"updatedAt":34,"readmeContent":35,"aiSummary":36,"trendingCount":15,"starSnapshotCount":15,"syncStatus":14,"lastSyncTime":37,"discoverSource":38},83055,"draco.js","mrdoob\u002Fdraco.js","mrdoob","A small, drop-in, pure-JavaScript Draco mesh loader for three.js.","https:\u002F\u002Fmrdoob.github.io\u002Fdraco.js\u002F",null,"JavaScript",176,9,2,0,1,55,119,14,75,"MIT License",false,"main",true,[26,27,28,29,30,31,32,33],"3d","draco","geometry","gltf","loader","mesh-compression","threejs","webgl","2026-06-12 04:01:40","# Draco.js\n\nA pure-JavaScript [Draco](https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fdraco) mesh **loader** for\nthree.js. It's a drop-in `DRACOLoader` that decodes Draco-compressed triangle\nmeshes (the EdgeBreaker connectivity used by glTF's `KHR_draco_mesh_compression`)\ndirectly in JavaScript.\n\n**[Live demo →](https:\u002F\u002Fmrdoob.github.io\u002Fdraco.js\u002F)**\n\nWhy a JS port instead of the official WASM build?\n\n- **Small** — ~24 KB gzipped, vs ~104 KB for the `draco3d` WASM decoder + glue\n  (~4.3× smaller).\n- **Simple to ship** — one ES module. No `.wasm` fetch, no worker\u002Fglue setup,\n  no cross-origin or CSP headaches.\n- **Fast** — within ~1.4–1.6× of the WASM decoder on substantial meshes (it\n  decodes byte-for-byte identical output; see [Correctness](#correctness)).\n\nWASM is still faster in absolute terms — this trades a modest amount of decode\nspeed for a much smaller, simpler-to-deploy loader.\n\n## Status\n\nThe EdgeBreaker triangle-mesh path is complete and is what glTF\u002FDraco content\nuses in practice (positions, normals, colors, texture coords, generic\nattributes; quantization, octahedral-normal, and parallelogram\u002Fmulti-parallelogram\nprediction). Point-cloud, KD-tree, and the sequential connectivity paths, plus\nmetadata decoding, are not implemented yet.\n\n## Usage\n\n`DRACOLoader` is a drop-in replacement for three.js's own `DRACOLoader` — plug it\ninto `GLTFLoader` the usual way. There's no decoder path or WASM to configure\n(`setDecoderPath` \u002F `setDecoderConfig` are accepted but do nothing).\n\n```js\nimport { GLTFLoader } from 'three\u002Faddons\u002Floaders\u002FGLTFLoader.js';\nimport { DRACOLoader } from '.\u002Fbuild\u002FDRACOLoader.js';\n\nconst gltfLoader = new GLTFLoader();\ngltfLoader.setDRACOLoader( new DRACOLoader() );\n\ngltfLoader.load( 'model.glb', ( gltf ) => scene.add( gltf.scene ) );\n```\n\nIt can also load standalone `.drc` files:\n\n```js\nconst geometry = await new DRACOLoader().loadAsync( 'model.drc' ); \u002F\u002F BufferGeometry\n```\n\n## Build\n\n`npm run build` bundles `src\u002FDRACOLoader.js` (via Rollup) into `build\u002FDRACOLoader.js`\n(readable ESM) and `build\u002FDRACOLoader.min.js` (minified), with `three` kept\nexternal. Prebuilt copies are checked in.\n\n## Correctness\n\nOutput is validated against Google's reference `draco3d` WASM decoder: every\nsample is decoded by both and compared element-by-element — face indices must\nmatch exactly and per-point attribute values within a small epsilon. All\nsamples match.\n\n## Project layout\n\n```\nsrc\u002F          decoder source, mirroring draco\u002Fsrc\u002Fdraco\u002F file-for-file\nbuild\u002F        bundled output (build\u002FDRACOLoader.js + .min.js)\nlibs\u002F         three.js's WASM Draco loader, vendored for the comparison\nsamples\u002F      .drc and Draco-compressed .glb test models\nindex.html    JS-vs-WASM comparison viewer\n```\n\n## Credits\n\n- Decoder logic is a port of [Google Draco](https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fdraco)\n  (Apache-2.0); it mirrors the original C++ file structure.\n- `DRACOLoader.js` follows the API of three.js's\n  [`DRACOLoader`](https:\u002F\u002Fgithub.com\u002Fmrdoob\u002Fthree.js\u002Fblob\u002Fdev\u002Fexamples\u002Fjsm\u002Floaders\u002FDRACOLoader.js)\n  (MIT) so it drops into `GLTFLoader` unchanged.","draco.js 是一个用于 three.js 的纯 JavaScript Draco 网格加载器。它能够直接在浏览器中解码采用 Draco 压缩格式的三角网格数据，支持 glTF 中的 KHR_draco_mesh_compression 扩展。相比官方的 WebAssembly 版本，该项目体积更小（约24KB gzip压缩后），部署简单且无需额外配置WebAssembly或worker，并且在处理较大网格时速度表现接近WASM版本。适用于需要快速加载和展示3D模型的Web应用，特别是在对文件大小和加载性能有较高要求的情况下，如在线游戏、虚拟现实体验或者任何基于WebGL的3D内容展示平台。","2026-06-11 04:10:03","CREATED_QUERY"]