john at January 2nd, 2005 00:06 — #1
Is there a way to convert a normal map to a height map? I found a paper on this, but it talks about an iterative method. Has anyone found a direct method?
bladder at January 2nd, 2005 05:11 — #2
If you're using directx you can use the D3DXComputeNormalMap function, otherwise, here
john at January 2nd, 2005 13:45 — #3
Oops, stupid typo. Thanks for your answer. I meant NormalMap to HeightMap, but I wrote it the other way around.
So, now that I fixed the typo, is there a way to convert?
reedbeta at January 2nd, 2005 23:40 — #4
It seems to me you could just start at the upper-left corner and add offsets calculated from the normal map values as you move right and down. Just the opposite of the way normal maps are calculated from height maps (by taking differences between adjacent elements).
You would want to do it in floating point, keeping track of the maximum and minimum height reached, and then scale to [0, 255] range when done.
I don't know how accurate this would be at reproducing the original height map. Might take some tweaking.