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]\). ASHORTvalue of-32767maps to-1.0, and32767maps to1.0(with-32768also mapping to-1.0per 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
FLOATaccessors or apply theKHR_mesh_quantizationextension, 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:
- Delta Formulation: Morph target normal and tangent deltas are raw directional vectors representing change, not normalized replacement vectors.
- 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
POSITIONaccessor must provide its ownminandmaxproperties defining the local bounds of the deltas. - Mesh Bounds: The base mesh's
minandmaxbounds 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.