Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 9 of 9

Thread: Bumpmaps...

  1. #1
    Junior Member Newbie
    Join Date
    Sep 2001
    Location
    Kanpur, U.P., India
    Posts
    15

    Bumpmaps...

    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!!

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

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

    TIA,
    Nishal.

  2. #2
    Member Regular Contributor
    Join Date
    Jan 2003
    Location
    Edmonton, Alberta, Canada
    Posts
    322

    Re: Bumpmaps...

    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. . .

  3. #3
    Member Regular Contributor
    Join Date
    Aug 2003
    Location
    France
    Posts
    299

    Re: Bumpmaps...

    Look on nvidia website for "robust bump mapping", you'll get absolutely everything explained in it.

    SeskaPeel.

  4. #4
    Junior Member Regular Contributor
    Join Date
    Jan 2003
    Posts
    146

    Re: Bumpmaps...

    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).]

  5. #5
    Senior Member OpenGL Guru
    Join Date
    Mar 2001
    Posts
    2,704

    Re: Bumpmaps...

    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 you can't afford to do something right,
    you'd better make sure you can afford to do it wrong!"

  6. #6
    Junior Member Regular Contributor
    Join Date
    Jan 2003
    Posts
    146

    Re: Bumpmaps...

    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?

  7. #7
    Senior Member OpenGL Pro
    Join Date
    May 2001
    Location
    The Round Table at Camelot
    Posts
    1,537

    Re: Bumpmaps...

    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.


    -SirKnight
    -SirKnight

  8. #8
    Junior Member Regular Contributor
    Join Date
    Jan 2003
    Posts
    146

    Re: Bumpmaps...

    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.

  9. #9
    Senior Member OpenGL Pro
    Join Date
    May 2001
    Location
    The Round Table at Camelot
    Posts
    1,537

    Re: Bumpmaps...

    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.

    -SirKnight

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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •