Archived

This topic is now archived and is closed to further replies.

Normal map from height map - there must be an easy way.

This topic is 5114 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

Can someone who actually knows something about math come up with an algorithm to calculate the normal of a vertex in a heightmap based around the heights of the vertices surrounding it directly? All of the points are (obviously) evenly spaced. I''m sure there''s an easier way than converting it to polygons and getting normals for each polygon and then averaging them to get the vertex normals...

Share this post


Link to post
Share on other sites
Search google "finite differencing" approach. It's used by most terrain engines and bumpmap creators. Or you can just look into nVidia's heightmap-2-bumpmap plug-in (you can DL source code).

edit : I just rememberd another link.
http://www.andyc.org/lecture/viewlog.php?log=Realistic%20Water%20Rendering,%20by%20Yann%20L
and
http://membres.lycos.fr/ylmb/source/normals.cpp

You should never let your fears become the boundaries of your dreams.

[edited by - _DarkWIng_ on December 14, 2003 7:44:06 AM]

Share this post


Link to post
Share on other sites