Jump to content
  • Advertisement
Sign in to follow this  
Alessandro

Convert normal map to bump

This topic is 2548 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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?

Share this post


Link to post
Share on other sites
Advertisement
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

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!