OpenGL Texturing Problems

mbcook

Registered
I've been programming OpenGL lately, and currently I'm running a little test program that I am building up to something bigger. But I am having texturing problems right now. I've developed a little model of a car that spins in my program. When the car has no texture (is made of entirely of polygons), things look correct. Everything is drawn, no problems.

When the car is textured instead, polygons seem to appear and disappear for no reason. NOTHING is different except the existance of the texture. I'm not sure why it is being rendered like this, but it's driving me nuts. This is the first real texturing I've done on something. I checked that all the texture coords are correct, and they are. I can't figure it out but it's driving me nuts.

untex1.tiff

untex2.tiff

tex1.tiff

tex2.tiff


In the untextured images (the first two) you see a complete car (the windows look odd due to the way they were rendered, you can ignore them).

In the textured images you see the same model only polygons are missing (they come and go as the car rotates). Depending on where the camera is the problem's scope changes. For example, with the camera in closer (like in the untextured pictures) the roof NEVER shows up. I've messed with the viewing volume and that doesn't seem to make a difference. Lighting and culling are both off so that can't be causing the problem. This is really driving me nuts.

Any OpenGL veterins out there able to shed some light on this?
 
I'm no OpenGL expert, but I had similar problems when I was learning how to texture a cube, it looked fine untextured, but textures would flicker. I think it either had to do with not clearing a certain buffer properly or the order I specified the texture coordinates.
 
Thanks. After further testing I've discovered it happens on one of my computers, but not under the software renderer of another. The idea of the texture coords being odd seems the most probable to me, I'll have to check that out today as well as making sure everything neccessary is cleared.

Thanks for your help.
 
It's been a while for me but I believe you want to make your texture coords go counter clockwise. It may also have to do with your lighting model and the normals of the textured surface.
 
Yeah, that's what I intend to check next. The texture coords should be counterclockwwise, but maybe I messed that up somewhere.
 
Back
Top