Advertisement

Question in NeHe Tutorial Lesson 8

Started by September 25, 2004 05:25 AM
0 comments, last by lc_overlord 20 years, 2 months ago
In the lesson, it says, Question One: "But how can we specify the color if we are using a texture map? Simple, in modulated texture mode, each pixel that is texture mapped is multiplied by the current color. So, if the color to be drawn is (0.5, 0.6, 0.4), we multiply it times the color and we get (0.5, 0.6, 0.4, 0.2) (alpha is assumed to be 1.0 if not specified). " As English is not my mother language, it might be some misunderstand for me. I don't quiet understand what "modulated texture mode" is and how (0.5, 0.6, 0.4) multiply color yield (0.5, 0.6, 0.4, 0.2) Question Two: "The alpha value that is used for transparency can be read from a texture map just like color, to do this, you will need to get alpha into the image you want to load, and then use GL_RGBA for the color format in calls to glTexImage2D(). " How can I "get alpha into the image"? What I get new is just a bitmap of 24-bits color depth. How can I get a 32-bits bitmap?? Question Three: And NeHe had a note in the lesson said that he had changed the blending method Tom used. NeHe, could you give me the original-Tom-written code for learning purpose? Thank you very much. My email: kasicass@163.com Hope smart and kind people can help me for the simple question. Thank you here.
1. if you multiply (0.5, 0.6, 0.4, 1.0) with (1.0, 1.0, 1.0, 0.2) you get (0.5, 0.6, 0.4, 0.2).
Modulated texture mode, means that the texture is multiplied with the color to acheve the final color, if lighting is used, it would use the incoming light to multiply with.

2. BMPs cant have 32 bit colors, so either you use the tga loading code in lesson 33, or you use a separate image as an alpha channel, or you generate it by having a color that represents alpha=0, usuarly superpink is used (1.0, 0, 1.0).

This topic is closed to new replies.

Advertisement