Re: Bump mapping

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



I just found and read the article which was very helpful. Just for clarification and to see if I understand per pixel lighting, I will never need to specify a normal in terms of world space...

struct MyCustomFVF
{
	D3DVECTOR position;
	D3DVECTOR normal;
	D3DVECTOR tangent;
	D3DVECTOR binormal;
};

So when I create my vertices, I should not be putting in my normals, but rather transform each vertex to tangent space and calculate the tangent, binormal and normal vectors based on the tangent basis. Is this anywhere near correct?

Thanks,

Gary

Phil Taylor wrote:
did you hunt down my Per Pixel Lighting article on MSDN?

"Gary Nastrasio" <garynastrasio@xxxxxxxxxxx> wrote in message news:OKHrVR4RFHA.3880@xxxxxxxxxxxxxxxxxxxxxxx

Hi, I have a few questions using bump mapping.

Here are the parts I understand:

- the normal map has red (x-axis), green (y-axis), and blue (z-axis) colors in it, which determine the normal direction
- how to translate from model space to tangent (texture) space


Now here's what I don't understand:

1) Why is it necessary to convert to tangent space to get another normal for a vertex; does this mean each vertex will have a normal in object space and another, different, normal in tangent space?

2) How does my normal map actually relate to my tangent and binormal vectors? Moreover, how does this relate to calculating the values per pixel, since the the tangent and binormal vectors only exist for each vertex?

I've been reading all day about this, but those are 2 points I just can't figure out.

Thanks for any help,

Gary



.



Relevant Pages

  • Re: Bump mapping
    ... its important to realize this is a texture-based lighting technique, ... > So when I create my vertices, I should not be putting in my normals, but ... > rather transform each vertex to tangent space and calculate the tangent, ... >>>1) Why is it necessary to convert to tangent space to get another normal ...
    (microsoft.public.win32.programmer.directx.graphics)
  • Re: tangent space for normal mapping
    ... I'm confused about the math. ... and bitangent correctly for triangle normal, but now I need to make them ... Can I simply do as I did for normals, ... tangent and bitangent among shared vertices? ...
    (comp.graphics.algorithms)
  • Re: Tangent for 3D vectors
    ... I need the formula to calculate tangent for 3D ... there are actually two normals so you have to know how to set up the ... throttle) into the tangent PLANE of the ground. ... If D is the normalized direction vector, T is your thrust scalar and N ...
    (comp.programming)
  • Re: bump mapping and tangent space
    ... product of tangent and bitangent. ... I have already normals (averaged among ... the surface as a parametric surface, ...
    (comp.graphics.api.opengl)
  • Re: bump mapping, tangent space, ARGH!
    ... Calculating the S and T tangent space vectors. ... > its per-face normals. ... assumptions about the surface the polygonal mesh is approximating. ... > Any tips/tricks on how to debug tangent space calculation, ...
    (comp.graphics.api.opengl)