glTF Morph Target Normalization and Out-of-Range Deltas

glTF handles morph target deltas through additive blending, distinguishing between mathematical accessor normalization and geometric vector re-normalization. When delta attributes or the accumulated results exceed standard ranges—such as unit vector limits for normals or standard component bounds—the glTF specification provides specific mathematical constraints and client-side processing rules to maintain rendering consistency.

Delta Representation and Storage Bounds

Morph targets in glTF represent relative displacements rather than absolute positions. Target attributes—such as POSITION, NORMAL, and TANGENT—store delta values that are added to the base mesh attributes using the formula:

\[\text{Result} = \text{Base} + \sum (\text{Weight}_i \times \text{Delta}_i)\]

For delta attributes stored using floating-point formats (FLOAT), values are not artificially clamped by the specification. Positions and general displacements can exceed standard bounding dimensions or nominal unit bounds.

When delta attributes use quantized integer accessors with the normalized: true property, values are constrained strictly by the fixed-point mapping rules:

  • Signed integers (BYTE, SHORT): Mapped symmetrically to \([-1.0, 1.0]\). A SHORT value of -32767 maps to -1.0, and 32767 maps to 1.0 (with -32768 also mapping to -1.0 per glTF 2.0 integer normalization rules).
  • Out-of-range integer deltas: Normalized integer accessors cannot represent displacements outside the \([-1.0, 1.0]\) delta range. If displacements exceed this range, exporters must either utilize full 32-bit FLOAT accessors or apply the KHR_mesh_quantization extension, which allows custom scaling and offset transforms to handle arbitrary ranges.

Geometric Vector Normalization

Delta values applied to direction vectors like NORMAL and TANGENT inevitably produce non-unit vectors after linear accumulation.

The glTF specification defines the handling of these vector deltas as follows:

  1. Delta Formulation: Morph target normal and tangent deltas are raw directional vectors representing change, not normalized replacement vectors.
  2. Post-Accumulation Normalization: Clients must normalize the final accumulated vector in the vertex shader or during CPU pre-computation:

\[\mathbf{N}_{\text{final}} = \text{normalize}\left(\mathbf{N}_{\text{base}} + \sum w_i \Delta \mathbf{N}_i\right)\]

Even if individual deltas or morph weights (\(w_i\)) are large enough to reverse, skew, or scale the vectors far outside the unit sphere, glTF delegates the resolution to a standard vector normalization function (normalize()). If the resulting vector approaches zero length due to opposing vectors canceling each other out, handling defaults to implementation-defined fallback behavior (typically maintaining the base normal or using an arbitrary unit vector to prevent division by zero).

Weight Ranges and Bounds Expansion

The glTF 2.0 specification allows morph target weights to fall outside the standard \([0.0, 1.0]\) range unless explicitly clamped by application logic. Negative weights or weights exceeding \(1.0\) can cause vertex positions to extend significantly beyond the base mesh's bounding box.

  • Bounding Boxes: Each morph target POSITION accessor must provide its own min and max properties defining the local bounds of the deltas.
  • Mesh Bounds: The base mesh's min and max bounds do not account for morph targets. Runtimes dynamically calculate updated bounding volumes for frustum culling by adding the scaled delta bounds to the base bounds based on the active weights.