Jump to content


converting NormalMap to HeightMap


3 replies to this topic

#1 john

    Member

  • Members
  • PipPip
  • 84 posts

Posted 02 January 2005 - 05:06 AM

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?

#2 bladder

    DevMaster Staff

  • Members
  • PipPipPipPip
  • 1057 posts

Posted 02 January 2005 - 10:11 AM

If you're using directx you can use the D3DXComputeNormalMap function, otherwise, here

#3 john

    Member

  • Members
  • PipPip
  • 84 posts

Posted 02 January 2005 - 06:45 PM

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?

#4 Reedbeta

    DevMaster Staff

  • Administrators
  • 5308 posts
  • LocationSanta Clara, CA

Posted 03 January 2005 - 04:40 AM

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.
reedbeta.com - developer blog, OpenGL demos, and other projects





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users