[SOLVED] Bug with rendering texture VBOs with OpenGL Translation

So I’m rendering out a bunch of flat textured quads in OpenGL. I add all the vertexes of the quads and their texture coordinates to a VBO and then render it. However, whenever the camera moves (OpenGL transformation is applied), little gaps in between to tiles begin to appear like they’re not all rendering in a perfect grid. When the camera stops moving (OpenGL transformation stops), the gaps between the tiles disappear and the textures are rendered correctly in the grid.

I have already tried calling:


GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, GL12.GL_CLAMP_TO_EDGE);
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, GL12.GL_CLAMP_TO_EDGE);

in my texture loading code and it had no effect. I did notice the effect slightly lessened when I turned of depth testing but other than this i have nothing to go on.

Anybody got any suggestions as to why this might be or how i could fix it ???

Are you using power of two textures?

Another possibility (mostly if you are loading textures from sprite sheet): http://gamedev.stackexchange.com/questions/46963/how-to-avoid-texture-bleeding-in-a-texture-atlas

Yes I am using power of 2 textures, they are 16x16 sprites loaded in from a 256x256 image

I don’t think the article you linked me to has much relevance to my current issue because I am rendering in 2D not 3D and also his issue seems to be different to mine. His textures just seem to be linking together incorrectly whereas mine seem to pull apart whenever transformation is applied

Could you post screenshot of the issue?

It took me a while to try and snap a shot of it, but here is what it looks like horizontally, the same happens vertically as well when you move upwards:

I had the same problem in my first project - tip in linked article fixed it.

Which tip in particular? There are many answers given

Ok, thanks alot, this worked perfectly ;D

Cheers

Edit: And thanks for following my blog aswell :slight_smile: