Re: GLJPanel "lagging" by one frame.
Posted by bkuker on Sep 22, 2013; 10:09pm
URL: https://forum.jogamp.org/GLJPanel-lagging-by-one-frame-when-multisampling-is-on-tp4030087p4030097.html
A few things narrowed down:
With jogl.gljpanel.noglsl set the GLJPanel lags one frame behind. Each call to display() renders frame N but blits frame N-1 to the buffered image, and then to the screen. The first call to display() displays garbage from video memory on screen. I am pretty sure GLJPanel.OffscreenBackend.postgl() is to blame, in the if statement where it chooses to use the glsl method to perform the image flip it calls fboDrawable.swapBuffers() but in the non-glsl branch it does no such thing.
Why was I disabling the GLSL method? Because if you are a madman who has left your winding mode the "wrong" way around the glsl method fails to draw. I assume that the geometry it uses to draw the texture to fboFlipped is culled away.
So:
Probable Bug 1: The glsl image flip relies on the winding mode being normal (CCW). Easy to workaround.
Possible Bug 2: The non-glsl branch does not swap buffers before reading pixels, so is one buffer behind.
But I am left pretty confused about why there is double buffering for the offscreen render.. and why I can't read pixels.