At certain non-whole-pixel translations, I'm seeing terrible seams in TiledMap. I believe the root cause is due to Image.getSubImage's texture coordinates being on texel borders, rather than in the centers of texels. This would also manifest itself in anything else using SpriteSheet, or subImages, but I see it quite glaringly in TiledMap.
The reason the seams are white for me is due to the texture wrapping, and the opposite edge of the texture being white.
Ultimately, all that should be solvable by putting a few half-texel offsets into the rendering code in Image.java... Maybe in drawEmbedded() ~line 523 or so...
Code:
float texelHalfWidth = (1 / textureWidth) / 2;
float texelHalfHeight = (1 / textureHeight) / 2;
GL.glTexCoord2f(textureOffsetX + texelHalfWidth, textureOffsetY + texelHalfHeight);
GL.glVertex3f(x, y, 0);
GL.glTexCoord2f(textureOffsetX + texelHalfWidth, textureOffsetY + textureHeight - texelHalfHeight);
GL.glVertex3f(x, y + height, 0);
GL.glTexCoord2f(textureOffsetX + textureWidth - texelHalfWidth, textureOffsetY
+ textureHeight - texelHalfHeight);
GL.glVertex3f(x + width, y + height, 0);
GL.glTexCoord2f(textureOffsetX + textureWidth - texelHalfWidth, textureOffsetY + texelHalfHeight);
GL.glVertex3f(x + width, y, 0);
I would try the change myself, but I'm extremely new to Java and especially Slick, so I'm completely clueless as to how to build Slick myself.
Thoughts? This would certainly fix
my problem, though I can't be sure it wouldn't cause knock-ons for others. Integers and floating points never play well together.
