Greetings,
I have a small issue with OpenGL texturing, which is not related to any GPU in particular. I've reproduced this problem with Radeon GPU and Mali GPU, so it's just a "I don't understand OpenGL" problem. However, I'm putting this in the ARM Mali graphics section, as it seems to be the most adequate section by elimination, and I'd like to know how this problem is called in OpenGL terms.
My problem is that when I use a texture atlas and apply a part of the texture atlas to a quad, it sometimes picks one more pixel from contiguous parts of the texture atlas.
The same quad displayed at different zones of the screen will glitch differently.
The problem tends to disappear when I use GL_NEAREST with GL_TEXTURE_???_FILTER, instead of GL_LINEAR. However, the texture become awfully pixelated then.
Here's an example of the code used :
psychic-octo-waffle/myy.c at master · Miouyouyou/psychic-octo-waffle · GitHub
The code basically generates two cards, divided in one opaque and two transparent parts, at two different parts of the screen (-0.02, 0 and 0.24, 0).
The non-converted atlas can be seen here. It's a set of 13x4 playings cards, 4 suits symbol, 4 turned cards and 4 backgrounds.
So, the normalised dimensions of each card part of the texture atlas are :
I really doubt that these dimensions can generate rounding errors.
When executed, the code produces a window with two turned-around cards on the screen. Each one glitching slightly differently.
Here's the result :
So my questions are :
Great, glad you got it sorted.
> Is it what you were referring to ?
That's part of it. There are similar comments related to the texture coordinates and filtering too.