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