general OpenGL input lag


From experience of both ATI and nVidia hardware I find that updating geometry locations from a hardware input ever-so-slightly laggy.

For example, if you attach some textured quad to the mouse coordinates and move the mouse, you see it trail the mouse cursor a little.

Why does it do that? Is there latency to uploading the mouse coordinates from main memory to the gpu hardware? I’m using OpenGL 1.2.

I’m moving to other input mechanics and now this lag is starting to become an experience-damaging issue.

I’m using nvidia 9600m with nvidia 185 drivers on linux.

Thanks for any information,


OpenGL is a pipeline, that is, the CPU is a couple of rendering frames ahead of the GPU (typically up to 2-3 frames). You can enforce less lag using glFinish (or possibly glFlush), at the expense of overall performance. Newer cards support more fine-grained extensions such as fences which might be useful to you.

I confirm glFinish() is very effective for this. Place it right after swap buffers command.

Thanks very much for your help.

Thank you, Zbuffer, this solved our problem as well.

ZbuffeR for the president!
This glFinish() after swap buffers trick should be on the first page of any tutorial!

Edit: Oh eile i mean, or both?

@blink: Does your edit mean “ZbuffeR for eile” or “eile for president” ?
… LOL …

I’ll leave it to you, you are free to pick the one you like! :slight_smile: