Stuttering/jumping

Started by Brad811, May 09, 2012, 04:27:56

Previous topic - Next topic

Brad811

I was previously using display lists to render, and am now using VBOs, and I'm getting the same problem.
I'm getting some jumping, as in for a frame or two everything stutters/jumps to the side (generally in the direction of motion). I'm wondering if this is a lag problem, but it seems to have gotten worse since switching to VBOs, which is the opposite of what I was expecting.

I'm also getting some horizontal lines. I'm drawing textures by using a 512px x 512px image divided into 16x16 tiles. I've tried to fix this by drawing 1.0f/16.001f of the texture instead of just 1.0f/16.0f, and this helps, but doesn't completely fix it.

Does anyone have any idea what could be causing these issues?

Thanks!

--EDIT--
Here is the function I'm using to render about 1000 quads per frame.
public void render(float scaleX, float scaleY, float scaleZ)
{
	GL15.glBindBuffer(GL15.GL_ARRAY_BUFFER, vertex_buffer_id);
	GL15.glBufferData(GL15.GL_ARRAY_BUFFER, vertex_buffer_data, GL15.GL_STATIC_DRAW);
	
	GL11.glBindTexture(GL11.GL_TEXTURE_2D, GameApplet.getTilesTexture().getTextureID());
	
	GL11.glVertexPointer(3, GL11.GL_FLOAT, 48, 0);
	GL11.glNormalPointer(GL11.GL_FLOAT, 48, 12);
	GL11.glColorPointer(4, GL11.GL_FLOAT, 48, 24);
	GL11.glTexCoordPointer(2, GL11.GL_FLOAT, 48, 40);
	
	GL11.glScalef(scaleX, scaleY, scaleZ);
	GL11.glDrawArrays(GL11.GL_QUADS, 0, vertex_data_array.length / 12);
}

Could this be the problem?