Jump to content
  • Advertisement


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


cg yet again

This topic is 5269 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''m reading the cg tutorial and i read the bit on bump mapping and i got it working in my game the first example at least. now i want to use the one where it will bump map and geometry. What i was wondering is what the float3 tangent : TEXCOORD1 bit in the entry functions parameters does and how i would get it for each vertex? Someone who''s read that book must know what i''m talking about i hope. thanks in advance.

Share this post

Link to post
Share on other sites
I know what you are talking about.
The normal map (texture) is not world space coordinates.
So you have to compute tangent space for each vertex (if you don''t have one normal per face).
Then transform light(pos or vector) and eye pos to tangent space.
It''s much better then transforming normal to world space.

btw: It is not explained in the book ;-))

Try to google something about tangent space.
I''m not very good in english to exaplaining it.

Share this post

Link to post
Share on other sites
No tangent space is allways from 3 vectors (perpendicular)
It is base in texture space. Your normal vector from normal is from this space, so you need all vector in the same space to compute lighting so you have to transform world space vectors to texture space.

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!