Lighting & Texturing not working despite using GL_MODULATE

Can anybody think of a reason why my texture maps are not being affected by the lighting. I am using GL_MODULATE. When I remove the textures by calling glDisable(GL_TEXTURE_2D) just before I draw the object, it is correctly lighted. I’m also disabling blending but this shouldn’t affect that. I’m obviously stumped.

Thanks.

If you use multitexturing, try multiplying instead of modulating. Should work a bit better, eh? Example of why.

texel_unit_0 texel r,g,b = 1,.5,.5 (base texture)
texel_unit_1 texel r,g,b = .5,.5,.5 (light texture)

output texel r,g,b = .5,.25,.25

If you modulate, they end up all wierd, but if you multiply, the light texture increases/decreases the end texel to whatever it should be. I’m kinda new to OpenGL, but I can garauntee you on this one.

umm, modulating is multiplying.

Multiplying/modulating cannot increase the original rgb values (unless you are using an additive blending mode). pATChes11, i suggest you read the OpenGL specification of the texture environment modes, and particularly the formulas about modulating ( which IS multiplying ).

Y.

Well, I guess I just made a stupid mistake and was binding the texture inside glBegin/glEnd (There were a few other circumstances that produced my symptoms, but that was the major one). Duh. Of course I knew that I’d find the problem as soon as I posted the question. Thanks anyway.

Gimme a DSL modem and I’ll go and download the specs. But till then, I’ll just stick to what I see in code. And you could theoretically increase the values of a texel, but you’d have to handle the lightmap manually, and I don’t think OpenGL lets you do that. But as you know, I have yet to read the 1.2 specification My bad. But then, when I used modulating once, it looked worse than it did by multiplying. But my memory is probably wrong too :stuck_out_tongue: