admin管理员组文章数量:1122832
I’m trying to define the frame rate for rendering with a GLKView
or MTKView
on my iPhone 15 Pro Max, which supports a 120Hz refresh rate (ProMotion). However, I’m having difficulty achieving anything higher than 60 FPS. Here’s what I’ve done so far:
For GLKView: By default, drawRect is called at a maximum rate of 60 FPS, despite the device being capable of 120 FPS.
For MTKView: I’ve set enableSetNeedsDisplay
to true and manually call setNeedsDisplay
every 8ms, expecting it to render at around 120 FPS. However, the frame rate remains capped at 60 FPS.
How can I configure either GLKView
or MTKView
to render at the device's full 120Hz capability? Are there additional settings or properties (e.g., related to CADisplayLink
or preferredFramesPerSecond
) that I need to adjust for high refresh rates?
Any insights or guidance would be greatly appreciated!
I’m trying to define the frame rate for rendering with a GLKView
or MTKView
on my iPhone 15 Pro Max, which supports a 120Hz refresh rate (ProMotion). However, I’m having difficulty achieving anything higher than 60 FPS. Here’s what I’ve done so far:
For GLKView: By default, drawRect is called at a maximum rate of 60 FPS, despite the device being capable of 120 FPS.
For MTKView: I’ve set enableSetNeedsDisplay
to true and manually call setNeedsDisplay
every 8ms, expecting it to render at around 120 FPS. However, the frame rate remains capped at 60 FPS.
How can I configure either GLKView
or MTKView
to render at the device's full 120Hz capability? Are there additional settings or properties (e.g., related to CADisplayLink
or preferredFramesPerSecond
) that I need to adjust for high refresh rates?
Any insights or guidance would be greatly appreciated!
Share Improve this question asked Nov 21, 2024 at 21:21 zeuszeus 13.3k16 gold badges85 silver badges233 bronze badges 2- Enable faster ProMotion refresh rates – Hamid Yusifli Commented Nov 21, 2024 at 21:30
- Yes but what do do exactly ? i did everything without success – zeus Commented Nov 21, 2024 at 21:44
1 Answer
Reset to default 1I found, i need to do :
let displayLink = CADisplayLink(target: self, selector: #selector(render))
if #available(iOS 15.0, *) {
displayLink.preferredFrameRateRange = CAFrameRateRange(minimum: 120, maximum: 120, preferred: 120)
} else {
displayLink.preferredFramesPerSecond = 60
}
displayLink.add(to: .current, forMode: .default)
版权声明:本文标题:ios - How to Set the Frame Rate for GLKView or MTKView on iPhone 15 Pro Max (120Hz Display)? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736307096a1933192.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论