The sampling behavior at the edge of the texture depends on your texture wrap settings, which you can set with glTexParamteri()
, using GL_TEXTURE_WRAP_S
and GL_TEXTURE_WRAP_T
for the parameter name. These control the wrap mode for the two texture directions separately.
The default value for these parameters is GL_REPEAT
, which creates a repeating pattern of the texture. This means that when you approach for example the left edge of the texture, and reach the last half texel, linear interpolation will happen between the leftmost and rightmost pixel. This is most likely causing the seams in your case.
The other valid values in ES 2.0 are GL_MIRRORED_REPEAT
and GL_CLAMP_TO_EDGE
. Both should work better for your case, but GL_CLAMP_TO_EDGE
is the most straightforward. It will simply use the texel at the edge while approaching the edge, without any interpolation for the last half texel.
You can set these parameter values with:
glTexParamteri(GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParamteri(GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
GL_TEXTURE_WRAP_S
andGL_TEXTURE_WRAP_T
? You may want to try to set them toGL_CLAMP_TO_EDGE
if you're not doing that yet. – Reto Koradi