/cournia.com/dev/null - normal map to height map home
normal map to height map February 11, 2004

Update: February 19, 2004 - Karl wrote some code to take advantage of the sparse nature of the linear system. The result is the code can solve for large images (512x512) in a matter of seconds, not days.

I've been playing around with trying to convert normal maps to height maps. Initially, I thought that this would be an easy problem to solve. Unfortunately, it has given me some problems. Slides detailing some of my efforts can be found here.

Basically, by solving a linear system, we can reconstruct the height map for for a given normal map. However, the linear system is quite large, so unless you have days of processor time and GB of RAM to spare, you won't be getting a height map from a normal map for an image larger than 32x32.

Here's an example of a 16x16 image (scaled). On the left is the original height map. The center image is the corresponding normal map (generated using a sobel filter). The final image is the height map our linear system produces.

   

Breaking the image up into tiles, solving the tiles, and then relating the tiles together seems to be the way to go. I just need some time to write the code.

Thanks goes to Karl and AVP for some fruitful discussions.

  index