My colors arent displaying correctly!
Hello, I am a beginner to OpenGL, and I have a problem I can''t solve, even after searching the web high and low.
Basically, I am trying to use textures (bmp files) and basic colors ( with glColor3f ) at the same time i.e. in the same project. The problem is that when I enable textures via ''glEnable(GL_TEXTURE_2D);'' all my colors suddenly appear darker. Not only this, but colors ''shine'' through any textures I use. Apart from this, my code appears to be ok, it compiles and runs fine apart from the colors going darker.
Is there a way to use colors to draw a polygon, then switch off colors and apply my texture (which should stay the color the bmp file was intended to use) and then carry on with the colors? Am I missing a basic opengl command? I have tried adding ''glEnable(GL_COLOR_MATERIAL);'' but this has not solved my problem.
If you would like to see all my code to see what I mean, please just ask. I''d appreciate any comments at all.
Thanks in advance!
If you want to render a polygon exactly like the texture appears (that is, with no color-bleed), you should simply set the active color to white (1.0f, 1.0f, 1.0f) before rendering the texture.
Neophyte
- Death awaits you all with nasty, big, pointy teeth. -
Neophyte
- Death awaits you all with nasty, big, pointy teeth. -
Thank you, setting the color to white before I use a texture does indeed display the texture correctly.
Unfortunately, the colors on the polygons where no textures are used, are still being displayed incorrectly. It''s strange, if I turn off my textures, i.e. remove glEnable(GL_TEXTURE_2D);, all my colors are drawn correctly?!
Any other ideas?
Unfortunately, the colors on the polygons where no textures are used, are still being displayed incorrectly. It''s strange, if I turn off my textures, i.e. remove glEnable(GL_TEXTURE_2D);, all my colors are drawn correctly?!
Any other ideas?
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement