diff --git a/docs/FidelityFX-FSR-Overview-Integration.pdf b/docs/FidelityFX-FSR-Overview-Integration.pdf index 63626c6..cc171ce 100755 Binary files a/docs/FidelityFX-FSR-Overview-Integration.pdf and b/docs/FidelityFX-FSR-Overview-Integration.pdf differ diff --git a/ffx-fsr/ffx_fsr1.h b/ffx-fsr/ffx_fsr1.h index 15ecfde..4e0b3d5 100644 --- a/ffx-fsr/ffx_fsr1.h +++ b/ffx-fsr/ffx_fsr1.h @@ -747,12 +747,12 @@ AF1 sharpness){ // Immediate constants for peak range. AF2 peakC=AF2(1.0,-1.0*4.0); // Limiters, these need to be high precision RCPs. - AF1 hitMinR=mn4R*ARcpF1(AF1_(4.0)*mx4R); - AF1 hitMinG=mn4G*ARcpF1(AF1_(4.0)*mx4G); - AF1 hitMinB=mn4B*ARcpF1(AF1_(4.0)*mx4B); - AF1 hitMaxR=(peakC.x-mx4R)*ARcpF1(AF1_(4.0)*mn4R+peakC.y); - AF1 hitMaxG=(peakC.x-mx4G)*ARcpF1(AF1_(4.0)*mn4G+peakC.y); - AF1 hitMaxB=(peakC.x-mx4B)*ARcpF1(AF1_(4.0)*mn4B+peakC.y); + AF1 hitMinR=min(mn4R,eR)*ARcpF1(AF1_(4.0)*mx4R); + AF1 hitMinG=min(mn4G,eG)*ARcpF1(AF1_(4.0)*mx4G); + AF1 hitMinB=min(mn4B,eB)*ARcpF1(AF1_(4.0)*mx4B); + AF1 hitMaxR=(peakC.x-max(mx4R,eR))*ARcpF1(AF1_(4.0)*mn4R+peakC.y); + AF1 hitMaxG=(peakC.x-max(mx4G,eG))*ARcpF1(AF1_(4.0)*mn4G+peakC.y); + AF1 hitMaxB=(peakC.x-max(mx4B,eB))*ARcpF1(AF1_(4.0)*mn4B+peakC.y); AF1 lobeR=max(-hitMinR,hitMaxR); AF1 lobeG=max(-hitMinG,hitMaxG); AF1 lobeB=max(-hitMinB,hitMaxB); @@ -845,12 +845,12 @@ AF1 sharpness){ // Immediate constants for peak range. AH2 peakC=AH2(1.0,-1.0*4.0); // Limiters, these need to be high precision RCPs. - AH1 hitMinR=mn4R*ARcpH1(AH1_(4.0)*mx4R); - AH1 hitMinG=mn4G*ARcpH1(AH1_(4.0)*mx4G); - AH1 hitMinB=mn4B*ARcpH1(AH1_(4.0)*mx4B); - AH1 hitMaxR=(peakC.x-mx4R)*ARcpH1(AH1_(4.0)*mn4R+peakC.y); - AH1 hitMaxG=(peakC.x-mx4G)*ARcpH1(AH1_(4.0)*mn4G+peakC.y); - AH1 hitMaxB=(peakC.x-mx4B)*ARcpH1(AH1_(4.0)*mn4B+peakC.y); + AH1 hitMinR=min(mn4R,eR)*ARcpH1(AH1_(4.0)*mx4R); + AH1 hitMinG=min(mn4G,eG)*ARcpH1(AH1_(4.0)*mx4G); + AH1 hitMinB=min(mn4B,eB)*ARcpH1(AH1_(4.0)*mx4B); + AH1 hitMaxR=(peakC.x-max(mx4R,eR))*ARcpH1(AH1_(4.0)*mn4R+peakC.y); + AH1 hitMaxG=(peakC.x-max(mx4G,eG))*ARcpH1(AH1_(4.0)*mn4G+peakC.y); + AH1 hitMaxB=(peakC.x-max(mx4B,eB))*ARcpH1(AH1_(4.0)*mn4B+peakC.y); AH1 lobeR=max(-hitMinR,hitMaxR); AH1 lobeG=max(-hitMinG,hitMaxG); AH1 lobeB=max(-hitMinB,hitMaxB); @@ -963,12 +963,12 @@ AF1 sharpness){ // Immediate constants for peak range. AH2 peakC=AH2(1.0,-1.0*4.0); // Limiters, these need to be high precision RCPs. - AH2 hitMinR=mn4R*ARcpH2(AH2_(4.0)*mx4R); - AH2 hitMinG=mn4G*ARcpH2(AH2_(4.0)*mx4G); - AH2 hitMinB=mn4B*ARcpH2(AH2_(4.0)*mx4B); - AH2 hitMaxR=(peakC.x-mx4R)*ARcpH2(AH2_(4.0)*mn4R+peakC.y); - AH2 hitMaxG=(peakC.x-mx4G)*ARcpH2(AH2_(4.0)*mn4G+peakC.y); - AH2 hitMaxB=(peakC.x-mx4B)*ARcpH2(AH2_(4.0)*mn4B+peakC.y); + AH2 hitMinR=min(mn4R,eR)*ARcpH2(AH2_(4.0)*mx4R); + AH2 hitMinG=min(mn4G,eG)*ARcpH2(AH2_(4.0)*mx4G); + AH2 hitMinB=min(mn4B,eB)*ARcpH2(AH2_(4.0)*mx4B); + AH2 hitMaxR=(peakC.x-max(mx4R,eR))*ARcpH2(AH2_(4.0)*mn4R+peakC.y); + AH2 hitMaxG=(peakC.x-max(mx4G,eG))*ARcpH2(AH2_(4.0)*mn4G+peakC.y); + AH2 hitMaxB=(peakC.x-max(mx4B,eB))*ARcpH2(AH2_(4.0)*mn4B+peakC.y); AH2 lobeR=max(-hitMinR,hitMaxR); AH2 lobeG=max(-hitMinG,hitMaxG); AH2 lobeB=max(-hitMinB,hitMaxB); diff --git a/readme.md b/readme.md index 5b455c5..e37b01e 100644 --- a/readme.md +++ b/readme.md @@ -39,8 +39,10 @@ To build the FSR sample, please follow the following instructions: 1) Install the following tools: - [CMake 3.16](https://cmake.org/download/) +- Install the "Desktop Development with C++" workload - [Visual Studio 2019](https://visualstudio.microsoft.com/downloads/) - [Windows 10 SDK 10.0.18362.0](https://developer.microsoft.com/en-us/windows/downloads/windows-10-sdk) +- [Git 2.32.0](https://git-scm.com/downloads) 2) Generate the solutions: ``` diff --git a/sample/src/DX12/FSRSample.cpp b/sample/src/DX12/FSRSample.cpp index f773454..76d7db2 100644 --- a/sample/src/DX12/FSRSample.cpp +++ b/sample/src/DX12/FSRSample.cpp @@ -31,9 +31,9 @@ FSRSample::FSRSample(LPCSTR name) : FrameworkWindows(name) m_bPlay = true; m_pGltfLoader = NULL; - mipBias[0] = -0.3f; - mipBias[1] = -0.5f; - mipBias[2] = -0.7f; + mipBias[0] = -0.38f; + mipBias[1] = -0.585f; + mipBias[2] = -0.75f; mipBias[3] = -1.0f; mipBias[4] = 0.0f; } @@ -692,7 +692,7 @@ void FSRSample::BuildUI() m_swapChain.SetVSync(m_VsyncEnabled); ImGui::Spacing(); ImGui::Spacing(); - const char* fullscreenModes[] = { "Windowed", "BorderlessFullscreen", "ExclusiveFulscreen" }; + const char* fullscreenModes[] = { "Windowed", "BorderlessFullscreen", "ExclusiveFullscreen" }; if (ImGui::Combo("Fullscreen Mode", (int*)&m_fullscreenMode, fullscreenModes, _countof(fullscreenModes))) { if (m_previousFullscreenMode != m_fullscreenMode) @@ -917,7 +917,7 @@ int WINAPI WinMain(HINSTANCE hInstance, LPSTR lpCmdLine, int nCmdShow) { - LPCSTR Name = "FidelityFX Super Resolution 1.0"; + LPCSTR Name = "FidelityFX Super Resolution 1.0.2"; // create new DX sample return RunFramework(hInstance, lpCmdLine, nCmdShow, new FSRSample(Name)); diff --git a/sample/src/VK/FSRSample.cpp b/sample/src/VK/FSRSample.cpp index 73918f8..3b73209 100644 --- a/sample/src/VK/FSRSample.cpp +++ b/sample/src/VK/FSRSample.cpp @@ -30,9 +30,9 @@ FSRSample::FSRSample(LPCSTR name) : FrameworkWindows(name) m_bPlay = true; m_pGltfLoader = NULL; - mipBias[0] = -0.3f; - mipBias[1] = -0.5f; - mipBias[2] = -0.7f; + mipBias[0] = -0.38f; + mipBias[1] = -0.585f; + mipBias[2] = -0.75f; mipBias[3] = -1.0f; mipBias[4] = 0.0f; } @@ -718,7 +718,7 @@ void FSRSample::BuildUI() } ImGui::Spacing(); ImGui::Spacing(); - const char* fullscreenModes[] = { "Windowed", "BorderlessFullscreen", "ExclusiveFulscreen" }; + const char* fullscreenModes[] = { "Windowed", "BorderlessFullscreen", "ExclusiveFullscreen" }; if (ImGui::Combo("Fullscreen Mode", (int*)&m_fullscreenMode, fullscreenModes, _countof(fullscreenModes))) { if (m_previousFullscreenMode != m_fullscreenMode) @@ -945,7 +945,7 @@ int WINAPI WinMain(HINSTANCE hInstance, LPSTR lpCmdLine, int nCmdShow) { - LPCSTR Name = "FidelityFX Super Resolution 1.0"; + LPCSTR Name = "FidelityFX Super Resolution 1.0.2"; // create new Vulkan sample return RunFramework(hInstance, lpCmdLine, nCmdShow, new FSRSample(Name)); diff --git a/sample/src/VK/FSR_Pass.hlsl b/sample/src/VK/FSR_Pass.hlsl index a34444d..87cc27b 100644 --- a/sample/src/VK/FSR_Pass.hlsl +++ b/sample/src/VK/FSR_Pass.hlsl @@ -62,7 +62,7 @@ #endif #if SAMPLE_RCAS #define FSR_RCAS_H - AH4 FsrRcasLoadH(ASW2 p) { return InputTexture.Load(ASW3(ASW2(p), 0)); } + AH4 FsrRcasLoadH(ASW2 p) { return (AH4)InputTexture.Load(ASW3(ASW2(p), 0)); } void FsrRcasInputH(inout AH1 r,inout AH1 g,inout AH1 b){} #endif #endif