Jamesacres,
100ms of latency does sound a little excessive. This is all I'm doing:
draw(){
Frame *frame = camera->GetLatestFrame();
if(frame)
{
frame->Rasterize(framebuffer);
tx.loadData(px);
frame->Release();
}
ofSetColor(255);
tx.draw(0,0);
}
I measured roughly 100ms of latency with a high speed camera and a clap test. That's 100ms between clapping in meatspace and clapping in screenspace. The camera was streaming in at 240fps, So I can see it adding 5+ ms of latency, but... 50ms?
(Note: When I turn vsync off and my app runs around 240fps, tearing all over the place, my meatspace->screenspace latency drops to about 12ms, which is magical. I'm going to take this to mean my camera latency is really only around 5ms.)
Maybe that 100ms latency is a red herring. Even without the camera and textures in play, I'm still seeing 3 or 4 full frames of latency on that mouse latency test video I posted above.
I think I understand what you mean about stalling the GPU, and I can imagine that this would have an impact if I was rendering a complex scene in a game. But when updating a texture only takes 2 or 3ms and that's ALL I'm doing, is this really going to shave entire frames off my latency?
I asked initially about pushing pixels into a buffer or texture because I thought there might be a way to access a video buffer somewhere a frame or two AFTER a tex.draw() call. Those pixels must be hiding SOMEWHERE in the pipeline, right?
I read through this:
https://www.opengl.org/wiki/Buffer_Object_Streaming
...but couldn't tell if there was anything here to help me. It looks like all of the optimizations anyone can discuss have to do with getting data into a buffer efficiently before it gets drawn. The trouble point for me is how to deal with the 3 or 4 buffer flips that happen after I draw.
I haven't been able to get setDoubleBuffering(false); working in oF 0.8.4. (I just get a back screen.) With the new 0.9 beta it works, (I mean: I can successfully draw to screen and see it,) and I think it knocks me down to 3 frames of latency instead of the 3-4 I see normally.