Normals
The direction a surface faces, which decides how it is lit.
A normal is an arrow pointing straight out of a surface. Lighting compares it with the direction of the light: facing the light means bright, facing away means dark. Wrong or flipped normals are why imported models look black, inside-out or strangely shaded. Normal maps fake small bumps by bending these arrows per pixel.
Try this: Carry the lantern around the rock. Each face lights up when its normal (cyan line) points at you. Flip the normals and the side facing you goes dark. Smooth makes it look round.
Walk around the rock: each face lights up when its normal (cyan) points at your lantern.
Prompt bit
Works for 2D or 3D in any engine (Unity, Unreal, Godot, web). Paste the short one for a quick fix, or the detailed one when you want it done properly.
Fix normals on 3D models: recalculate them pointing outward with a smoothing angle around 60 degrees, light with max(0, dot(normal, lightDirection)), transform them with the normal matrix after non-uniform scaling, and flip inverted faces instead of hiding them with double-sided materials.
Handle normals correctly (3D, and 2D sprite lighting with normal maps). After importing a model, make sure normals point outward: recalculate them in the modelling tool or importer, and flip any inverted faces rather than turning on double-sided rendering. Choose smoothing: smooth shading (shared normals) for organic shapes, flat or hard edges (split normals at an angle, default 30 to 60 degrees) for mechanical ones. In shaders, transform normals with the inverse transpose of the model matrix (the normal matrix) so non-uniform scaling does not skew lighting, and renormalize after interpolation. Basic diffuse lighting is max(0, dot(N, L)) where L points toward the light. Use tangent-space normal maps for detail and keep the green channel convention consistent (OpenGL vs DirectX) between your art tool and engine. In 2D, normal maps on sprites give dynamic lighting. Add a debug view that draws normals as short lines.
Where it's used
- 3D lighting: every lit surface
- Normal maps: bricks, armour and skin detail
- Physics: bounce directions and slope angles
- Shaders: rim lighting, toon shading and reflections
- 2D games: dynamic lights on sprites
Common mistakes
Inverted normals hidden by double-sided materials, non-uniform scaling without the normal matrix, mixing OpenGL and DirectX normal map conventions (bumps look dented), and smooth shading on hard-edged models so they look blobby.
Writing this with an AI assistant? See our best AI coding assistants for game developers.
Missing a concept? Request one.


