Skip to content
FramesField
SKILL.md Developer / Local Tooling SKILL.md
Verified Nov 29, 2026

glTF-Transform Web 3D GLB Compression Skill

How to install this SKILL.md

Install into .claude/skills/, .cursor/skills/, or .agents/skills/ whenever preparing AI-generated .glb 3D meshes for Shopify, Astro, React, <model-viewer>, or Three.js storefronts.

Installable SKILL.md teaching Claude Code, Cursor, and Codex to inspect, pivot-center, simplify geometry, pack 1024px WebP/KTX2 PBR textures, and apply Meshopt/Draco compression on raw Tripo 3D, Hyper3D Rodin, and Meshy 3D GLB files—cutting 18 MB exports down under 1.5 MB for zero-LCP web viewers.

Compatible agent hosts
Claude Code Cursor Codex
Target tool: glTF-Transform / WebGL / <model-viewer> · License: MIT
  1. STEP 01
    Install the glTF-Transform 3D skill

    Pick Claude Code, Cursor, or Codex below to save SKILL.md directly from /raw/skills/.

  2. STEP 02
    Inspect & compress raw Tripo/Rodin/Meshy GLBs

    Agent runs inspect, centers bottom floor pivot, simplifies to <=30k tris, and packs 1024px WebP + Meshopt.

  3. STEP 03
    Verify <1.5 MB size & lazy poster embed

    Rejects unoptimized multi-megabyte meshes and pairs every web 3D viewer with an instant static WebP LCP poster.

1. Install for your tool

Pick the app you use below for the exact verified command or config—zero manual guessing.

Direct raw file (SKILL.md) ↓
Claude Code (.claude/skills/) bash
Installs into .claude/skills/gltf-transform-web-3d/SKILL.md for automated WebGL/GLB optimization.
mkdir -p .claude/skills/gltf-transform-web-3d
curl -fsSL https://framesfield.com/raw/skills/gltf-transform-web-3d-compression-skill -o .claude/skills/gltf-transform-web-3d/SKILL.md

2. Inspect or download the full SKILL.md file

This is the exact raw file served at /raw/skills/gltf-transform-web-3d-compression-skill.

glTF-Transform Web 3D GLB Compression Skill SKILL.md
---
name: gltf-transform-web-3d
description: Inspect, center floor pivots, simplify triangles (<=30k tris), convert PBR textures to 1024px WebP, and Meshopt/Draco-compress raw Tripo 3D, Hyper3D Rodin, or Meshy 3D GLB assets under 1.5 MB using @gltf-transform/cli with zero-LCP web viewer integration.
---

# glTF-Transform Web 3D GLB Optimization Protocol

Raw `.glb` exports from Tripo 3D, Hyper3D Rodin, and Meshy 3D frequently weigh `12–25 MB` with `100k+` triangles and uncompressed 4K PNG textures. Never ship raw AI GLBs straight into `public/`. Run this deterministic optimization chain on every 3D asset:

## 1. Inspect Baseline Geometry & Texture Weight
```bash
npx @gltf-transform/cli inspect ./raw/sku.glb
```
Record starting triangle count, embedded texture resolutions (`2048`/`4096`), and byte size.

## 2. Center Bottom Floor Pivot & Compress (`-90% to -95%` Weight)
```bash
npx @gltf-transform/cli center ./raw/sku.glb /tmp/sku-centered.glb --pivot below
npx @gltf-transform/cli optimize /tmp/sku-centered.glb ./public/models/sku.glb \
  --simplify --simplify-ratio 0.25 \
  --texture-compress webp --texture-size 1024 \
  --compress meshopt
rm -f /tmp/sku-centered.glb
npx @gltf-transform/cli inspect ./public/models/sku.glb
```
- If the host viewer only ships a Draco decoder (and not Meshopt), swap `--compress meshopt` to `--compress draco`.
- For hero SKUs with fine printed dials or micro-bevels, keep `--simplify-ratio 0.35` or `--texture-size 1536` while still enforcing the hard `<= 2.0 MB` ceiling.

## 3. Hard Production Budgets (Enforce Before Commit)
- **Hero PDP Interactive GLB:** `<= 1.5 MB` (hard max `2.0 MB`), `<= 30,000` triangles, bottom pivot centered at `(0, 0, 0)`.
- **Multi-SKU Grid Preview GLB:** `<= 600 KB`, `<= 10,000` triangles, `512px` WebP textures.
- **Static Poster Companion:** Always generate a matching `< 80 KB` static WebP hero still for `poster="..."` so initial page paint never downloads WebGL or 3D bytes.

3. Test it right away (sample prompt & result)

Sample prompt / input
"Optimize all 5 raw Tripo 3D GLB files in ./raw-3d/ under 1.5 MB each with centered floor pivots and report before/after sizes and triangle counts."
What happens when it runs
- Runs inspect -> center (--pivot below) -> optimize (--simplify-ratio 0.25 --texture-compress webp --texture-size 1024 --compress meshopt) across all 5 GLBs.
- Prints clean scorecard showing raw 89.4 MB total shrunk to 5.4 MB total (avg 1.08 MB/SKU, 22k–28k tris).

What you need & known limits

Requirements

  • Node.js 18+ (npx @gltf-transform/cli)
  • Raw .glb files exported from Tripo 3D, Hyper3D Rodin, Meshy 3D, or Blender

Watch out for

  • Keep the uncompressed raw .glb / Quad .fbx master archived outside public/ right after download (Tripo 3D enforces 7-day server retention) if artists will later re-light or sculpt it in Blender
  • Verify your target 3D viewer (@google/model-viewer or Three.js GLTFLoader) loads the matching decoder (MeshoptDecoder or DRACOLoader)

Frequently Asked Questions

Should I pick Meshopt or Draco compression for web GLB models?
Meshopt decodes significantly faster on mobile CPUs, handles skinned animations cleanly, and compresses almost identically to Draco once served over Brotli/Gzip CDN hosting. Use Draco if your viewer environment already bundles DRACOLoader without MeshoptDecoder.
Does resizing PBR textures from 4096px PNG to 1024px WebP ruin product detail?
On a standard desktop or mobile product viewer occupying 500–800 CSS pixels, 1024px WebP PBR textures look visually indistinguishable from 4096px PNGs while slashing texture bytes by 85–92%.
Use this page in AI tools or notes
raw .md