High density framebuffer and supersampling support#2801
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a comprehensive high-DPI and display scaling model across the Android, iOS, and Desktop (LWJGL3) backends, effectively separating logical application coordinates from physical framebuffer pixels. Key changes include the addition of new scaling mode constants in AppSettings, a DisplayScaleUtils utility for coordinate resolution, and updates to JmeContext, RenderManager, and various input handlers to support DPI-aware rendering and input. The implementation also supports emulated render scaling and enhances the sRGB blit path to accommodate these scaling modes. New unit tests and a manual diagnostic example have been added to verify the functionality. I have no feedback to provide as there were no review comments to assess.
This PR adds hidpi and supersampling support to every backend.
Up until now jme had some limited support for high dpi framebuffers (that we called RetinaFramebuffer and was built specifically for macos), this PR adds a DisplayScaleMode AppSettings that extends and improves the support for high dpi to every platform and adds supersampling support.
Possible values:
RetinaFramebuffersetting, basically the engine sees the high dpi framebuffer as a generic big framebuffer, the camera sizes match the full high dpi framebuffer size, apps need to be aware of that, eg. to scale ui elements accordingly.Suggested setting for new apps is
DISPLAY_SCALE_DPI_AWAREor1.2f, but it is defaulted toDISPLAY_SCALE_DISABLEDfor backward compatibility.