CaffeineMC / sodium-fabric

A Minecraft mod designed to improve frame rates and reduce micro-stutter
Other
4.74k stars 809 forks source link

AMD FSR can be added to sodium? #796

Closed baturalp1337 closed 3 years ago

baturalp1337 commented 3 years ago

Hello, maybe you know. AMD introduced FSR technology. Same functionality as DLSS. It would be great if the FSR comes with sodium. It gives a huge FPS boost (if the graphics card supports it). I think it would make a lot of sense if it was added to Sodium.

FSR: https://www.amd.com/en/technologies/radeon-software-fidelityfx-super-resolution

Cooly568 commented 3 years ago

From my knowledge, a technology like this would be near impossible to port back to Java, and likely has no support from AMD. Even then it would have limited use in a game like Minecraft due to its main problems with performance being due to how it is written and what it is written in.

In a theoretical world where support already existed for Java, this would primarily have more use for scaling to higher resolutions.

amnotbananaama commented 3 years ago

Supports:

  • DirectX®12.
  • DirectX®11.
  • Vulkan®.

This will not be worked on. In addition to a lack of Java/OpenGL support, the amount of work to support this would be at least the same amount as rewriting the entire Minecraft client, for a fairly small percentage of users

baturalp1337 commented 3 years ago

Supports:

  • DirectX®12.
  • DirectX®11.
  • Vulkan®.

This will not be worked on. In addition to a lack of Java/OpenGL support, the amount of work to support this would be at least the same amount as rewriting the entire Minecraft client, for a fairly small percentage of users

thanks for info :)

Heath123 commented 2 years ago

the amount of work to support this would be at least the same amount as rewriting the entire Minecraft client

It's just a post-processing shader, it has been ported to OpenGL (https://jntesteves.github.io/shadesofnoice/graphics/shaders/upscaling/2021/09/11/amd-fsr-demystified.html)

Heath123 commented 2 years ago

Seems like this sort of moved to #1075

amnotbananaama commented 2 years ago

It's just a post-processing shader, it has been ported to OpenGL (https://jntesteves.github.io/shadesofnoice/graphics/shaders/upscaling/2021/09/11/amd-fsr-demystified.html)

Thank you for the link. I apologize for closing this so abruptly. It was not immediately clear to me what FSR was at the time of the initial post. I (incorrectly) assumed it was a closed-source executable meant to run alongside a game based on AMD's marketing jargon. I was not aware that FSR was a shader or that it was open source, until you posted just now.

Of course, questions still remain if integration is to be considered:

I agree it looks like discussion has moved to the other issue, I would encourage you to post this link there.

Mauricio-MN commented 8 months ago

Zink

nitanmarcel commented 4 months ago

Found this recently that ports fsr2 to OpenGL. Of course the biggest issue it would be that it's written in c++ but maybe writing some JNI bindings will work?

https://github.com/JuanDiegoMontoya/FidelityFX-FSR2-OpenGL

jellysquid3 commented 4 months ago

Minecraft does not have motion vectors and generating them is non-trivial (see: very hard) due to the game's rendering architecture. There's going to be practically speaking very little performance benefit to implementing any kind of advanced upscaling technology, given the game's pixel shaders are so incredibly simple.

nitanmarcel commented 4 months ago

Minecraft does not have motion vectors and generating them is non-trivial (see: very hard) due to the game's rendering architecture. There's going to be practically speaking very little performance benefit to implementing any kind of advanced upscaling technology, given the game's pixel shaders are so incredibly simple.

Hmm right. Afaik shaders like PTGI 3 need motion vectors which is implemented in iris. I suppose adding FSR would be something to discuss there rather than in sodium 🤔

TheNukeLore commented 4 months ago

iris does not add motion vectors, ptgi 3 just lacks motion vectors when used on iris.

Timman6866 commented 2 months ago

Sorry that this isn't specifically related to Sodium (love the work you've done btw). Lossless scaling is your friend. Works great and supports FSR and frame generation. Leave Minecraft in windowed mode and let lossless scaling resize the window and do its magic. $6.99

https://store.steampowered.com/app/993090/Lossless_Scaling/

nitanmarcel commented 2 months ago

Sorry that this isn't specifically related to Sodium (love the work you've done btw). Lossless scaling is your friend. Works great and supports FSR and frame generation. Leave Minecraft in windowed mode and let lossless scaling resize the window and do its magic. $6.99

https://store.steampowered.com/app/993090/Lossless_Scaling/

Oh it works now? Last time I tested it failed to work with Minecraft

Timman6866 commented 2 months ago

Sorry that this isn't specifically related to Sodium (love the work you've done btw). Lossless scaling is your friend. Works great and supports FSR and frame generation. Leave Minecraft in windowed mode and let lossless scaling resize the window and do its magic. $6.99 https://store.steampowered.com/app/993090/Lossless_Scaling/

Oh it works now? Last time I tested it failed to work with Minecraft

It's been working well for me. I've tested it on a micro PC with an n4000 cpu all the way to my main PC with an RTX 4070. I usually set the upscale ratio myself and let the app auto-resize the window. Capping the framerate in the Minecraft video settings is useful if you use the frame generation. You can, however, tell that the upscaling is done without vectors. The image quality looks great, but reminds me of using a streaming service like GeForce now, or Stadia (RIP).

Psyko38 commented 2 months ago

hello I found this allows to integrate amd fsr 1.1 with GLSL files (file extension for opengl sahder): https://gpuopen.com/manuals/fidelityfx_sdk/fidelityfx_sdk-page_techniques_super-resolution-spatial/