adryanmoldokkr32-pixel/threejs-skill-package/threejs-agents-model-optimizer
Claude Code and agent skill by adryanmoldokkr32-pixel/threejs-skill-package
- community
- ext:[{"type":"plugin","description":"Custom plugin integration"}]
Checking that the SKILL.md file is still in the repository.
Use when optimizing 3D models for web delivery: reducing file size, compressing meshes, optimizing textures, or generating LOD. Provides a complete GLTF optimization pipeline using Draco, KTX2, mesh simplification, and gltf-transform. Keywords: optimize model, reduce file size, Draco compression, KTX2, gltf-transform, mesh simplification, LOD, GLTF optimize, bundle size, model too big, slow loading, compress 3D model.
Install
npx vskill@latest install adryanmoldokkr32-pixel/threejs-skill-package/threejs-agents-model-optimizerSemi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard
SKILL.md
threejs-agents-model-optimizer
Quick Reference
Optimization Pipeline Overview
Target File Size Budgets
| Platform | Max File Size | Max Polygons | Max Texture Size | |
|---|---|---|---|---|
| Mobile web | 2 MB | 50K triangles | 1024x1024 | |
| Desktop web | 5 MB | 200K triangles | 2048x2048 | |
| Desktop app | 20 MB | 500K triangles | 4096x4096 | |
| Hero asset (single) | 1 MB | 30K triangles | 1024x1024 |
Tool Selection
| Tool | Best For | Install | |
|---|---|---|---|
gltf-transform | Full pipeline, scriptable, Node.js API | npm i @gltf-transform/cli | |
gltfpack | Fast one-shot compression | npm i -g gltfpack | |
| Blender | Manual mesh editing, UV repacking | Blender 3.6+ |
Critical Warnings
NEVER skip the assessment step -- optimizing blindly wastes time and can produce worse results than the original.
NEVER apply Draco compression AND meshopt compression to the same file -- they are mutually exclusive. Choose ONE.
NEVER use KTX2 UASTC for diffuse color maps on mobile -- UASTC textures are 8-16 bytes/texel in VRAM. ALWAYS use ETC1S for color maps on mobile targets.
NEVER simplify meshes below 10% of original without visual validation -- aggressive simplification destroys silhouettes and UV mapping.
ALWAYS validate optimized models visually before shipping -- automated metrics cannot catch all visual artifacts.
ALWAYS keep the original unoptimized model in version control -- optimization is lossy and irreversible.
Step 1: Assessment
Before optimizing, ALWAYS gather these metrics:
Assessment Decision Tree
Polygon Count Guidelines
| Asset Type | Target Triangles | Notes | |
|---|---|---|---|
| Background prop | 100-500 | Minimal detail | |
| Mid-ground object | 1K-5K | Visible but not hero | |
| Hero/focus object | 10K-50K | High detail, close-up | |
| Character | 15K-30K | With LOD chain | |
| Full scene | 100K-300K | All objects combined | |
| Architectural (BIM) | 200K-500K | Simplified from CAD |
Step 2: Mesh Optimization
gltf-transform Mesh Pipeline
ALWAYS run these operations in this order:
Combined Pipeline (Single Command)
Mesh Simplification Settings
| Quality Level | Ratio | Error Tolerance | Use Case | |
|---|---|---|---|---|
| Minimal | 0.75 | 0.0005 | Subtle reduction, preserves detail | |
| Moderate | 0.50 | 0.001 | Balanced quality/size | |
| Aggressive | 0.25 | 0.005 | LOD1/LOD2 generation | |
| Extreme | 0.10 | 0.01 | LOD3, distant objects only |
Weld Settings
| Tolerance | Effect | |
|---|---|---|
| 0.0001 | Conservative -- merges only nearly-identical vertices | |
| 0.001 | Standard -- good for most models | |
| 0.01 | Aggressive -- may cause visible seams on hard edges |
Step 3: Texture Optimization
Texture Decision Tree
KTX2 Compression Commands
KTX2: ETC1S vs UASTC
| Property | ETC1S | UASTC | |
|---|---|---|---|
| File size | Very small (6-8x smaller) | Moderate (2-4x smaller) | |
| VRAM usage | Small | Large (8-16 bytes/texel) | |
| Quality | Good for color | Near-lossless | |
| Decode speed | Fast | Requires transcoding | |
| Best for | Color maps, ORM, emissive | Normal maps, detail textures |
Texture Resize
Step 4: Mesh Compression
Draco Compression
Draco Quantization Bits
| Attribute | Default | High Quality | Aggressive | |
|---|---|---|---|---|
| Position | 14 bits | 16 bits | 11 bits | |
| Normal | 10 bits | 12 bits | 8 bits | |
| TexCoord | 12 bits | 14 bits | 10 bits | |
| Color | 8 bits | 10 bits | 6 bits |
Higher bits = better quality, larger file. 14-bit position is sufficient for most models.
Quantize Without Draco
Loading Draco-Compressed Models in Three.js
Loading KTX2-Compressed Textures
Step 5: Validation
Validation Checklist
After optimization, ALWAYS verify:
- File size -- meets target budget from Step 1
- Visual quality -- load in Three.js viewer, compare to original
- Bounding box -- same dimensions as original (no scale errors)
- Materials -- all textures load, no missing maps
- Animations -- all clips play correctly (if applicable)
- Performance -- measure draw calls, frame time
LOD Generation
LOD Chain Strategy
| LOD Level | Screen Coverage | Triangle Ratio | Distance | |
|---|---|---|---|---|
| LOD0 | >30% screen | 1.0 (full) | Near | |
| LOD1 | 10-30% screen | 0.5 | Medium | |
| LOD2 | 3-10% screen | 0.25 | Far | |
| LOD3 | <3% screen | 0.10 | Very far |
Generating LODs with gltf-transform
Three.js LOD Implementation
gltfpack Alternative
For quick one-shot optimization without a pipeline:
NEVER mix gltfpack meshopt output with gltf-transform Draco -- the compression formats are incompatible.
Loading Meshopt-Compressed Models
Blender Export Optimization
When exporting from Blender to glTF:
| Setting | Recommended Value | Why | |
|---|---|---|---|
| Format | glTF Binary (.glb) | Single file, smaller | |
| Apply Modifiers | ON | Bakes procedural geometry | |
| Compression | OFF | Compress with gltf-transform after | |
| Textures | Include | Embedded in .glb | |
| Limit to | Selected Objects | Avoid exporting hidden/unused | |
| +Y Up | ON | Three.js convention |
NEVER enable Draco in Blender's exporter -- Blender's Draco implementation is outdated. ALWAYS compress with gltf-transform or gltfpack after export.
Node.js Scripting with gltf-transform API
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/source/threejs-agents/threejs-agents-model-optimizer/SKILL.md
Popularity
- Repository stars
- 2
- 7-day trend score
- 5
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Extension points
pluginCustom plugin integration
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/adryanmoldokkr32-pixel/threejs-skill-package/threejs-agents-model-optimizer)