---
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: "Fix Dark Shadow Streaks and Slow 18 MB AI 3D GLB Loads"
description: "Start from a flat 5600K shadow-free studio reference still, compress raw GLBs under 1.5 MB via gltf-transform (center --pivot below + simplify + 1024px WebP + Meshopt), and lazy-embed behind an instant 55 KB WebP poster."
canonical: "https://framesfield.com/fixes/ai-3d-glb-dark-shadows-and-slow-load"
---

# Fix Dark Shadow Streaks and Slow 18 MB AI 3D GLB Loads

> Start from a flat 5600K shadow-free studio reference still, compress raw GLBs under 1.5 MB via gltf-transform (center --pivot below + simplify + 1024px WebP + Meshopt), and lazy-embed behind an instant 55 KB WebP poster.

- **Canonical URL:** https://framesfield.com/fixes/ai-3d-glb-dark-shadows-and-slow-load
- **Category:** Visual & 3D Craft
- **Error Signature:** `Storefront audit: product.glb 18.4 MB (142,000 tris, 4096px PNG textures) | Mobile LCP > 5.8s | Baked dark shadow rotates across lit side`
- **Last Verified:** 2026-12-01

## Observed Symptom

Your Tripo 3D, Hyper3D Rodin, or Meshy 3D model displays permanent dark shadow streaks rotating across lit surfaces, orbits awkwardly off-center, and stalls mobile product pages at 15–25 MB.

## Technical Root Cause

Dramatic directional lighting in the 2D reference photograph bakes directly into the 3D PBR base-color albedo map, while raw API GLB exports ship unsimplified 100k+ triangle meshes, off-center origins, and 4K uncompressed PNG textures without a static WebP poster.

## Under the Hood

Image-to-3D networks infer material albedo straight from pixels in your reference photograph. If the product photo has heavy dramatic side lighting or strong table reflections, the 3D generator paints those dark shadows permanently onto the base color texture—so when a shopper spins the product under bright WebGL environment lighting, a black shadow streak rotates right across the sunlit front. When generating through Tripo 3D (now defaulting to Texture v3.5), enabling the `delight` parameter strips baked directional shadows automatically—and remember Tripo enforces 7-day asset retention, so copy finished GLBs into your own storage immediately.

On the web performance side, raw GLB downloads from Tripo 3D, Hyper3D Rodin, and Meshy routinely weigh 14–25 MB due to 100,000–250,000 raw triangles and uncompressed 4096×4096 PNG PBR maps. Running a two-line `gltf-transform` pipeline (`center --pivot below` + `optimize --simplify --simplify-ratio 0.25 --texture-compress webp --texture-size 1024 --compress meshopt`) shrinks payload size 90–94% down to ~0.9–1.4 MB in 3 seconds, and pairing it with a 55 KB static WebP poster plus `reveal="interaction"` keeps Lighthouse mobile LCP completely green.

## Before vs. After

### Broken (Broken Storefront Embed (Raw 18.4 MB GLB Auto-Loading on Page Paint))

```
<!-- Downloads 18.4 MB immediately on mobile 4G, off-center pivot, blocks LCP -->
<model-viewer src="/models/raw_tripo_18mb.glb" auto-rotate camera-controls></model-viewer>
```

### Verified Fix (Verified Production Embed (1.1 MB Meshopt GLB + Instant 55 KB WebP Poster))

```
<!-- Instant 55 KB LCP WebP paint; 1.1 MB compressed GLB loads ONLY when shopper taps to spin -->
<model-viewer src="/models/sku_1mb.glb" poster="/images/sku-poster.webp" reveal="interaction" camera-controls></model-viewer>
```

Combining Meshopt geometry/WebP texture compression (~94% smaller) with interaction-triggered WebGL hydration protects mobile conversion rates and Core Web Vitals.

## Copy-Paste Fix (fix-ai-3d-glb.sh)

```bash
# 1. Inspect raw weight, triangle count, and texture resolution first
npx @gltf-transform/cli inspect ./raw/product.glb

# 2. Center bottom floor pivot cleanly at (0, 0, 0) so orbit controls never swing off-axis
npx @gltf-transform/cli center ./raw/product.glb /tmp/centered.glb --pivot below

# 3. Simplify geometry (~24k tris), resize PBR maps to 1024px WebP, and apply Meshopt (<1.5 MB target)
npx @gltf-transform/cli optimize /tmp/centered.glb ./public/models/product.glb \
  --simplify --simplify-ratio 0.25 \
  --texture-compress webp --texture-size 1024 \
  --compress meshopt

rm -f /tmp/centered.glb
ls -lh ./raw/product.glb ./public/models/product.glb
npx @gltf-transform/cli inspect ./public/models/product.glb
```

## Step-by-Step Resolution

1. **Eliminate directional cast shadows in the 2D input photo first:** If dark streaks are baked into the albedo texture, isolate the SKU under flat diffused 5600K studio light (or an OpenAI GPT-Image-2.6 RGBA plate) and regenerate the $0.30–$0.40 GLB cleanly.
2. **Anchor the floor pivot and run gltf-transform optimize:** Snap the base to Y=0 with --pivot below and compress geometry + 1024px WebP PBR textures down from ~18 MB to ~0.9–1.4 MB.
3. **Guard Core Web Vitals with a matching 55 KB WebP poster + reveal="interaction":** Render an immediate static WebP hero still matching the opening 3D camera angle and hydrate WebGL strictly when the shopper clicks to spin.

## Verification Check (Confirm Final GLB Clears Mobile Weight (<1.5 MB) & Triangle (<30k) Ceilings)

```bash
ls -lh ./public/models/product.glb && npx @gltf-transform/cli inspect ./public/models/product.glb | head -n 35
```

**Expected healthy output:**

```text
1.1M  ./public/models/product.glb   # WebP 1024x1024 textures + Meshopt + ~22,000 tris + bottom pivot at Y=0
```

## Prevention Guardrails

1. **Shoot or generate flat 5600K reference inputs for every 3D SKU:** Clean diffuse reference photos produce clean neutral PBR base-color maps that respond naturally to real-time WebGL environment maps.
2. **Enforce a CI file-size ceiling of 2.0 MB on public/models/*.glb:** Blocking raw 15–25 MB API downloads in pre-commit or CI ensures no unoptimized 3D file ever regresses storefront LCP.
3. **Automate compression via Skill 42 (glTF-Transform Web 3D Compression):** Install Skill 42 into Claude Code or Cursor so every newly generated Tripo/Rodin/Meshy export runs through center + Meshopt automatically.

## FAQs

### Can I fix baked shadows in Blender without regenerating the 3D model?

Minor dark patches can be painted over in Blender Texture Paint or Delighting passes, but regenerating from a flat-lit reference image for $0.30–$0.40 is usually 10x faster and cleaner.

### What is the ideal maximum GLB file size for mobile e-commerce viewers?

Target 0.8 to 1.5 MB (hard ceiling 2.0 MB) and under 30,000 triangles for interactive hero product viewers.

### Should I use Meshopt or Draco compression in gltf-transform?

Meshopt decodes significantly faster on mobile CPUs with minimal WebAssembly overhead and supports both geometry and animation cleanly; Draco is slightly smaller on dense static meshes but adds decoder latency.

### Why does my compressed GLB render completely black inside Three.js?

PBR metallic/roughness materials require an IBL environment map (HDRI) to reflect light. Pass environment-image="neutral" on <model-viewer> or load a PMREM room environment in Three.js.
