Skip to main content
All posts
Practical guides

Pixel Art Normal Maps for 2D Lighting in Unity and Godot

Give transparent sprites directional edge lighting, preserve alpha, and import the normal map in Unity URP or Godot.

Quick answer

Create a normal map with the same dimensions and transparent outline as your sprite. Assign it to the sprite’s normal texture slot, choose a sprite shader that supports 2D lighting, and use a moving light to check each edge. For pixel art, verify filtering and atlas padding at the final scale.

What should I configure in each engine?

CheckUnity URP 2DGodot 4
Lit sprite setup2D Renderer and a Sprite-Lit compatible materialCanvasItem with a CanvasTexture assigned
Normal textureSprite secondary texture, commonly _NormalMapCanvasTexture normal slot
Direction testMove a Light 2D around the spriteMove a PointLight2D around the sprite
Pixel edgesPoint filtering and tested sprite atlas settingsNearest filtering where appropriate
AlignmentSame sprite rect and pivot through importSame source dimensions and frame layout
A pixel-art gold coin, a purple sprite normal swatch, and the coin lit from one side
Alpha-derived bevels can give a flat sprite a rim that reacts to moving lights.

How do I generate and verify a sprite map?

  1. Load an RGBA PNG with transparent padding and a clean silhouette. If you use a sprite sheet, leave a gap between frames so the neighboring frame does not influence edge sampling.
  2. Set a low bevel strength and move the preview light from left to right and from top to bottom. Watch the same edge become bright or dark.
  3. Save the generated map alongside the sprite. Preserve the frame layout when configuring the secondary texture or CanvasTexture.
  4. Create a test scene with one light. Ensure the light and sprite share the expected layer or mask. Compare both directions at the final pixel scale.
  5. If outlines swim when the camera moves, review texture filtering, pixel snap and atlas placement. Test the normal and sprite textures together.

What can alpha tell me about the shape?

Alpha distinguishes background from artwork and can approximate a directional slope along the boundary. Opaque interior details share the same alpha and remain flat with this method. For a concave eye socket or embossed symbol within a fully opaque sprite, author a separate height signal and derive the normal from that information. Compare it with the edge normal under the same light before combining.

Open the browser tool to try this workflow with your own texture.

Frequently asked questions

Why is the entire normal map flat?

An opaque image gives the alpha method no internal height differences. Add transparent surrounding pixels for edge slope, or use an explicit painted height map for internal relief.

Why do some frames appear to light from the wrong side?

Check that normal and color frames share the same UV direction when the sprite is flipped or packed. Test a frame with a recognizable notch so you can identify the affected axis.

References