GLCanvas Built-In FPS cap?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

GLCanvas Built-In FPS cap?

bgroenks96
I have an object registered as a GLEventListener for a GLCanvas and a thread that calls 'canvas.display()' at a fixed timestep (basically my own rendering loop as opposed to using Animator).

I set the target FPS for my loop to a huge number to see what the max FPS I could get out of the OpenGL renderer was.  To my surprise, the frame rate remained locked at 60 fps.

I tested the timestep by removing the call to canvas.display().  The target FPS was approximately reached.

Is this just something I'm not aware of in GLCanvas or the generated GLAutoDrawable?  Or do I need to set something in the canvas, profile or GLCapabilities objects?

Thanks in advance for your help!
Reply | Threaded
Open this post in threaded view
|

Re: GLCanvas Built-In FPS cap?

Sven Gothel
Administrator
On 04/14/2013 06:01 AM, bgroenks96 [via jogamp] wrote:

> I have an object registered as a GLEventListener for a GLCanvas and a thread
> that calls 'canvas.display()' at a fixed timestep (basically my own rendering
> loop as opposed to using Animator).
>
> I set the target FPS for my loop to a huge number to see what the max FPS I
> could get out of the OpenGL renderer was.  To my surprise, the frame rate
> remained locked at 60 fps.
>
> I tested the timestep by removing the call to canvas.display().  The target
> FPS was approximately reached.
>
> Is this just something I'm not aware of in GLCanvas or the generated
> GLAutoDrawable?  Or do I need to set something in the canvas, profile or
> GLCapabilities objects?
depending on the GL profile (> GL2) default it swap interval == 1,
i.e. vsync of your screen.

this is also true for OSX/CALayer.

use gl.setSwapInterval(0) to disable it.

~Sven



signature.asc (911 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: GLCanvas Built-In FPS cap?

bgroenks96
Yep that fixed it.  I wasn't aware that the VSync would be enabled by default.

I got around 3500 FPS rendering as fast a possible with the test program.  Quite promising!

Thanks for your help!