Advertisement

texture mapping/lightinh problem

Started by January 24, 2004 10:45 AM
3 comments, last by OnANeedToKnow 21 years, 1 month ago
i have objects that a just coloured using glColor3f() and i have lighting which makes it look kool, but when i add a texture to an object i seem to lose the colours. any1 no why?
Either use materials or glEnable(GL_COLOR_MATERIAL).

Enigma
Advertisement
im using the glEnable(GL_COLOR_MATERIAL);

but when i use glEnable(GL_TEXTURE_2D);

it seems to make everything the same colour a the texture i loaded
If you mean you apply a texture to one object and objects that shouldn''t be textured change to the colour of the texture then the solution is to disable texturing before drawing untextured objects. Remember that OpenGL is state machine. When you enable texturing it remains enabled until you disable it. When you specify a texture coordinate it applies to every vertex until you change it.

Enigma
yeah that worked. cheers!

This topic is closed to new replies.

Advertisement