NormalAttribute
NormalAttribute is a data attribute used in 3D graphics and game engines to store normal vectors for vertices or faces. Each element represents a normal direction at a vertex (or for a polygon in flat shading), typically as a 3-component vector (x, y, z). The attribute is used in lighting calculations to determine how light interacts with a surface, influencing shading models such as Lambertian, Phong, or physically based rendering (PBR).
Storage and formats commonly involve three floating-point values per vertex, often normalized to unit length. Some
Shading effects rely on NormalAttribute to compute illumination. Per-vertex normals enable smooth shading by averaging adjacent
Transformation considerations are important: when a mesh is transformed by a model matrix, normals must be
In practice, NormalAttribute is exposed as a vertex attribute in geometry data, often as a 3-component Float32Array