Jump to content
  • Advertisement
Sign in to follow this  
zqueezy

quick bump mapping question

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

i see a lot of different stuff on the net about bump mapping and especially the way the tangents and binormal vectors. my short question: is it really necessary to precalculate the binormal (and/or tangent)? or can i take some arbitrary vector (a) use that one with the normal to get a vector in tangent space (Cross(a,n)), and use the result to get the last vector? somewhere I read something about complications with that. But I cannot remember the argument but I remember that I didn't get it. I mean I'm pretty sure I can construct a matrix (TBN) to get the light vector in that space... thanx for answering zqueezy

Share this post


Link to post
Share on other sites
Advertisement

You can derive the bitangent from the tangent and normal in the shader. I don't think there is any way you can get by without computing a tangent unless in very special cases.

Take a look at Eric Lengyel's code. In your shader, do B = (N cross T) * T.w or something like:

XPD bitangent, normal, tangent;
MUL bitangent, bitangent, tangent.w;

I believe there are no issues with this method. It works fine for me with some pretty jumbled UV mapping. In a recent post I claimed problems in trying to split the vertices where tangents were discontinuous but this is actually trivially solved, some of the data I was using in my splitting stage was corrupt/undefined!

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.

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

Sign me up!