I’m having some issues with my textures affecting the color of non-textured polygons. From the ‘Color mixed with texture’ thread, I saw this: “Yes, when your glTexEnv mode is MODULATE, then the final color is glColortexturelighting.”
How can I arrange it so that my final color is only glColor*lighting? I’m using OpenGL 2.1.
I’ve tried using glDisable(GL_TEXTURE_2D), but then I lose all my texture data for my models. This happens even if I call glEnable(GL_TEXTURE_2D) before drawing the model. I’d like to retain my textures, but also be able to draw some non-textured polygons with the appropriate color.
Think of texture enable/disable as a global switch which isn’t reset automatically (e.g. each frame), so if you did:
// one time init code:
glEnable(G_TEXTURE…);
// per frame rendering code:
drawTexturedStuff();
glDisable(GL_TEXTURE…);
drawNonTexturedStuff();
You will only see textured objects in the first frame, because from then on texturing will never be activated again! If you have to switch states in GL, you have to do it each frame.
Two other options come to mind. One is to port to shaders - you’ll have very specific control over how the various parameters are combined. Two is to create a 1x1 all-white texture and use that - you won’t need to worry about having to disable/re-enable texturing.