# Unlock 60 fps with 120 fps?

**URL:** <https://discourse.libcinder.org/t/unlock-60-fps-with-120-fps/1839>\
**Category:** Uncategorized\
**Created:** [July 8, 2021, 12:35am UTC](https://discourse.libcinder.org/t/unlock-60-fps-with-120-fps/1839 "2021-07-08T00:35:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![serg](https://avatars.discourse-cdn.com/v4/letter/s/ecd19e/32.png) [@serg](https://discourse.libcinder.org/u/serg)\
**Post date:** [July 8, 2021, 12:35am UTC](https://discourse.libcinder.org/t/unlock-60-fps-with-120-fps/1839/1 "2021-07-08T00:35:40Z")

</div>

Hello,

How to enable 120 fps in the Cinder? I tried a demo projects for iOS. But it seems the FPS is always locked with 60Hz

And this code is not working for me. FPS still 60hz. So I can make it only 1-60fps.

```auto
settings->disableFrameRate();
settings->setFrameRate(120);

```

p.s. My iPad Pro 13 inch support 120 fps.

---

<div class="post-metadata">

**Author:** ![paul.houx](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.libcinder.org/paul.houx/32/31_2.png) [@paul.houx](https://discourse.libcinder.org/u/paul.houx)\
**Post date:** [July 8, 2021, 5:54am UTC](https://discourse.libcinder.org/t/unlock-60-fps-with-120-fps/1839/2 "2021-07-08T05:54:50Z")

</div>

Make sure to also disable vertical sync:

```auto
void MyApp::setup()
{
   ci::gl::enableVerticalSync( false );
}

```

~Paul

---

<div class="post-metadata">

**Author:** ![totalgee](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.libcinder.org/totalgee/32/274_2.png) [@totalgee](https://discourse.libcinder.org/u/totalgee)\
**Post date:** [July 14, 2021, 1:19pm UTC](https://discourse.libcinder.org/t/unlock-60-fps-with-120-fps/1839/3 "2021-07-14T13:19:31Z")

</div>

@serg did it help? Because, unless I’m mistaken, it looks like `enableVerticalSync()` is not implemented for the `CINDER_COCOA_TOUCH` case, so that’s a no-op:

[Cinder/wrapper.cpp at master · cinder/Cinder (github.com)](https://github.com/cinder/Cinder/blob/master/src/cinder/gl/wrapper.cpp#L52-L64)

But, theoretically, the vertical sync on the device should be as fast as the hardware supports (240Hz or 120Hz in iPhones or iPads with ProMotion). For example, on [this page](https://developer.apple.com/documentation/metal/using_metal_system_trace_in_instruments_to_profile_your_app), Apple says:

> Not all displays use a ~16 ms frame interval; for example, vertical synchronization happens every ~4 ms on ProMotion displays.

Maybe when you explicitly `setFrameRate(120)` with vsync on, the app tries swapping buffers a bit too late, so you _just_ miss the vsync, so you drop to 60Hz. What happens if you leave vertical sync alone and only call `disableFrameRate()`? In that case, it should draw as fast as it can, but still sync on retrace. Otherwise, I guess you might try calling `setFrameRate(150)` (or something faster than 120), to see if that helps.

BTW, the code to calculate the display interval also looks wrong on iOS, since it’s assuming the “default” refresh rate is 60Hz (although in your specific case it should still specify an interval of 1 when you call it with `120`):

[Cinder/AppImplCocoaTouch.mm at master · cinder/Cinder (github.com)](https://github.com/cinder/Cinder/blob/master/src/cinder/app/cocoa/AppImplCocoaTouch.mm#L110)

The `frameInterval` method is [deprecated](https://developer.apple.com/documentation/quartzcore/cadisplaylink/1621231-frameinterval?language=objc) (though should still work), but looks like there is a newer `preferredFramesPerSecond` method, that takes into account the actual `maximumFramesPerSecond` of the display.
