UV Seams and Material Boundaries During Mesh Decimation
Simplify geometry without tearing textures or collapsing material structure by treating corner attributes, seams, islands, and primitive boundaries explicitly.
A geometric simplifier can preserve the shape of a model and still destroy its appearance. Texture coordinates can stretch, islands can overlap, seams can shift across visible surfaces, and tiny material regions can vanish. The cause is simple: rendered meshes attach attributes to triangle corners, not to abstract geometric positions alone.
Production decimation needs a policy for UVs and materials before the first edge collapses. Sometimes the right policy is to lock a boundary. Sometimes it is to preserve a discontinuity while reducing samples along it. Sometimes an inefficient source layout should be rebuilt and rebaked rather than frozen forever.
One position can carry several UV values#
Imagine a cube corner shared geometrically by three faces. A face-by-face unwrap places that corner in three different regions of the image. The corner therefore needs three UV values and usually three rendered vertex records even though all occupy the same XYZ position.
These per-corner variants are often called wedges. A mesh data structure that stores one UV per geometric vertex must duplicate the vertex at seams. A half-edge or corner-attribute structure can retain one geometric position with distinct corner data.
This distinction matters during collapse. Welding two records because their positions match can merge unrelated UV islands. Treating every duplicate as completely unrelated can create cracks in geometry or prevent shared simplification.
Before reduction, report:
- geometric position count;
- rendered vertex count;
- UV sets per primitive;
- number and length of UV seam edges;
- island count and occupied area;
- overlap and mirroring policy;
- material primitive count;
- positions duplicated across primitives.
A rendered-to-geometric vertex ratio of 2.4 is not automatically bad. It can be explained by real seams, hard normals, materials, or skin attributes. It is a clue to inspect.
What makes an edge a UV seam#
For two triangles sharing a geometric edge, compare the UV values on both sides for the two endpoints. If corresponding corner coordinates differ beyond a small numerical tolerance, the edge is a UV discontinuity.
Some seams are unavoidable:
- unwrapping a closed shape to a plane;
- separating front and back of a thin object;
- isolating a hard corner for distortion control;
- unique label or decal regions;
- mirrored islands with opposite tangent handedness;
- different UV sets for lightmaps or occlusion.
Others are artifacts: every triangle became its own island, duplicate islands are offset by tiny values, or an exporter split coordinates that should match.
Classify before locking. A scan with 60,000 tiny islands may become almost unsimplifiable under a strict seam constraint. Repacking and rebaking can be better than preserving a broken parameterization.
Material boundaries are primitive boundaries in glTF#
One glTF mesh primitive references one material. Faces with different materials are stored in separate primitives, each with its own index domain. A simplifier processing primitives independently cannot collapse an edge across that boundary even when both materials are identical.
This affects reduction and bytes:
- boundary vertices are duplicated between primitives;
- each primitive creates a draw candidate;
- tiny material regions retain minimum topology;
- geometry cannot be optimized globally;
- separate compression payloads can add overhead;
- LODs may change primitive and material mapping.
Deduplicate materially identical definitions first where semantics and renderer behavior permit. If two materials both use the same factors, images, alpha mode, sidedness, UV transforms, and extensions, their naming difference may not justify separate primitives.
Do not merge opaque and blended regions, or surfaces requiring independent variants, simply to help the simplifier. Material state is part of correctness.
Four seam policies#
Lock the seam#
Neither seam topology nor seam vertex position can change. This is safest for final bakes and critical labels but can block reduction along long oversampled borders.
Preserve the seam, allow sliding#
The discontinuity remains, while vertices can collapse or move along its geometric polyline. This reduces samples on straight boundaries without letting the seam drift across the surface.
Penalize seam change#
Collapses receive additional cost based on UV stretch, seam motion, or attribute mismatch. The simplifier can cross a low-value seam if the reduction benefit outweighs the penalty.
Rebuild parameterization#
Simplify geometry without preserving original UV layout, then unwrap and bake textures again. This offers the most freedom and often the best result for scans or generated assets, but dependent material work must be regenerated.
Choose per asset and UV set. UV0 carrying visible product artwork can be locked while UV1 for a regenerated lightmap can be rebuilt.
Measuring UV distortion#
A geometric triangle maps to a UV triangle. Compare local changes in length, area, angle, and orientation.
Useful measures include:
- ratio of UV edge length to 3D edge length;
- change in texel density;
- UV triangle area divided by surface area;
- conformal or angular distortion;
- stretch singular values of the local mapping;
- sign of UV area, which detects flips;
- overlap area between islands;
- displacement in delivered texels.
Texel displacement connects UV error to image resolution. A UV shift of 0.001 on a 2048-wide texture corresponds to about 2.048 texels along that axis. On a 512 map it is about 0.512 texel. One normalized UV threshold cannot describe both.
Weight visible UV error by the texture actually sampled and projected importance. A roughness mask may tolerate a different shift from small printed base-color text.
After simplification, render a high-frequency checker and the real material. A checker exposes stretch; the real map exposes whether the affected region matters.
Interpolating UVs after a collapse#
When endpoints u and v collapse to position w, the new UV cannot always be a simple average. If w lies 25% along an edge in 3D and the edge mapping is linear, interpolating 25% in UV space preserves samples along that edge. An unconstrained QEM optimum may not lie on the edge, requiring local parameter interpolation.
At a seam, there are at least two UV answers—one for each side. The replacement vertex must retain separate wedge values. Averaging them across islands creates a coordinate in unrelated image space.
For interior triangles, barycentric projection can estimate attributes from the source surface. Attribute-aware simplifiers incorporate this into cost and placement. Reprojection after simplification can transfer UVs from the nearest source triangle, but nearest geometry may select the wrong layer on thin or overlapping surfaces.
Use ray direction, cage, component identity, and material identity to constrain transfer.
Mirrored UVs and tangent handedness#
Mirroring saves texture area when appearance can be symmetric. The mapping reverses orientation, which affects tangent handedness. glTF tangents have four components; the fourth encodes the sign used to construct the bitangent.
If decimation welds mirrored and non-mirrored wedges, normal mapping can flip across the seam. A surface may look geometrically intact while highlights invert.
Preserve the orientation sign as a discontinuous attribute. Regenerate tangents after final topology and UV coordinates using a basis compatible with the target, commonly MikkTSpace in many pipelines. Then inspect mirrored islands under a moving directional light.
Do not calculate tangents before decimation and assume interpolated values remain valid after triangle directions change.
Material-region survival#
Small face sets can carry important meaning: a 2-centimeter indicator light, a logo, a rubber seal, or a cut edge. A geometry-only cost may remove the entire region because it contributes little surface area.
Inventory material regions as connected components and record:
- surface area;
- triangle count;
- projected pixel coverage from approved cameras;
- semantic name;
- whether the material changes render state;
- whether the region can move into a texture or vertex color;
- minimum LOD where it must survive.
Apply a minimum region rule or landmark constraints. If a 6-triangle logo region must survive LOD0, lock its boundary or redesign the representation. At a distant LOD, baking it into base color may be better than preserving a separate primitive.
LOD generation can change material architecture intentionally. Document a mapping from source materials to each level rather than relying on primitive order.
Texture atlases and simplification#
Atlasing several material images can enable geometry to share one material primitive. Repack UVs, combine compatible channels, and merge geometry before or after simplification based on tool support.
Atlas pitfalls include:
- inadequate padding at lower mips;
- mixing color and linear data incorrectly;
- wasting area on unequal texel-density needs;
- baking tiling surfaces into unique pixels;
- losing per-product variant swaps;
- loading unrelated regions together;
- exceeding target maximum texture dimensions.
If an atlas is part of the final delivery, evaluate simplification against the final UV coordinates. Simplifying under the old layout and then repacking can invalidate attribute-aware costs and normal-map bakes.
Keep a mapping from original faces or semantic parts to atlas regions for debugging.
Lightmap and second-UV concerns#
A secondary UV set may require non-overlapping islands and padding for baked light. Decimation changes charts, triangle area, and projected texel density. Preserving UV1 coordinates while removing triangles can leave inefficient space but retain a bake only if the mapping and lighting values remain valid.
Usually a generated lightmap UV and bake should be regenerated after topology changes. In engines, perform simplification before final lightmap unwrap and baking when the pipeline allows it.
If LODs use independent lightmaps, ensure lighting does not pop at transitions. If they sample one shared lightmap, transfer and test UVs carefully.
Never assume UV0 and UV1 have the same seams or semantic weight. Report them separately.
Normal-map bakes bind geometry and UVs#
A tangent-space normal map encodes high-detail direction relative to the low-poly triangle's tangent basis. Changing triangle vertices, diagonals, normals, tangents, or UVs changes that basis.
The stable sequence is:
- finish simplification and triangulation;
- decide hard-normal boundaries;
- finalize UV seams and packing;
- generate or verify normals;
- generate target-compatible tangents;
- bake normal and material maps;
- export without later topology changes;
- verify in the production runtime.
If decimating an already baked asset, either constrain changes so the existing bake remains acceptable or rebake. Inspect seams at grazing angles and under a rotating light. A static diffuse preview hides tangent errors.
Processing multi-material input#
A robust pipeline can:
- canonicalize and deduplicate identical materials;
- build a unified geometric adjacency graph across compatible primitive boundaries;
- retain wedge attributes and material IDs per corner or face;
- classify hard render-state boundaries;
- simplify with geometry, UV, normal, and material penalties;
- repartition faces by final material;
- rebuild primitive-local index buffers;
- generate tangents and compress the result.
This allows geometry-aware decisions without pretending all materials are the same. Implementation complexity is higher than simplifying each primitive independently, so compare the improvement on actual asset classes.
If a tool cannot preserve a required attribute, mark the asset unsupported rather than silently dropping it.
Validate the exported result#
Do not stop at the DCC viewport. Export to GLB and inspect:
- UV accessor counts and component types;
- selected texture-coordinate set per material texture;
- KHR_texture_transform or other relevant extensions;
- primitive and material assignments;
- rendered vertices after seam splits;
- tangent presence and handedness;
- image references and color spaces;
- validation warnings.
Render a test pattern that labels U direction, V direction, island grid, and borders. A plain checker can look correct when an island is mirrored unexpectedly.
Compare screenshots from the target viewer and a second conforming viewer. If they differ, inspect tangent generation, sampler wrapping, texture transforms, and extension support.
Candidate scorecard#
For each reduction candidate, record:
- triangles and rendered vertices;
- primitive and material count;
- total seam-edge length in object units;
- island count and occupancy;
- maximum UV displacement in texels;
- number of flipped UV triangles;
- overlap outside allowed mirrored regions;
- material regions lost or merged;
- normal-map image difference at fixed views;
- file bytes and runtime draws.
A candidate with fewer triangles but 30% more rendered vertices due to new splits is suspicious. A candidate with one fewer primitive but a 4096 atlas replacing four 512 maps may regress memory.
Common failures#
Welding by position. Distinct UV, normal, material, and skin wedges are destroyed.
Locking every seam. Poor source unwrapping prevents useful reduction.
Averaging across islands. The new UV lands in unrelated image content.
Ignoring texture dimensions. Normalized UV error is not converted to texels.
Simplifying each primitive independently. Compatible material boundaries remain oversampled and duplicated.
Repacking after baking. Tangent-space and image correspondence become invalid.
Keeping tiny distant material primitives. Draw overhead survives after visual detail is gone.
UV and material checklist#
- Geometric and rendered vertices are distinguished.
- UV discontinuities are represented as corner or wedge attributes.
- Every UV set has its own seam and overlap policy.
- Identical materials are canonicalized before primitive decisions.
- Opaque, masked, blended, and extension states are never merged accidentally.
- UV error is measured in delivered texels as well as normalized units.
- Mirroring preserves tangent orientation and intended asymmetry.
- Critical small material regions have semantic survival rules.
- Atlas choices account for padding, variants, loading, and memory.
- Lightmap UVs and bakes are regenerated or explicitly preserved.
- Tangents and normal maps follow final topology and UVs.
- Exported primitives and accessors pass target-runtime review.
Sources and further reading#
- Khronos glTF 2.0 specification: meshes and attributes
- Garland and Heckbert: Simplifying Surfaces with Color and Texture Using Quadric Error Metrics
- Blender Manual: UV unwrapping
- MikkTSpace reference implementation
- Khronos glTF Tutorial: textures, images, and samplers
UV seams and material boundaries are part of the rendered surface. Preserve or rebuild them intentionally, score their error in texture and runtime terms, and never let a lower triangle count conceal broken correspondence.