Normal Map Workbench

Flip a normal map's green channel

Convert a normal map between OpenGL (Y+) and DirectX (Y−). Drop in a PNG and the tool works out which convention it uses, lights it the way your engine will, and writes the flipped copy with the same size, bit depth and alpha. The demo below starts with a dome test map in OpenGL style.

Light it the way

Drag on the preview to move the light. Raised shapes should be bright on the side facing the light.

Loading…

The PNG keeps its size, bit depth and alpha; only green changes (G becomes max − G). Nothing is uploaded.

The only difference is green

Both conventions put +X (red) to the right and +Z (blue) out of the surface. OpenGL style puts +Y (green) toward the top of the texture; DirectX style puts it toward the bottom. Converting is G → 1 − G on every pixel; red, blue and alpha don't change.

OpenGL (Y+)+X = R+Y = G (up)+Z = B (out)DirectX (Y−)+X = R+Y = G (down)+Z = B (out)

Why the wrong one looks pressed in

On a raised bump, the slope facing the top of the texture has normals that tip toward the top. OpenGL writes that as green above half, DirectX as green below half. Read a map with the wrong rule and every slope that faced up now faces down, so a light from above shades the top of each bump and lights the bottom: it reads as a dent.

Side view along the texture's Y axis← toward the top of the texturetoward the bottom →slope facing the topG: OpenGL ≈ 0.7, DirectX ≈ 0.3slope facing the bottomG: OpenGL ≈ 0.3, DirectX ≈ 0.7

Which engines want which: Unity, Godot and Blender document OpenGL style; Epic's Fab treats Unreal normal maps as DirectX unless the file name says otherwise. The OpenGL vs DirectX guide quotes each engine's documentation. To make a new map in the right convention from the start, use the normal map generator.

Questions

How does it tell OpenGL from DirectX?
A normal map made from a real surface is a slope field, and a slope field has no curl: the change of the x-slope going up equals the change of the y-slope going right. Read with the wrong green direction, the two sides have opposite signs. The tool measures the mismatch both ways and reports the smaller one, with the ratio between them.
When can't it tell?
When every feature runs straight across or straight down (plain bricks, straight planks, stripes), both readings fit equally well and it says so. Then look at the lit preview: raised shapes should be bright on the side that faces the light.
Should I flip the file or the import setting?
Either works. Unreal's texture editor has a Flip Green Channel checkbox, Unity's importer can invert green, Godot has a Normal Map Invert Y import option, and 3ds Max's Normal Bump map has Flip Green (Y). Flipping the file is better when the same texture goes to several engines or into an asset pack, because the file name can then say which convention it is.
Does flipping work on object-space normal maps?
No. Object-space maps (rainbow colored, not mostly lavender) store directions in the model's own axes, and the green-channel convention doesn't apply to them. This tool is for tangent-space maps.