So Unity has many upscaling filters now such as bilinear, FSR and STP which I have used for projects trying to run 4k resolution on a machine that can only really handle 1920x1080p resolution at a specified framerate.
Are there any examples of how to use the upscaling filters to help maintain a framerate with a target resolution (not native resolution).
I can only really usually see the upscaling filters working if I mess with the render scale by setting it to any value below 1.
Keen to discuss with other developers their use-cases for the upscaling filters and how they used them
I believe this is as expected - renderscale <1 reduces the resolution of the render target to less than the viewport resolution, and then upsamples the lower resolution target to fill the viewport. So in your case, pick 4k resolution for the viewport and then whatever renderscale is required to reduce the render target to 1080p (~0.25?)
1 Like
I might look into some further scripting to drop the render scale if framerate drops for a long period of time
@ROBYER1_1 Here is Unity’s example for dynamic resolution scaling. It lowers the resolution when the frame time is about to exceed the budget for the target framerate.
https://github.com/Unity-Technologies/DynamicResolutionSample
Note that there are two ways to lower render resolution in URP. You can either change the Render Scale in the URP Asset or enable Dynamic Resolution on specific cameras and change their resolution with ScalableBufferManager.ResizeBuffers(scaleFactor, scaleFactor);
You should use Dynamic Resolution if the scale is going to change each frame, since it doesn’t need to reallocate the framebuffer each time it’s modified. It seems to break a few effects that use the depth buffer though.
Render Scale also applies to every camera, although I think Reflection Probes aren’t affected.
2 Likes
Interesting point, presumably also true of other passes using off screen targets, like the shadowmaps for main and additional lights
This is exactly what I was looking for as a working example of lowering resolution to meet frame time expectations. I’ll be using this on future projects for sure, the sample looks quite old so I hope it still works with recent URP/HDRP. Next if Unity can finish their roadmap item of making URP/HDRP interchangeable, that solves a lot of project performance headaches I go through on the daily.