glTF Shader Normal Normalization Visual Artifacts

In 3D rendering pipelines adhering to the glTF specification, surface normals dictate how light interacts with physically based rendering (PBR) materials. When vertex normals are linearly interpolated across a polygon face during rasterization, their unit length is mathematically compromised. Failing to re-normalize these vectors—or normal map outputs—in the fragment shader leads to inaccurate dot-product calculations. This article outlines the specific visual artifacts that manifest in glTF shaders when normal vectors are not properly normalized.

Premature Dimming and Flattened Diffuse Lighting

The base layer of glTF lighting relies on Lambertian diffuse reflection, calculated via the dot product of the surface normal and the light direction vector (\(N \cdot L\)). When interpolated normal vectors shrink below unit length (\(|N| < 1\)), the calculated dot product drops proportionally. This causes surfaces to appear significantly darker and flatter than intended. Surfaces oriented directly toward a light source lose their dynamic range, leading to muddy, washed-out shading across what should be brightly illuminated geometry.

Warped and Distorted Specular Highlights

Microfacet BRDF models (such as the standard Cook-Torrance model used in glTF PBR) rely heavily on micro-surface distributions like GGX. The specular component uses both \(N \cdot L\) and \(N \cdot H\) (where \(H\) is the half-way vector) to calculate the distribution and geometric shadowing terms. If the normal vector is unnormalized:

  • Highlights may shrink, distort, or clip prematurely at glancing angles.
  • Overly short normals dampen specular intensity, giving reflective materials a dull, plastic appearance instead of metallic or polished surfaces.
  • Overly long normals (which can occur from improper normal map scale operations) cause blown-out, over-saturated specular spots that flicker during camera movement.

Polygonal Faceting and Mach Banding

While smooth vertex normals are designed to disguise low-polygon geometry, interpolation reduces normal lengths most severely in the center of triangles compared to the vertices. This non-linear drop in length creates a curvature error across the face. The resulting lighting gradient produces subtle ridges or Mach banding across triangle boundaries. Viewers can visibly perceive the underlying triangular topology, completely breaking the illusion of smooth, curved surfaces.

Discontinuous Normal Map Seams

glTF models utilize tangent space normal maps to render fine surface details. Shaders must normalize the Tangent-Bitangent-Normal (TBN) matrix components and re-normalize the final perturbed normal after unpacking it from the texture. If normalization is skipped:

  • UV island borders show visible geometric cracks and seams due to inconsistent normal lengths across adjacent mirrored or unwrapped faces.
  • Surface bumpiness appears exaggerated, inverted, or completely flattened depending on local UV stretching.
  • Ambient occlusion and environment map reflections (IBL) drift out of alignment with direct lighting, producing mismatched shadows and specular reflections.