View Full Version : broken textures when draw lines
09-14-2005, 01:48 AM
I have a strange problem, i draw some textured boxes, they are drawn corectlly, but when i draw some lines over scene, the textures change the colors strange, what can be the problem?
Thanks in advance.
09-14-2005, 01:53 AM
If you don't want your lines to be affected by the texture, you have to disable texturing with glDisable(GL_TEXTURE_2D).
09-14-2005, 02:27 AM
the problem is that not the lines are affected, textures are affected by lines but i dont know why?
09-15-2005, 01:07 AM
i still cant find the solution, any idea pls?
I guess you change the current color when you draw lines and that you doenst mess with texture environments yet. Set the color to white before you render the textured box and i guess everything will be ok for now.
09-15-2005, 01:50 AM
Default texture enviroment is GL_MODULATE.
If your lines are rendered in a different color than the textured objects and you didn't set back the color before rendering the textures, you need to either issue a glColor call to initilialize the render state or you can change the texture environment mode to GL_REPLACE (full texture color).
Similar when lighting is enabled. You need to have normals and materials setup identically for every frame to get consistent results.
If you mean your texture go completely out of their mind like corrupted images, check your glTexImage calls. You don't need to do that per frame anyway with texture objects.
Watch out for unpack alignment issues, the default is 4, for RGB tetxures you should use 1.
Show some code which breaks.
(edit: Hehe, double post.)
Powered by vBulletin® Version 4.2.2 Copyright © 2015 vBulletin Solutions, Inc. All rights reserved.