cg yet again

Started by
2 comments, last by hello_there 19 years, 10 months ago
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.
____________________________________________________________How could hell be worse?
Advertisement
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.


so if i''m only doing bump mapping for basic stuff like triangles is the tangent just the surface normal?
____________________________________________________________How could hell be worse?
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.


This topic is closed to new replies.

Advertisement