Jump to content
  • Advertisement
Sign in to follow this  
kasicass

Question in NeHe Tutorial Lesson 8

This topic is 5476 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
Advertisement
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).

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!