Skip to main content
GameDev.net gamedev.net
🔒 Locked

Displacement mapping a flat surface?

Started by mlt Dec 5, 2008 at 5:04 PM 0 replies 500+ views
Original Post
mlt
mlt
Assume that we have: 1) a flat 2D surface. 2) A height map (generated with e.g Perlin noise). 3) A normal map made from 2). I now use a lookup in the height map to displace the vertices along the normal on the surface (they all point in the same direction). Now I want to shade the new displaced surface. For each looked up height in the height map I find the corresponding normal vector in the normal map and use that as the new normal for the displaced point on the new surface. But will this be the correct normal? As long as the orginal surface is flat I assume this would work, but why?
Yann L
Yann L
Quote:
Original post by mlt
As long as the orginal surface is flat I assume this would work, but why?

Because the tangent space coordinate frame is the same. This has nothing to do with being flat or not, it's about orientation. When you generated the normal map, you were implicitly using a tangent frame that was parallel to the XY plane. As long as you render your surface the exact same way, without changing its orientation, the tangent frame will stay the same and the normals will remain valid. Basically, you'll have what is called an object space normal map.

As soon as you change orientation, you need to adjust for the modified tangent coordinate frame. That would then be a tangent space normal map.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.