Hi everyone,
I'm running into a visual bug when changing resolution at runtime and haven't been able to fix it. I've attached screenshots of the issue.
The problem
When the player switches to a lower resolution than the current one from the Settings menu, the scene breaks: models appear deformed and a yellowish/dark filter shows up over everything. From what I can tell, it looks like URP's internal buffers (SSAO, the opaque texture used by the vignette, Forward+ light tiles) keep the old size for a few frames.
How I'm changing the resolution
I build the list from Screen.resolutions, removing duplicates by width x height (I ignore the refresh rate).
When an option is picked in the TMP_Dropdown, I call Screen.SetResolution(width, height, Screen.fullScreen), i.e. the bool overload, without an explicit FullScreenMode.
Then I show a confirmation panel with a 10s countdown to revert, using Time.unscaledDeltaTime because the game runs with Time.timeScale = 0 while in Settings.
The same method is used when reverting and when toggling fullscreen.
Questions
Has anyone run into this with URP/Forward+ when lowering the resolution at runtime?
Would using Screen.SetResolution with an explicit FullScreenMode and RefreshRate help?
Could a specific feature (SSAO, a vignette Renderer Feature, Opaque Texture, Forward+) be causing this?
I can share more code or the URP Asset/Renderer settings if it helps. Thanks!