PDA

View Full Version : general OpenGL input lag



kingc8
04-08-2010, 03:48 AM
Hi,

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,

Cameron

eile
04-08-2010, 05:54 AM
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.

ZbuffeR
04-08-2010, 05:59 AM
I confirm glFinish() is very effective for this. Place it right after swap buffers command.

kingc8
04-08-2010, 07:32 AM
Thanks very much for your help.

DmitryM
04-08-2010, 12:46 PM
Thank you, Zbuffer, this solved our problem as well.

blink
11-22-2010, 07:46 AM
I confirm glFinish() is very effective for this. Place it right after swap buffers command.
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?

ZbuffeR
11-22-2010, 08:49 AM
@blink: Does your edit mean "ZbuffeR for eile" or "eile for president" ?
... LOL ...

blink
11-22-2010, 09:04 AM
@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! :)