Displacement Map from Normal Map

Started by
3 comments, last by Zwigby 17 years, 11 months ago
I was wondering if anyone knew how to create a displacement map from a normal map? Any and all help is appreciated. Thanks, Chuck
Advertisement
What Shader Language are you using.
well I really just looking for the theory behind it then I can take it use it where I need it. but I can use HLSL easily in the context of the program.
Please don't assume my post to be correct - what I'm about to say is based on my limited knowledge of what displacement and normal maps are, and as such isn't necassarily correct.

Anyway...
A normal map can be used to determine the slope of the 'surface' compared to a flat surace (normals are perpendicular to the surface they represent). A displacement map is simply a measure of the distance from the surface (a map of 'heights').

By picking a displacement to start at, you could calculate and use the slope at between points to get the displacement of each point (point 1 is at height 4, the slope between 1 and 2 is -2, so point to is at height 2 - just do the same basic idea on a 2D plane...).

A normal map wouldn't be able to give the actual height of each point though - just their height relative to each other.
Correct, you could only do this in a relative since, so it would not be an absolute displacement. But I think that this is really all that you need. I have a few ideas on how to do this from other sources but wanted to see what other people could come up with.

This topic is closed to new replies.

Advertisement