Resolution for Games

Hi,

When using a High Definition Display, is there a way to render at exactly the target resolution on the physical screen?

My understanding is that the default behavior is to render to a backing store with a resolution (in pixels) which can be twice the size of the logical resolution (in points). Then we let the OS handle the down-scaling to the actual target resolution on the screen. This is all nice for non-graphics intensive apps, but it means that my game will render at a higher resolution than needed, which seems like an obvious loss of performance.

My expectation is that, for graphics intensive application such as games, we should be able to query and render to the final resolution on the display. Can it / should it be done?

Thank you for your help :)

FYI I did find a document which explains how to setup your CAMetalLayer to render at a custom resolution. I suspect that this may be what I have to do?

Answered by DTS Engineer in 811073022

From your question it's not clear if you're looking for iOS or macOS information, so here are some references that touch on both worlds:

Quartz Display Services - macOS APIs for complete information about connected displays

UIScreen's scale property is most likely the specific value you are looking for on iOS devices.

and on macOS, NSScreen has an analogous backingScaleFactor.

and for more discussion, please see High Resolution Guidelines for OS X.

Also, perhaps worth mentioning, there is the new Games Pathways documentation collection. They have some guidance/recommendations for optimal display handling in there.

From your question it's not clear if you're looking for iOS or macOS information, so here are some references that touch on both worlds:

Quartz Display Services - macOS APIs for complete information about connected displays

UIScreen's scale property is most likely the specific value you are looking for on iOS devices.

and on macOS, NSScreen has an analogous backingScaleFactor.

and for more discussion, please see High Resolution Guidelines for OS X.

Also, perhaps worth mentioning, there is the new Games Pathways documentation collection. They have some guidance/recommendations for optimal display handling in there.

On iOS, In GLKView you do this:

self.contentScaleFactor = self.window.screen.nativeScale;

I suspect that the same thing works for MTKView but I haven't tried it.

Resolution for Games
 
 
Q