PDA

View Full Version : normal map -> height map?



Vexator
02-03-2007, 06:27 AM
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! :)

zedus
02-03-2007, 01:27 PM
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.

CrazyButcher
02-03-2007, 02:47 PM
it can be found here:

http://www.inf.ufrgs.br/~oliveira/RTM.html

Vexator
02-03-2007, 03:49 PM
great thx!

fenris
02-06-2007, 11:32 AM
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 :) 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!
http://nifelheim.dyndns.org/~cocidius/normalmap/

plasmonster
02-07-2007, 02:20 PM
Looks nice, Fenris.

I was about to break out my multigrid Poisson solver, but then I remembered I don't have one ;)