I am building tile map and my problem is that when i move its looks wired like pixels of textures are trilling
i appreciate any help
I am building tile map and my problem is that when i move its looks wired like pixels of textures are trilling
i appreciate any help
A “little more” details should be helpfull… and test code too :
Oke what i am doing is
i am new to OpenGL so my code is not probably perfect
bind texture and create list
GL11.glBindTexture(GL11.GL_TEXTURE_2D, glImgGrass);
glListIsoTile = GL11.glGenLists(1);
GL11.glNewList(glListIsoTile, GL11.GL_COMPILE);
//gl.glMaterialfv(GL.GL_FRONT, GL.GL_AMBIENT_AND_DIFFUSE, red, 0);
GL11.glBegin(GL11.GL_QUADS);
{
GL11.glTexCoord2f(0.0f, 1.0f);
GL11.glVertex3f(-80, 0.0f, 0);
GL11.glTexCoord2f(0.0f,0.0f);
GL11.glVertex3f(0.0f, -40, 0);
GL11.glTexCoord2f(1.0f, 0.0f);
GL11.glVertex3f(+80, 0.0f, 0);
GL11.glTexCoord2f(1.0f, 1.0f);
GL11.glVertex3f(0.0f, +40, 0);
}
GL11.glEnd();
GL11.glEndList();
This is my drawing
for (int x = 0; x < 15; x++) {
for (int y = 0; y < 15; y++) {
GL11.glPushMatrix();
GL11.glTranslatef(tile[x][y].getMid().x, tile[x][y].getMid().y,
0.0f);
GL11.glCallList(glListIsoTile);
GL11.glPopMatrix();
}
}
I tried on other pc and its different but still textures are not rendered smooth when moving
And my texture loading
IntBuffer image = ByteBuffer.allocateDirect(4).order(ByteOrder.nativeOrder()).asIntBuffer();
IL.ilGenImages(image);
IL.ilBindImage(image.get(0));
IL.ilLoadImage(path);
IL.ilConvertImage(IL.IL_RGB, IL.IL_BYTE);
ByteBuffer scratch = ByteBuffer.allocateDirect(IL.ilGetInteger(IL.IL_IMAGE_WIDTH) * IL.ilGetInteger(IL.IL_IMAGE_HEIGHT) * 3);
IL.ilCopyPixels(0, 0, 0, IL.ilGetInteger(IL.IL_IMAGE_WIDTH), IL.ilGetInteger(IL.IL_IMAGE_HEIGHT), 1, IL.IL_RGB, IL.IL_BYTE, scratch);
// Create A IntBuffer For Image Address In Memory
IntBuffer buf = ByteBuffer.allocateDirect(4).order(ByteOrder.nativeOrder()).asIntBuffer();
GL11.glGenTextures(buf); // Create Texture In OpenGL
GL11.glBindTexture(GL11.GL_TEXTURE_2D, buf.get(0));
// Typical Texture Generation Using Data From The Image
// Linear Filtering
// GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_LINEAR);
// Linear Filtering
// GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_LINEAR);
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER,GL11.GL_NEAREST);
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_NEAREST);
// Generate The Texture
GL11.glTexImage2D(GL11.GL_TEXTURE_2D, 0, GL11.GL_RGB, IL.ilGetInteger(IL.IL_IMAGE_WIDTH),
IL.ilGetInteger(IL.IL_IMAGE_HEIGHT), 0, GL11.GL_RGB, GL11.GL_UNSIGNED_BYTE, scratch);
return buf.get(0);
I don’t know how to explain it it looks like pixels of image are trilling when moving
It seams i fixt it
by using minimaps
I think the artefacs that you see was due to texture resizing (what mipmaping corrected)
Why are your tiles 160x80 ? If you planing to do a 2D game without any zoom, it should be better to use tiles with power of two size (128x64) and then make texture with exactly the same dimension.
By the way, you can use vertex2f instead of vertex3f for 2d drawing.
i am thinking 3d for later for some cool 3d effect abouw tiles and zooming
and i am thinking of making isometric look but keep eye at 0.0f 0.0f 0.5f and and looking at 0.0f 0.0f 0.5f
and tiles will be on x, y and z will be the same for all tiles and all other things in game world. ( and some cool effects in 3d abouw tiles)
my be you can give some advice to better approach?? 
THX