I had a question about the information stored in a .TGA bumpmap.

  1. What does each of the components represent RGBA?

From a per channel preview of the image, what I gathered was that R is the x component of the normal, G is the y component of the normal and B and A I couldn’t think of anything. Can someone correct me if I’m mistaken!!

  1. Should the sqrt(RR+GG+B*B) of each pixel in the bump image be 1.0 necessarily so that all normals are of unit length?

  2. Can someone point me to a website where I can find more info. on this topic?


  1. Usually the RGB components of a normalmap represent the x, y, and z components of a normal vector.

  2. Since negative values cannot be explicitly stored in an RGB image or texture, the values in a normalmap are scaled and biased such that a value of 0.5 in a normal map represents 0, 0 on the normal map represents -1, and 1 on the normal map represents 1. As such, the RGB representation will not have a magnitude of 1.0. To undo this, one must subtract 0.5 from each componant of the normalmap and multiply the result by 2. The resulting vector should have a magnitude of 1.0.

  3. Not sure about a website. . . I kinda learned this stuff all over the place. . .

Look on nvidia website for “robust bump mapping”, you’ll get absolutely everything explained in it.


There is no alpha in a bump map. It wouldn’t make sense anyway, since bump mapping is strictly bump mapping.

[This message has been edited by gator (edited 10-23-2003).]

You can use alpha in the bump map to encode material properties, such as shinyness. That means that you can easily make a bump map called “splotchy leather” or “rusty metal” and have it affect the light correctly.

If I have a OpenGL demo that uses dot3 bump mapping using register combiners and a cubemap,
what will happen if start using 32-bit textures, and encode the alpha channel the same way?

You can use 32bit textures in the combiners just fine with bumpmapping. The alpha won’t do anything to the rgb part unless you specificaly tell it to. The RGB and A are separated so if you do

rgb {
spare0 = expand( tex0 ) . expand( tex1 );

it wont even look at the alpha at all because you’re in the rgb portion. Of course you can always then do this

alpha {
spare0 = spare0.rgb * tex0.a;

if you wanted to incorporate the alpha into your prev calculation.

I hope my syntax is correct, I havn’t used register combiners in quite a while now.


I probably should have said that 90% of time, you probably won’t be using the alpha
channel for bump mapping, so I would just ignore it.

But if you can use it for transparency, then I see that as being useful.

It’s common to include a gloss map for your specular part in the alpha channel of one of your textures.

Remember that the alpha channel is not just for transparency.


[This message has been edited by SirKnight (edited 10-24-2003).]