61 · Rendering · 3D (and 2D lighting)

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.

←↑↓→ or WASD moveN correct / flipped / smoothD-pad to walk

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.

41 words · one sentence to paste as is

Where it's used

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.

Related concepts

New concepts, in your inbox.

One short email when we add new concepts, plus our weekly roundup of AI tools for game devs. Unsubscribe any time.