PDA

View Full Version : Texture on selected polys



ampersander7
02-11-2013, 01:07 PM
Using display lists, I'm trying to put texture on some, but not all of an object's polys. For example, I have a monitor object. I want to map a texture to just the monitor screen, and just color the rest of the object. And this works fine on my dev computer. But NOT on any other computer, so far. I get the texture where I want it, but the color of all other polys is affected by the texture. I'm guessing that it takes the color of the pixel at 0,0 and applies that.

I've tried and retried many combinations of glEnable(GL_TEXTURE_2D) and glDisable(GL_TEXTURE_2D), glBindTexture( GL_TEXTURE_2D, texture ) and glBindTexture( GL_TEXTURE_2D, 0 ), inside and outside of the display list. No luck.

I'm starting to contemplate breaking up the display list into textured and non-textured polys. Or putting a dot of the desired color in the texture. But I thought I'd check here first.

tonyo_au
02-11-2013, 04:14 PM
I'm starting to contemplate breaking up the display list into textured and non-textured polys
This is the normal way.

You can try using clipping planes or more simply set the texture coordinates for triangles you don't want textured to 0,0 on all vertices