Hi, I am loading a 1024x512 png image and drawing it on the screen. when I translate it, sometimes a strange grey line shows along it.
Does anyone know what the problem is?
image: http://www.use.com/2dc0018cea8a9b9306d7
Thanks,
roland
If you are tiling the texture, did you try clamp to edge?
If you are using texture positions of <0 or >1 instead of tiling, are you sure there isn’t a semi transparent line in there?
Do you have one or multiple textures within one file?
Due to interpolation, it is entirely possible for OpenGL to sample outside of the bounds of your texture coordinates. GL12.GL_CLAMP_TO_EDGE fixes this. GL11.GL_CLAMP only clamps texture coordinates to 0.0-1.0, so it doesn’t do anything to prevent interpolation outisde of 0.0 - 1.0. Try it. =D
You effectively change your runtime requirements to GL1.2, but you don’t have to change anything in the code, just use GL12.GL_CLAMP_TO_EDGE and you are done.
How exactly ?
I would use GL11.glGetString(GL11.GL_VERSION); and then check
Yeah I have this line problem too, but only if I scale the whole screen, which is still experimental
I think its because the positions aren’t accurate enough anymore - but using Slick not sure this CLAMP will help me there.