PDA

View Full Version : Switching from texture to material



morello
12-27-2010, 03:18 PM
This is a hopelessly noob question, but I am not sure of the terms to search for an answer.

When I call glBindTexture() prior to adding a mesh, what do I need to do afterwards to get rid of it? So that subsequent meshes use normal materials.

I am creating various meshes, some using materials, some using textures. Both work individually.

Problem is, when I have both in the same scene, the meshes which should use a material actually use the texture of one of the other meshes.

Alfonse Reinheart
12-27-2010, 03:27 PM
Bind the texture 0. So glBindTexture(GL_TEXTURE_2D, 0);

mobeen
12-27-2010, 10:53 PM
And also disable the texture,

glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D,texture_id);
//render all textured meshes

glBindTexture(GL_TEXTURE_2D,0);
glDisable(GL_TEXTURE_2D);

//render all non-textured meshes

Regards,
Mobeen