# Lesson 8 question

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

## Recommended Posts

At the end of lesson 8 NeHe says something like... "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). " I'm going to assume that "modulated texture mode" is just a fancy way of saying textures with blending. Does that sound right? And how does the outcome (0.5, 0.6, 0.4, 0.2) fit into the blending equation? I'm not clear as to how the alpha value became 0.2. Does anyone know?

##### Share on other sites
Modulated texture mode means that you multiply the texture color and the color(set with glcolor) to get a new color, so yes it's a form of blending, but don't confuse it with the glBlendFunc type of blending.

And the alpha value should be 0.5, i think 0.2 is a typo.

##### Share on other sites
The problem with NeHe's lesson 8 is that the blending equation is for GL_SRC_ALPHA as source blend factor and GL_ONE_MINUS_SRC_ALPHA as destination blend factor, but in code sample glBlendFunc() gets GL_SRC_ALPHA (As, As, As, As) and GL_ONE (1,1,1,1).

Change GL_ONE to GL_ONE_MINUS_SRC_ALPHA, glColor4f give 100% Alpha, and you will see that box's front face is truly 'totally opaque' (and not only this - see what happens while rotating the box - nice, isn't it?:) ).

1. 1
Rutin
44
2. 2
3. 3
4. 4
5. 5

• 11
• 9
• 12
• 10
• 13
• ### Forum Statistics

• Total Topics
632984
• Total Posts
3009713
• ### Who's Online (See full list)

There are no registered users currently online

×