normal map -> height map?

hi everyone!
is there a way to convert a tangent space normal map back to a height map? i’d like to use some textures which i only have normal maps for with parallax mapping.

thanks in advance! :slight_smile:

hopefully i’m not mistaken on this one,
but iirc, i saw some doom3 mod, that added a parallax mapping effect to the game.

it conained a tool that does exactly what you describe.

it can be found here:

great thx!

My normalmap plugin for GIMP also has the ability to convert normal maps to height maps, though the algorithm I came up with is nowhere near as good as the above mentioned tool. But mine comes with source code :slight_smile: I basically just detect slopes in the normal map in 4 different directions (left to right top to bottom, right to left top to bottom, etc…) and average the results to minimize streaking. Then it provides a tweakable contrast value to help hide more of the artifacts. I usually then run the result through a sharpen filter. It works well enough for most normal maps, but quickly degrades in quality for really complex maps.

EDIT: forgot the URL!

Looks nice, Fenris.

I was about to break out my multigrid Poisson solver, but then I remembered I don’t have one :wink: