Skip to main content
gamedev.net
🔒 Locked

Color problem

Started by groovable 4 replies 500+ views
Original Post
groovable
groovable
Hi, I have a problem with colors changing after loading a texture. A draw a quad with a large texture, loading from jpeg with devil. After loading the image colors seems to turn more dark. The darkness depends on the jpeg I load. Any advice?? Thanks.
Hydrael
Hydrael
Try glColor3f(1.0f,1.0f,1.0f) before you render your quad
groovable
groovable
I do, but the problems seems to be in the color of primitives such as lines or even bitmaps. If a draw a red line(1.0,0.0,0.0) it gets dark. It´s not an alpha problem, i tried to disable alpha and i´ve got the same result. I tried with different images and the darkness change, dont know why, even with images taken with the same camera.
Thanks.
Beco
Beco
The problem could be that after you have drawn a textured face, you are trying to draw a simple coloured one without texture but the texture remains bounded. Try to use glBindTexture(GL_TEXTURE_2D, NULL) if you don't want to use the texture anymore. It will solve the problem.
Kalidor
Kalidor
Quote:
Original post by Beco
The problem could be that after you have drawn a textured face, you are trying to draw a simple coloured one without texture but the texture remains bounded. Try to use glBindTexture(GL_TEXTURE_2D, NULL) if you don't want to use the texture anymore. It will solve the problem.
That's all correct except instead of binding texture object 0 (the default texture) you should disable texturing when it is not needed.
groovable
groovable
That was the problem Beco!! Now i disable textures and it´s ok. Thanks to all.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.