# OpenGL ES 1 Pixel Error?

I am developing a game on android using OpenGL ES 1.0 for Android OS. It is a 2d game using a simple Orthographic projection and textures for the sprites. One of these textures has a small line (it looks like 1 pixel) all the way across the top that has the same colors as the bottom 1-pixel line of the texture. It is almost as if the bottom line of the image raster was copied and pasted as the top line as well.

Is anyone familiar with this type of error? What could the problem be?

• Could you post a screenshot and the actual texture ? Maybe the part of the code that displays the texture correctly and incorrectly could be useful too. – Heckel May 28 '14 at 12:27

• Technically the problem is that the [0,1] coordinate range itself is flawed. Interpolation pulls image data from the 4 nearest texels (possibly more if anisotropic filtering is enabled) and then averages them based on the distance of the center of each texel from the sample location. 0.0 is not a texel center, that is the boundary of the texture, so it is equa-distant from the texel to its right and its left. GL_CLAMP_TO_EDGE fixes that by clamping coordinates to a more restrictive range than [0,1], such that the smallest and largest coordinates are exactly the center of a texel. – Andon M. Coleman May 29 '14 at 23:54