godotengine / godot-proposals

Godot Improvement Proposals (GIPs)
MIT License
1.14k stars 94 forks source link

Allow FSR 2 to downscale from a higher internal resolution #8086

Open Jamsers opened 1 year ago

Jamsers commented 1 year ago

Describe the project you are working on

A 3D game (demo) that uses FSR 2 as its only antialiasing and scaling solution.

Describe the problem or limitation you are having in your project

Right now, FSR 2 only supports upscaling from a lower internal resolution, or being used as a TAA alternative by setting the render scale to 1.0. If the render scale goes even slightly above 1.0 (i.e. 1.01 and above), Godot turns FSR 2 off and falls back to native TAA + bilinear downscaling.

The problem is that despite the miniscule resolution difference between 1.00 and 1.01, the visual difference caused by FSR 2 being automatically turned off is significant.

https://github.com/godotengine/godot-proposals/assets/39361911/bac1685e-3bd2-41f0-8609-097dd742acaf

Describe the feature / enhancement and how it helps to overcome the problem or limitation

If possible, allow FSR 2 to remain enabled even if the internal resolution scale is set above 1.0. Even if you won't see significant visual improvement by downscaling from a higher internal resolution (due to the nature of FSR 2), and even if the performance cost is significant, the ability to keep the "look and feel" of your game consistent regardless of internal resolution is very useful.

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

If the FSR 2 code already has the capability to downscale, simply remove the "above 1.0 not allowed" limitation from the settings, and API.

If FSR 2 cannot downscale, then render the game at the higher internal resolution with native FSR 2 antialiasing, then bilinear downscale the render to the output resolution.

If this enhancement will not be used often, can it be worked around with a few lines of script?

A workaround for this would be to use NVIDIA DSR or AMD VSR to fake a higher resolution, then set FSR 2 scaling to 1.0 in Godot. The driver then takes care of downscaling to the native monitor resolution.

Obviously this is a very roundabout and not user friendly way of achieving higher than native FSR 2 antialiasing. Not to mention the resolutions available in DSR or VSR tend to be limited.

Is there a reason why this should be core and not an add-on in the asset library?

It concerns a core rendering feature.

Calinou commented 1 year ago

I believe using FSR2 for downscaling will easily lead to oversharpening, so this may require the FSR Sharpness setting to be ignored (and always be set to its highest possible value, which is the lowest amount of sharpening).

This is the reason why FSR1 isn't allowed for downscaling either.

Jamsers commented 1 year ago

and always be set to its highest possible value, which is the lowest amount of sharpening

Oh. My. God. I have been using that setting wrong the entire time. I was setting it to 0 and wondering why FSR still looked so oversharpened... turns out I was setting sharpening to max this whole time. I'm illiterate. Don't look at me! 🫣

Implementing this proposal seems to be as simple as deleting these lines, I tried this on a custom build and it seemed to work just fine. Could make for a good first issue PR. 😊

this may require the FSR Sharpness setting to be ignored

I don't think there's a need for this, maybe someone actually wants the oversharpened look for example, they should be able to have it if they want. But there definitely should be strong warnings both for dissuading users from using FSR to downsample, and from setting sharpening at anything other than the lowest if you do decide to use FSR to downsample anyway. Both in documentation, and in the editor tooltips as well.