Back

Geometry Transform Passes

Deep dive into geometry transforms that prepare your model for compression.

transformgeometryoptimization
Updated 2025-06-29

Transform passes are the first step in the pipeline. Think of them as house-keeping for your scene – they strip dead weight and reorganise data so later compression stages work smarter, not harder.

Why transforms matter

A glTF can contain redundant vertices, unused attributes, deeply nested node hierarchies and dozens of draw-calls that stall mobile GPUs. Running transforms before compression pays dividends: you often save 10-40 % in file size before Draco kicks in.

Options

  • Remove duplicate vertices – Uses hashing to find vertices with identical POSITION / NORMAL / UV data. Expect ~5% savings on CAD exports. See the official documentation on deduplication.
  • Remove unused vertices – Purges stray data after mesh edits. Especially useful when baking lightmaps which sometimes leave orphan verts.
  • Geometry simplification – Implements a Quadric Error Metrics (QEM) decimator, first presented by Garland & Heckbert in 1997. Use values between 0.2-0.5 for hero assets and 0.05 for background props. The original paper is an excellent resource: Surface Simplification Using Quadric Error Metrics.
  • Instance meshes – Converts identical meshes into GPU instancing. WebGL2 can push thousands of instances in a single draw-call. The WebGL2 Fundamentals guide provides a great practical example.
  • Flatten nodes – Removes empty parents; good practice for AR where deep hierarchies hurt performance.
  • Merge meshes – Detects meshes that share the same material and bakes them into a single draw-call. This is the easiest way to cut WebGL CPU overhead on scenes with dozens of small parts (e.g. screws, bolts). UVs and tangents are preserved – but if two meshes reference different materials they stay separate to prevent visual glitches.
  • Weld vertices – Merges vertices within a tolerance (0.0001 m). Useful after boolean ops in CAD that leave micro gaps.

Best Practices

  • Run remove duplicate + weld first – they often enable bigger wins later.
  • Simplify before texturing; materials baked to high-poly meshes can break UVs.
  • For animated characters, avoid aggressive welding which may break skin weight continuity.