Odd texture thing

Hey, i can’t work out why it happens but i’ve noticed it before when im using a set of tiles in a single image and then use glTexCoord() to map only part of the large texture.

The texture seems to map properly when it is first drawn and the quad is stationary, but when i begin to move the quad and redraw it and it’s texture mapping, i get this:

See the single blue line of pixels from another tile in the texture?
Why does that happen?

Would you mind sharing your texture loading/rendering code? I think this might be the same problem I had to fix a while ago, but I’m not entirely sure.

This could be a problem with your texture filter or your texture coordinate wrap mode. If your texture filter is set to LINEAR (or any of its varieties), the GPU will look at neighboring texels to blend them together. This can cause bleeding if there is not enough space between your tiles.

Similarly, if this is on the edge of your texture, your wrap mode may be causing the linear filtering to wrap around to the other side (and see a totally unexpected color).

Edit: I fixed it by changing the texture filter to NEAREST. Thanks lhkbob.

Ah, not the same problem I was thinking of. Glad you fixed it. :slight_smile: