mirror of
https://github.com/optiscaler/OptiScaler.git
synced 2026-08-25 07:36:45 +00:00
sharpness changes
This commit is contained in:
@@ -21,9 +21,6 @@ void Config::Reload()
|
||||
|
||||
if (ini.LoadFile(absoluteFileName.c_str()) == SI_OK)
|
||||
{
|
||||
// Vulkan
|
||||
VulkanSpoofEnable = readBool("Vulkan", "NvidiaSpoofing");
|
||||
|
||||
// Upscalers
|
||||
Dx11Upscaler = readString("Upscalers", "Dx11Upscaler", true);
|
||||
Dx12Upscaler = readString("Upscalers", "Dx12Upscaler", true);
|
||||
@@ -56,11 +53,13 @@ void Config::Reload()
|
||||
else
|
||||
LogLevel = spdlog::level::off;
|
||||
|
||||
// Sharpness
|
||||
OverrideSharpness = readBool("Sharpness", "OverrideSharpness");
|
||||
Sharpness = readFloat("Sharpness", "Sharpness");
|
||||
|
||||
// CAS
|
||||
CasEnabled = readBool("CAS", "Enabled");
|
||||
CasOverrideSharpness = readBool("CAS", "OverrideSharpness");
|
||||
CasSharpness = readFloat("CAS", "Sharpness");
|
||||
ColorSpaceConversion = readInt("CAS", "ColorSpaceConversion");
|
||||
CasColorSpaceConversion = readInt("CAS", "ColorSpaceConversion");
|
||||
|
||||
// Depth
|
||||
DepthInverted = readBool("Depth", "DepthInverted");
|
||||
|
||||
+27
-5
@@ -2,6 +2,24 @@
|
||||
#include <optional>
|
||||
#include <filesystem>
|
||||
|
||||
typedef enum NVNGX_EngineType
|
||||
{
|
||||
NVNGX_ENGINE_TYPE_CUSTOM = 0,
|
||||
NVNGX_ENGINE_TYPE_UNREAL,
|
||||
NVNGX_ENGINE_TYPE_UNITY,
|
||||
NVNGX_ENGINE_TYPE_OMNIVERSE,
|
||||
NVNGX_ENGINE_COUNT
|
||||
} NVNGX_EngineType;
|
||||
|
||||
typedef enum GPU_Vendor
|
||||
{
|
||||
AMD = 0,
|
||||
NVIDIA,
|
||||
INTEL,
|
||||
OTHER,
|
||||
} GPU_Vendor;
|
||||
|
||||
|
||||
class Config
|
||||
{
|
||||
public:
|
||||
@@ -33,9 +51,11 @@ public:
|
||||
|
||||
// CAS
|
||||
std::optional<bool> CasEnabled;
|
||||
std::optional<int> ColorSpaceConversion;
|
||||
std::optional<bool> CasOverrideSharpness;
|
||||
std::optional<float> CasSharpness;
|
||||
std::optional<int> CasColorSpaceConversion;
|
||||
|
||||
//Sharpness
|
||||
std::optional<bool> OverrideSharpness;
|
||||
std::optional<float> Sharpness;
|
||||
|
||||
// Upscale Ratio Override
|
||||
std::optional<bool> UpscaleRatioOverrideEnabled;
|
||||
@@ -63,8 +83,10 @@ public:
|
||||
std::optional<std::string> Dx12Upscaler;
|
||||
std::optional<std::string> VulkanUpscaler;
|
||||
|
||||
// Vulkan
|
||||
std::optional<bool> VulkanSpoofEnable;
|
||||
// Engine Info
|
||||
NVNGX_EngineType NVNGX_Engine;
|
||||
const char* NVNGX_EngineVersion;
|
||||
const wchar_t* NVNGX_AppDataPath;
|
||||
|
||||
void Reload();
|
||||
|
||||
|
||||
+74
-12
@@ -81,35 +81,97 @@ inline NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_DLSS_GetOptimalSettingsCallback(NVS
|
||||
OutWidth = (unsigned int)((float)Width / 2.5);
|
||||
scalingRatio = 0.4f;
|
||||
break;
|
||||
|
||||
case NVSDK_NGX_PerfQuality_Value_MaxPerf:
|
||||
OutHeight = (unsigned int)((float)Height / 2.0);
|
||||
OutWidth = (unsigned int)((float)Width / 2.0);
|
||||
scalingRatio = 0.5f;
|
||||
break;
|
||||
|
||||
case NVSDK_NGX_PerfQuality_Value_Balanced:
|
||||
OutHeight = (unsigned int)((float)Height / 1.699215044247788);
|
||||
OutWidth = (unsigned int)((float)Width / 1.699215044247788);
|
||||
scalingRatio = 0.58850703f;
|
||||
//UE5 ratio fix
|
||||
if (Config::Instance()->NVNGX_Engine == NVNGX_ENGINE_TYPE_UNREAL &&
|
||||
strlen(Config::Instance()->NVNGX_EngineVersion) > 0 &&
|
||||
Config::Instance()->NVNGX_EngineVersion[0] == '5' &&
|
||||
Config::Instance()->Dx12Upscaler.value_or("xess") == "xess")
|
||||
{
|
||||
OutHeight = (unsigned int)((float)Height / 1.6666666667);
|
||||
OutWidth = (unsigned int)((float)Width / 1.6666666667);
|
||||
scalingRatio = 0.6f;
|
||||
}
|
||||
else
|
||||
{
|
||||
OutHeight = (unsigned int)((float)Height / 1.699215044247788);
|
||||
OutWidth = (unsigned int)((float)Width / 1.699215044247788);
|
||||
scalingRatio = 0.58850703f;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case NVSDK_NGX_PerfQuality_Value_MaxQuality:
|
||||
OutHeight = (unsigned int)((float)Height / 1.5);
|
||||
OutWidth = (unsigned int)((float)Width / 1.5);
|
||||
scalingRatio = 0.66666667f;
|
||||
//UE5 ratio fix
|
||||
if (Config::Instance()->NVNGX_Engine == NVNGX_ENGINE_TYPE_UNREAL &&
|
||||
strlen(Config::Instance()->NVNGX_EngineVersion) > 0 &&
|
||||
Config::Instance()->NVNGX_EngineVersion[0] == '5' &&
|
||||
Config::Instance()->Dx12Upscaler.value_or("xess") == "xess")
|
||||
{
|
||||
OutHeight = (unsigned int)((float)Height / 1.4285714286);
|
||||
OutWidth = (unsigned int)((float)Width / 1.4285714286);
|
||||
scalingRatio = 0.7f;
|
||||
}
|
||||
else
|
||||
{
|
||||
OutHeight = (unsigned int)((float)Height / 1.5);
|
||||
OutWidth = (unsigned int)((float)Width / 1.5);
|
||||
scalingRatio = 0.66666667f;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case NVSDK_NGX_PerfQuality_Value_UltraQuality:
|
||||
OutHeight = (unsigned int)((float)Height / 1.304347826086957);
|
||||
OutWidth = (unsigned int)((float)Width / 1.304347826086957);
|
||||
scalingRatio = 0.76666666f;
|
||||
//UE5 ratio fix
|
||||
if (Config::Instance()->NVNGX_Engine == NVNGX_ENGINE_TYPE_UNREAL &&
|
||||
strlen(Config::Instance()->NVNGX_EngineVersion) > 0 &&
|
||||
Config::Instance()->NVNGX_EngineVersion[0] == '5' &&
|
||||
Config::Instance()->Dx12Upscaler.value_or("xess") == "xess")
|
||||
{
|
||||
OutHeight = (unsigned int)((float)Height / 1.25);
|
||||
OutWidth = (unsigned int)((float)Width / 1.25);
|
||||
scalingRatio = 0.8f;
|
||||
}
|
||||
else
|
||||
{
|
||||
OutHeight = (unsigned int)((float)Height / 1.304347826086957);
|
||||
OutWidth = (unsigned int)((float)Width / 1.304347826086957);
|
||||
scalingRatio = 0.76666666f;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case NVSDK_NGX_PerfQuality_Value_DLAA:
|
||||
OutHeight = Height;
|
||||
OutWidth = Width;
|
||||
scalingRatio = 1.0f;
|
||||
break;
|
||||
|
||||
default:
|
||||
OutHeight = (unsigned int)((float)Height / 1.699215044247788);
|
||||
OutWidth = (unsigned int)((float)Width / 1.699215044247788);
|
||||
scalingRatio = 0.58850703f;
|
||||
//UE5 ratio fix
|
||||
if (Config::Instance()->NVNGX_Engine == NVNGX_ENGINE_TYPE_UNREAL &&
|
||||
strlen(Config::Instance()->NVNGX_EngineVersion) > 0 &&
|
||||
Config::Instance()->NVNGX_EngineVersion[0] == '5' &&
|
||||
Config::Instance()->Dx12Upscaler.value_or("xess") == "xess")
|
||||
{
|
||||
OutHeight = (unsigned int)((float)Height / 1.6666666667);
|
||||
OutWidth = (unsigned int)((float)Width / 1.6666666667);
|
||||
scalingRatio = 0.6f;
|
||||
}
|
||||
else
|
||||
{
|
||||
OutHeight = (unsigned int)((float)Height / 1.699215044247788);
|
||||
OutWidth = (unsigned int)((float)Width / 1.699215044247788);
|
||||
scalingRatio = 0.58850703f;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user