Convert normal map to bump

Started by
1 comment, last by Alessandro 12 years, 3 months ago
Probably this should go in Maths, perhaps. However, do you know any algorithm that would allow me to convert a normal map into a bump map?
Advertisement
Superpig and Eelco basically explain the algorithm I would use if I were trying to convert a normal map to a bump map in this thread.
It seems like they got lost in that thread, and never been able to actually solve it or figure out a solution.
Haven't read the other thread, but I implemented it the following way:

Start with a plane.
Iteratively update each height value by stepping in the direction (up or down) which minimizes the error of the normals, which are effected by that height value.

Run this like 500 times or until it converges.

You can further optimise (speedwise) by implementing some impulse term (does wonders) or doing all the other fancy gradient based stuff. Some regularization term (for example smoothing) can also improve the result (quality wise), but that highly depends on the nature of the normal map.

The algorithm works fairly well for all normal maps, which were generated from height maps, and are somewhat "organic" (Lots of curves, no planar surfaces with hard edges).

Here is an example with a simple normal map (raw image from www.cgtextures.com):
Normal2Height.jpg

This topic is closed to new replies.

Advertisement