EDIT - I fixed it while I was waiting for this to be answered. I will leave this here for others who will run into thsi problem.
The problem was that the image i was loading was 1280 x 100, and that was not a proper aspect ratio, so when I changed it to 1280 x 720, it fixed itself.
When I render the ground-layer quad, it draws a textured line above it.
It is the only one of my textures that does that. And I even checked if maybe I drew an extra line in PAINT.NET but no, it looks normal outside the game.
//Ground
GL11.glPushMatrix();
Color.white.bind();
TextureBuffer.Level_TutorialGround.bind();
GL11.glBegin(GL11.GL_QUADS);
GL11.glTexCoord2f(0, 0);
GL11.glVertex2f(-100, 650);
GL11.glTexCoord2f(1, 0);
GL11.glVertex2f(1950, 650);
GL11.glTexCoord2f(1, 1);
GL11.glVertex2f(1950, 500);
GL11.glTexCoord2f(0, 1);
GL11.glVertex2f(-100, 500);
GL11.glEnd();
GL11.glPopMatrix();
That is my rendering code, in case it matters.
And a weird thing is that when I first placed the quad in the scene it looked fine, but after I re-positioned it via Hot Code swap(Debug mode in eclipse) it added the line.
EDIT: My texture loading stuff: (I removed the other texture's loading stuff for the sake of space)
public static void loadTextures() throws IOException {
try {
Level_TutorialGround = TextureLoader.getTexture("PNG", ResourceLoader.getResourceAsStream("res/textures/Level_TutorialGround.png"));
System.out.println("Texture loaded: " + "Level_TutorialGround");
System.out.println(">> Image width: " + Level_TutorialGround.getImageWidth());
System.out.println(">> Image height: " + Level_TutorialGround.getImageHeight());
System.out.println(">> Texture width: " + Level_TutorialGround.getTextureWidth());
System.out.println(">> Texture height: " + Level_TutorialGround.getTextureHeight());
System.out.println(">> Texture ID: " + Level_TutorialGround.getTextureID());
} finally {
doneLoading = true;
}
GL_REPEAT
, and the texture coordinates (1.0) and (0.0) are actually on the boundary between the edge/border of your image. This means that if you use a linear texture filter, your texels will be partially sampled from the other side. There are a couple of ways to solve this, but if you just want to stretch this texture over your quad a single time the absolute easiest way is simply to useGL_CLAMP_TO_EDGE
forGL_TEXTURE_WRAP_S
andGL_TEXTURE_WRAP_T
. – Andon M. Coleman