View Full Version : Non-smooth vertical movement of the horizontal lines

07-20-2015, 02:21 AM
Hi everybody :)
I have a weird problem: Simply put, I want to draw lots of horizontal lines on the screen which move vertically by time. For now, I've just used a simple value for Y (instead of real time) to examine the problem. There are thousands of vertices in my VBO with specific X and Y. I use glMapBuffer to access them one by one before each render loop and reduce their Y value by a certain offset. The problem is, the overall lines movement is not smooth and - on every frame - some line move up while others don't. I've tried VSync, BufferData, FPS increase/decrease, etc. Here's a sample code (C# OpenTK):

GL.BindBuffer(BufferTarget.ArrayBuffer, _vbo);
IntPtr bufferPointer = GL.MapBuffer(BufferTarget.ArrayBuffer, BufferAccess.ReadWrite);
var dataPointer = (Vector2*)bufferPointer.ToPointer();
for (int i = 0; i < _initialVertexData.Length; i++)
dataPointer[i].Y -= 10f;
throw new Exception("Error in MapBuffer");
GL.BindBuffer(BufferTarget.ArrayBuffer, 0);

and a sample GIF snapshot of what happens: