godotengine / godot-proposals

Godot Improvement Proposals (GIPs)
MIT License
1.12k stars 69 forks source link

Add support for AMD FSR 3 frame generation (currently, FSR 2.2 is supported) #8768

Open ArseniyMirniy opened 8 months ago

ArseniyMirniy commented 8 months ago

Describe the project you are working on

All visually demanding games will benefit from it

Describe the problem or limitation you are having in your project

Currently FSR 2 is in use, it has slightly worse upscaling and no Frame Generation.

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

The biggest part of FSR 3 is Frame Generation support. It works surprisingly good even for games where it wasn't implemented by developers (and was added by modders). By data from real frames, it creates intermediate ones.

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

Currently, the public release is for DirectX12 https://gpuopen.com/fsr3-source-available/ The Vulkan plugin is in the works and will take several months to complete. It may be handy to check out right now what data these frames need and how can it be implemented. And how to use it for 3D and not for 2D elements (since the algorithm may blur them out)

image

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

No, it requires low-level access and motion vectors

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

FSR 2 is in the core and was admitted as one of the main updates of the recent Godot 4.2 release

Mickeon commented 8 months ago

It's been really funny to me that by the time a new stable Godot build is released, a new FSR version comes out, which renders the previous implementation obsolete already. There's a few existing bugs with the FSR 2.2 implementation currently, and it would be nice to iron them out before moving the flag. Still, I feel like for most common use-cases the current FSR is pretty good, albeit I have yet to see a game made with the engine taking full advantage of it.

spiderbyte87 commented 5 months ago

AMD just announced FSR 3.1 which will have support for Vulkan. It also supports decoupling frame generation from upscaling.

octanejohn commented 5 months ago

the fsr 3.1 version mostly fixes the fsr 2.2 problems(3.0 and 2.2 is the same)

Calinou commented 5 months ago

Note that FSR 3.1's source code release is expected to happen in Q2 2024, so most likely in June 2024.

In the meantime, apps like Lossless Scaling's LSFG1 and AMD Fluid Motion Frames already work on Godot projects (both 3.x and 4.x) as I tested locally. These are limited to Windows though as they rely on low-level window manager hooks (Lossless Scaling) or driver-level features (AFMF).

You will get the best results by capping the game framerate to a value you can steadily reach, and letting frame generation double the perceived framerate (the --max-fps command line argument can be handy). At input framerates of 60 or higher, quality is surprisingly good considering these tools work with the color buffer only (no depth or motion vectors used). Latency is similar to what you'd get with a native frame generation implementation, assuming the V-Sync conditions are identical.

ArseniyMirniy commented 5 months ago

In the meantime, apps like Lossless Scaling's LSFG1 and AMD Fluid Motion Frames already work on Godot projects (both 3.x and 4.x) as I tested locally. These are limited to Windows though as they rely on low-level window manager hooks (Lossless Scaling) or driver-level features (AFMF).

Just to make it clear: FMF only works on the most recent Radeon GPUs and third-party apps cover a tiny portion of the audience. They are nice but still not gonna replace the in-engine solution that will be accessible for the majority of users.

Will wait for the source code.

BuyMyMojo commented 2 months ago

FSR3's "Native AA" would make a great additional choice for anti aliasing in Godot. FSR3.1 is coming soon with vulkan support too which should hopefully remove any barriers ion replace 2.2

The origional announcement for FSR3.1 said it would be avaliable Q2 this year which is almost up s hopefully it will release soon

Calinou commented 2 months ago

FSR3's "Native AA" would make a great additional choice for anti aliasing in Godot.

This is already supported in Godot by setting the 3D scaling mode to FSR2 and leaving the 3D scale at its default value of 1.0. (Many games have mods for doing this as well.)

As far as I know, FSR3's native AA is not a different algorithm from FSR3 upscaling, just an official acknowledgement that it's a supported configuration.

BuyMyMojo commented 2 months ago

FSR3's "Native AA" would make a great additional choice for anti aliasing in Godot.

This is already supported in Godot by setting the 3D scaling mode to FSR2 and leaving the 3D scale at its default value of 1.0. (Many games have mods for doing this as well.)

As far as I know, FSR3's native AA is not a different algorithm, just an official acknowledgement that it's a supported configuration.

Oh I did not notice the AA working, I'll have to take another look, thanks!

BuyMyMojo commented 2 months ago

Also great timing on my part, right after I made my comment they announced the source will be dropping next month

https://community.amd.com/t5/gaming/amd-fsr-3-1-now-available-fsr-3-available-and-upcoming-in-60/ba-p/692000

BuyMyMojo commented 2 months ago

Just opened twitter to see their annoucement, source code is released! I hope it's an easy process to upgrade for whoever takes on the task <3

https://gpuopen.com/learn/amd_fsr_3_1_release/?utm_source=twitter&utm_medium=social&utm_campaign=fsr3_1

https://github.com/GPUOpen-LibrariesAndSDKs/FidelityFX-SDK/blob/main/docs/techniques/super-resolution-interpolation.md