DSprtn / GTFO_VR_Plugin

A plugin to add full roomscale Virtual Reality support to your favorite game!
MIT License
144 stars 13 forks source link

Limit GetResolutionForAspect() to UHD to fix GUI at high resolutions #48

Closed Nordskog closed 1 year ago

Nordskog commented 1 year ago

What

This PR limits the resolution of GUI-related calls to GetResolutionForAspect(), used for the GUI overlay, to UHD ( 3840x2160 ) . This fixes an issue with the GUI clipping off-screen at very-high resolutions ( e.g. Varjo Aero at 5717x4133 ) making things like the settings menu inaccessible.

This PR is accompanied by a PR to the SteamVR Standalone repo: https://github.com/DSprtn/SteamVR_Standalone_IL2CPP/pull/6

The updated SteamVR_Standalone_IL2CPP.dll is included in this PR.

How

GetResolutionForAspect() was modified to add an overload that accepts a width limit. See the other PR for details on that implementation.

Every applicable call uses the VR_UI_Overlay.MAX_GUI_RESOLUTION constant set to 3840, as this is a common high resolution that is not high enough to break the GUI. If the menu stutter issues pops back up it might be worth investigating using a lower resolution, or making it configurable.

The only call to GetResolutionForAspect() that has been left as-is is in InjectScreenLiquidResolutionTweak, as it's not part of the GUI and we presumably want it rendered at the true resolution. Probably isn't affected by the resolution multiplier though.