[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-83058":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":8,"htmlUrl":8,"language":9,"languages":8,"totalLinesOfCode":8,"stars":10,"forks":11,"watchers":12,"openIssues":13,"contributorsCount":14,"subscribersCount":14,"size":14,"stars1d":15,"stars7d":16,"stars30d":17,"stars90d":14,"forks30d":14,"starsTrendScore":18,"compositeScore":19,"rankGlobal":8,"rankLanguage":8,"license":20,"archived":21,"fork":21,"defaultBranch":22,"hasWiki":23,"hasPages":21,"topics":24,"createdAt":8,"pushedAt":8,"updatedAt":25,"readmeContent":26,"aiSummary":27,"trendingCount":14,"starSnapshotCount":14,"syncStatus":13,"lastSyncTime":28,"discoverSource":29},83058,"glb-shrink","boona13\u002Fglb-shrink","boona13",null,"TypeScript",138,18,52,2,0,5,42,86,23,3.84,"MIT License",false,"main",true,[],"2026-06-12 02:04:30","# GLB Shrink\n\n**Compress any GLB 3D model** — drop a file, see it side-by-side in Three.js, and download a lighter asset ready for games, apps, AR\u002FVR, or the web.\n\nReal-world result from the tool:\n\n![GLB Shrink compressing a 58 MB market table model down to 869 KB](docs\u002Fscreenshot.png)\n\n**58.3 MB → 869 KB · −99% smaller**  \n1.91M triangles → 170.5k triangles · Draco geometry + WebP textures\n\n---\n\n## Why GLB Shrink?\n\nAI-generated and scanned 3D models often ship at **5–60+ MB** with hundreds of thousands to millions of triangles. That is fine for offline tools, but too heavy for real-time projects — games, interactive apps, AR experiences, and the web.\n\nGLB Shrink turns bloated GLBs into **lighter, production-ready assets** in seconds — with a live before\u002Fafter preview so you can actually see what you are getting.\n\nNo Blender. No command line. No guesswork.\n\n---\n\n## Features\n\n### Drop, preview, download\n- Drag & drop any `.glb` file (up to 200 MB)\n- Instant **before \u002F after** 3D preview with orbit controls\n- One-click download of the compressed `-draco.glb` output\n\n### Demo-ready size display\nThe hero strip at the top shows file sizes in **large, high-contrast type** — built for screen recordings, demos, and social posts. The savings percentage updates live after compression.\n\n### Simple quality controls\nNo triangle ratios. No geometric error sliders. Just:\n\n| Option | When to use |\n|--------|-------------|\n| **Smallest file** | Background props, far from the camera |\n| **Balanced** | Most projects — games, apps, scenes *(default)* |\n| **Sharpest** | Close-up or hero objects |\n\nFine-tune between presets with a single **Smaller file ↔ Sharper look** slider. A plain-English hint updates as you adjust.\n\n### Production-grade compression\nBuilt on the same pipeline used in real-time 3D projects:\n\n1. Strip existing meshopt \u002F Draco \u002F quantization extensions\n2. Weld duplicate vertices\n3. Simplify geometry with [MeshoptSimplifier](https:\u002F\u002Fgithub.com\u002Fzeux\u002Fmeshoptimizer)\n4. Re-bake smooth vertex normals (prevents faceted shading)\n5. Compress textures to **WebP** and downscale to target resolution\n6. **Draco-encode** geometry for minimal transfer size\n7. Write binary GLB\n\nOutput includes:\n- `KHR_draco_mesh_compression` — geometry\n- `EXT_texture_webp` — textures\n\nBoth are supported by Three.js, Unity, Unreal Engine, Godot, and most modern glTF runtimes.\n\n---\n\n## Quick start\n\n### Prerequisites\n- **Node.js 18+**\n- macOS, Linux, or Windows\n\n### Development\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Fboona13\u002Fglb-shrink.git\ncd glb-shrink\nnpm install\nnpm run dev\n```\n\nOpen **http:\u002F\u002Flocalhost:5173** (or the next available port if 5173 is taken).\n\nThe Vite dev server serves the UI and proxies API requests to the compression backend on port **3847**.\n\n### Production\n\n```bash\nnpm run build\nnpm start\n```\n\nServes the built UI and API from a single server on port **3847**. Override with the `PORT` environment variable.\n\n---\n\n## How to use\n\n1. **Drop your GLB** into the upload zone (or click to browse)\n2. The original model loads in the **Before** viewer with file size and triangle count\n3. Pick a quality preset — **Balanced** works for most models\n4. Click **Compress model**\n5. Compare the **After** viewer side-by-side\n6. **Download compressed GLB** when you are happy with the result\n\n### Choosing a quality preset\n\n| Preset | Best for | Typical output |\n|--------|----------|----------------|\n| Smallest file | Distant props, instanced decor | ~3–5k tris, 40–80 KB |\n| Balanced | General use — games, apps, scenes | ~5–8k tris, 60–150 KB |\n| Sharpest | Close-up viewing, hero assets | ~15–40k tris, 150–400 KB |\n\nUse the fine-tune slider to nudge between presets without touching technical parameters.\n\n---\n\n## Project structure\n\n```\nglb-shrink\u002F\n├── docs\u002F\n│   └── screenshot.png      # README demo screenshot\n├── public\u002F\n│   └── draco\u002F              # Draco WASM decoders for Three.js preview\n├── server\u002F\n│   ├── index.mjs           # Express API (inspect + compress)\n│   ├── compress.mjs        # Compression pipeline\n│   ├── inspect.mjs         # Model stats inspector\n│   └── presets.mjs         # Quality preset → compression params\n├── src\u002F\n│   ├── main.ts             # Three.js UI\n│   └── style.css\n├── index.html\n├── package.json\n└── vite.config.ts\n```\n\n### API endpoints\n\n| Method | Path | Description |\n|--------|------|-------------|\n| `GET` | `\u002Fapi\u002Fhealth` | Health check |\n| `GET` | `\u002Fapi\u002Fpresets` | List quality presets |\n| `POST` | `\u002Fapi\u002Finspect` | Upload GLB → stats (tris, bbox, textures) |\n| `POST` | `\u002Fapi\u002Fcompress` | Upload GLB + `quality` (0–100) → compressed GLB |\n\n---\n\n## Tech stack\n\n| Layer | Technology |\n|-------|------------|\n| UI | Vite, TypeScript, CSS |\n| 3D preview | Three.js, OrbitControls, GLTFLoader, DRACOLoader |\n| Compression | `@gltf-transform`, meshoptimizer, draco3dgltf, sharp |\n| Server | Express, multer |\n\n---\n\n## Using compressed models\n\nDraco-compressed GLBs work across most real-time 3D pipelines. Example with **Three.js**:\n\n```javascript\nimport { GLTFLoader } from 'three\u002Faddons\u002Floaders\u002FGLTFLoader.js';\nimport { DRACOLoader } from 'three\u002Faddons\u002Floaders\u002FDRACOLoader.js';\n\nconst dracoLoader = new DRACOLoader();\ndracoLoader.setDecoderPath('\u002Fdraco\u002F');\n\nconst loader = new GLTFLoader();\nloader.setDRACOLoader(dracoLoader);\n\nconst gltf = await loader.loadAsync('\u002Fmodels\u002Fmy-model-draco.glb');\nscene.add(gltf.scene);\n```\n\nCopy the `public\u002Fdraco\u002F` folder into your project's static assets so the decoder can load.\n\n---\n\n## Troubleshooting\n\n**Compressed model looks faceted \u002F flat-shaded**  \nNormals are re-baked automatically. If this appears, try the **Sharpest** preset — the model may need a higher triangle budget.\n\n**Colors look wrong or model is black**  \nThe texture may have been stripped during an overly aggressive pass. Try **Balanced** or **Sharpest**, or check that the source GLB has embedded textures.\n\n**File is still too large**  \nMove the slider toward **Smallest file**, or pick the Smallest preset. Texture size and triangle count both drop at lower quality settings.\n\n**Browser fails to load compressed GLB (Draco error)**  \nEnsure `DRACOLoader` is configured with `setDecoderPath('\u002Fdraco\u002F')` pointing at the Draco decoder files.\n\n---\n\n## License\n\n[MIT](LICENSE) — free to use, modify, and ship.\n\n---\n\n## Credits\n\nCompression pipeline adapted from the 3D asset workflow built for **ThreeShaders** — an in-development Three.js game by [@boona13](https:\u002F\u002Fgithub.com\u002Fboona13).\n\nBuilt with [Three.js](https:\u002F\u002Fthreejs.org), [@gltf-transform](https:\u002F\u002Fgltf-transform.dev), and [meshoptimizer](https:\u002F\u002Fgithub.com\u002Fzeux\u002Fmeshoptimizer).\n","GLB Shrink 是一个用于压缩 GLB 3D 模型的工具，支持将大型模型文件显著减小体积，适用于游戏、应用、AR\u002FVR 或网页等实时项目。其核心功能包括拖拽上传 `.glb` 文件（最大支持200MB）、即时预览压缩前后的效果对比以及一键下载经过Draco编码和WebP纹理压缩处理后的轻量化模型。该工具界面友好，无需掌握复杂命令行操作或专业软件知识即可使用，并且提供了多种质量控制选项以满足不同场景需求。无论是作为背景道具还是近景展示对象，用户都可以通过简单设置获得最佳压缩效果。","2026-06-11 04:10:03","CREATED_QUERY"]