threejs-agents-model-optimizer

Optimizes GLTF 3D models for web delivery using Draco, KTX2, and mesh simplification.

1|Updated Aug 20, 2023
One-click install
npx skills add https://github.com/imanlangaran/mini-projects --skill threejs-agents-model-optimizer-imanlangaran
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: threejs-agents-model-optimizer
Source: https://github.com/imanlangaran/mini-projects/tree/main/react/three-gsap/.claude/skills/threejs-agents-model-optimizer
Command: npx skills add https://github.com/imanlangaran/mini-projects --skill threejs-agents-model-optimizer-imanlangaran

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @gltf-transform/cli, @gltf-transform/core, @gltf-transform/functions, @gltf-transform/extensions, draco3dgltf, gltfpack, sharp, three, and includes references (resource) components.

What problem does it solve? 3D models exported from Blender or CAD tools are often too large for web delivery, causing slow page loads, high VRAM usage, and poor frame rates in Three.js applications. This Skill provides a complete optimization pipeline to reduce file size, compress meshes and textures, and generate LOD chains while preserving visual quality. ## Core Features & Use Cases - Full GLTF Optimization Pipeline: Runs assessment, mesh dedup/flatten/join/weld/simplify, texture resize and KTX2 compression, and Draco compression in the correct dependency order using gltf-transform. - Texture Compression Guidance: Chooses between ETC1S and UASTC KTX2 formats per texture slot (color maps vs normal maps) with platform-specific budgets for mobile and desktop. - LOD Generation and Runtime Loading: Generates multi-level LOD chains and provides Three.js loader setup code for Draco, KTX2, and Meshopt decoders. - Use Case: You have a 50MB architectural model that must load on mobile web. The Skill assesses it, resizes textures to 1024px, simplifies geometry to 25%, applies ETC1S and Draco compression, and outputs a sub-2MB GLB with the matching Three.js loader code. ## Quick Start Optimize my building.glb model for mobile web delivery with a target size under 2MB and give me the Three.js code to load it.

Frequently Asked Questions about threejs-agents-model-optimizer

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I reduce GLB file size for web delivery?

Run the gltf-transform pipeline in order: dedup, flatten, join, weld, simplify, then apply KTX2 texture compression and Draco mesh compression. A single command like npx gltf-transform optimize input.glb output.glb --compress draco --texture-compress ktx2 handles most cases.

What is the difference between Draco and meshopt compression?

Draco and meshopt are mutually exclusive GLTF mesh compression formats using different extensions. Draco via gltf-transform suits scripted pipelines, while gltfpack provides fast one-shot meshopt compression. Never apply both to the same file.

Should I use ETC1S or UASTC for KTX2 texture compression?

Use ETC1S for color, emissive, and ORM maps, especially on mobile where UASTC consumes 8-16 bytes per texel of VRAM. Always use UASTC for normal maps because ETC1S introduces block artifacts that cause visible lighting errors.

Why does my Draco-compressed model fail to load in Three.js?

GLTFLoader does not include the Draco WASM decoder by default. You must create a DRACOLoader, call setDecoderPath with the decoder files, and attach it via gltfLoader.setDRACOLoader before loading.

How do I generate LOD levels for a Three.js scene?

Run gltf-transform simplify at decreasing ratios such as 1.0, 0.5, 0.25, and 0.10 to produce LOD0 through LOD3. Then add each mesh to a THREE.LOD object with increasing distances and call lod.update(camera) in the render loop.

When should I avoid joining meshes during optimization?

Avoid the join step when meshes have independent animations or need separate interaction, because joining merges them into a single mesh and destroys per-part animation targets. Use dedup, flatten, and weld instead.