Jump to content
  • Advertisement

Archived

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

laeuchli

Tangent Space?!?!?

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

What is tangent space, and how do I generate it?!?! I know you need it for bumpmapping, but I just can''t figure it out.

Share this post


Link to post
Share on other sites
Advertisement
tangent space ? ,maybe you mean the normal maps for the bump mapping , you can generate a map of arctangent but at 90 degree it goes inifinity, so you happens with holes somewhere, only my tw0 cents.


Share this post


Link to post
Share on other sites
Normal maps need tangents and binormals to do dotproduct (dot3) bumpmapping. A "tutorial" (a chunk of code without much comments) can be found here

http://www.nitrogl.com

There are also tutorials on nVidia''s and ATI''s developer sites (check ATI''s "simple dot3 bumpmapping"-application).

The lighting is calculated using N dotproduct L per pixel (well, per texel could be more accurate).

Basically you get the vector N from a normal map, and the vector L is the light direction calculated per vertex (light position - vertex position). Then the light direction is rotated to tangent space using the vert tangent and binormal (so we actually get the vector L'' = L in "tangent space"). Note that some may also refer to tangent space as texture space. A bit of 3D-card magic, and you''ve got bumps on your flat sufraces.

Check the sites i mentioned for a better explanation & code.


--BerLan

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!