Jump to content
  • Advertisement
Sign in to follow this  
mlt

Displacement mapping a flat surface?

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

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?

Share this post


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

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!