---
agent:
  instructions: "Use this search API to find relevant content across this site with keywords or natural-language queries, instead of crawling individual pages. Results are returned in Markdown."
  endpoint: "https://framesfield.com/.well-known/search?q={query}"
  method: "GET"
  documentation: "https://developers.cloudflare.com/ai-search/how-to/search-for-agents/"
title: "glTF-Transform Web 3D GLB Compression Skill"
description: "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."
canonical: "https://framesfield.com/skills/gltf-transform-web-3d-compression-skill"
---

# glTF-Transform Web 3D GLB Compression Skill

> 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.

- **Canonical URL:** https://framesfield.com/skills/gltf-transform-web-3d-compression-skill
- **Raw Payload URL:** https://framesfield.com/raw/skills/gltf-transform-web-3d-compression-skill
- **Asset Type:** SKILL.md
- **Compatible Hosts:** Claude Code, Cursor, Codex
- **Target Creative Tool:** glTF-Transform / WebGL / <model-viewer>
- **License:** MIT
- **Last Verified:** 2026-11-29
- **Source Reference:** https://gltf-transform.dev/cli

## Setup & Install

```bash
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

```

## Copyable Asset (SKILL.md)

````markdown
---
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.
````

## Example Input

```text
"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."
```

## Expected Output

```text
- 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).
```

## Requirements

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

## Known Limits

- 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`)

## Implementation Notes

## Ship interactive 3D without hurting Lighthouse scores

Follow the full Photo → GLB → Blender → Web Viewer walkthrough in [Workflow 17: Photo to 3D GLB, Blender Rig and Web Spin Viewer](/workflows/photo-to-3d-glb-blender-web-viewer-pipeline) and read [Guide 13: AI 3D Product Design: GLB, Blender and Web Viewers](/guides/ai-3d-product-design-and-web-pipeline-guide).
