bryceco / GoMap

OpenStreetMap editor for iPhone/iPad
ISC License
301 stars 40 forks source link

120 FPS support #735

Closed verhovsky closed 2 weeks ago

verhovsky commented 3 months ago

iPhone 13 Pro and iPad Pro screens can do 90 or 120 FPS but GoMap is capped at 60 FPS

https://developer.apple.com/documentation/quartzcore/optimizing_promotion_refresh_rates_for_iphone_13_pro_and_ipad_pro#

dieterdreist commented 3 months ago

it's a feature for battery life, so you can map longer...

verhovsky commented 3 months ago

you can turn on battery saver mode. from my reading of the above link, supporting that means also supporting lower refresh rates, though i don't know, maybe it does that already at 60 fps

bryceco commented 3 months ago

The number of objects displayed on screen is tuned to allow 60 FPS on older devices. On newer devices we could display more objects, or we could increase frame rate, or as @dieterdreist says we could leave it at 60 to save battery.

Battery saver isn't great for mapping because it dims the screen and turns off the display more quickly, which is annoying. Does it also reduce frame rate (or can the app ask)?

dieterdreist commented 3 months ago

in fairness I must admit I’m currently on iphone7 (for the past 7 or so years) and get 60fps initially but it temporarily drops when I move and load more data, to 50 and even 40, seems to recover then to 60. For mapping I would consider 5fps sufficient, but I don’t want to step in the way of raising it. Maybe it could be different according to the device? (or maybe it already is autoadjusting to 60fps?)

bryceco commented 3 months ago

The code does scale the number of objects based on device performance, but it maxes out at around iPhone 7 performance levels so in practice it's now a constant. (Search for references to Geekbench in the code.)

bryceco commented 2 months ago

Okay, I've tried setting what are supposed to be the appropriate .plist and CADisplayLink settings but I'm not getting above 60 FPS. Any help from someone smarter?

bryceco commented 2 weeks ago

Added in 32e060fdad4ea1692deaa2ac1026c2296fefd644