Add sharpening fix
This commit is contained in:
@@ -31,9 +31,11 @@ static bool HUD_fix_enabled = false;
|
||||
static bool camera_fix_enabled = false;
|
||||
static bool DOF_fix_enabled = false;
|
||||
static bool vignetting_fix_enabled = false;
|
||||
static bool sharpening_fix_enabled = false;
|
||||
static bool fix_enabled = false;
|
||||
static int worldFOVvalue = 0;
|
||||
static float cameraDistancevalue = 1.f;
|
||||
static float sharpeningvalue = 1.f;
|
||||
static int HUDvalue = 0;
|
||||
static int triggerDelayMs = 2000; // Default delay between shortcuts
|
||||
|
||||
@@ -45,7 +47,7 @@ static std::string log_content;
|
||||
// Plugin settings
|
||||
const std::string SETTINGS_FILE = "./pluginsettings.ini";
|
||||
const char* FIX_VERSION = "1.0.4";
|
||||
const char* FIX_INFORMATIONS = "This fix allows to:\n - Control FOV in game.\n - Control camera distance.\n - Enable ultrawide.\n - Control HUD scaling.\n - Disable depth of field in cutscenes.\n - Disable vignetting.";
|
||||
const char* FIX_INFORMATIONS = "This fix allows to:\n - Control FOV in game.\n - Control camera distance.\n - Enable ultrawide.\n - Control HUD scaling.\n - Disable depth of field in cutscenes.\n - Disable vignetting.\n - Control image sharpening.";
|
||||
const char* DONATION_URL = "https://buymeacoffee.com/k4sh44";
|
||||
|
||||
// Scaling factor based on screen resolution
|
||||
@@ -56,15 +58,16 @@ static FixToggle individualFixes[] = {
|
||||
{ "FOV", &fov_fix_enabled, GameFixes::FOV },
|
||||
{ "Depth of field", &DOF_fix_enabled, GameFixes::DOF },
|
||||
{ "Vignetting", &vignetting_fix_enabled, GameFixes::Vignetting },
|
||||
{ "Sharpening", &sharpening_fix_enabled, GameFixes::Sharpening, "This fix will override game setting."},
|
||||
{ "Ultrawide", &ultrawide_fix_enabled, GameFixes::UltraWide, "This fix targets aspect ratios wider than 32:9.\n"
|
||||
"It forces the engine to redraw the aspect by simulating shortcuts.\n"
|
||||
"Use the threshold slider below to fine tune the delay between simulated shortcuts.\n"
|
||||
"Use the slider below to fine tune the delay between simulated shortcuts.\n"
|
||||
"Increase the delay on slower PCs, decrease it on faster ones."},
|
||||
{ "HUD", &HUD_fix_enabled, GameFixes::HUD },
|
||||
{ "HUD", &HUD_fix_enabled, GameFixes::HUD, "Use this fix to reposition HUD for ultrawide displays."},
|
||||
{ "Camera", &camera_fix_enabled, GameFixes::Camera } };
|
||||
|
||||
// Prepare array of sliders for ImGui
|
||||
static SliderFix2 sliders[4];
|
||||
static SliderFix2 sliders[5];
|
||||
|
||||
// Load and unload game core dll functions /!\ necessary
|
||||
static void LoadFixDLL(reshade::api::effect_runtime* runtime) {
|
||||
@@ -89,6 +92,7 @@ static void LoadFixDLL(reshade::api::effect_runtime* runtime) {
|
||||
SetValues(GameSetting::FOV, worldFOVvalue);
|
||||
SetValues(GameSetting::HUD, HUDvalue);
|
||||
SetValues(GameSetting::CameraDistance, cameraDistancevalue);
|
||||
SetValues(GameSetting::Sharpening, sharpeningvalue);
|
||||
}
|
||||
if (SetFixEnabled) SetFixEnabled(fix_enabled, true);
|
||||
if (SetFixes) {
|
||||
@@ -97,14 +101,16 @@ static void LoadFixDLL(reshade::api::effect_runtime* runtime) {
|
||||
SetFixes(GameFixes::Camera, camera_fix_enabled);
|
||||
SetFixes(GameFixes::DOF, DOF_fix_enabled);
|
||||
SetFixes(GameFixes::Vignetting, vignetting_fix_enabled);
|
||||
SetFixes(GameFixes::Sharpening, sharpening_fix_enabled);
|
||||
}
|
||||
|
||||
sliders[0] = { "In game additional FOV", "##FOVValue", SliderType::Int, &worldFOVvalue, -20, 50, GameSetting::FOV, SetValues };
|
||||
sliders[1] = { "HUD scaling", "##HUDValue", SliderType::Int, &HUDvalue, -20, 40, GameSetting::HUD, SetValues };
|
||||
sliders[2] = { "Camera distance", "##CamValue", SliderType::Float, &cameraDistancevalue, 0, 5, GameSetting::CameraDistance, SetValues, "%.1f",
|
||||
sliders[2] = { "Sharpening value", "##SharpeningValue", SliderType::Float, &sharpeningvalue, 0, 1.5, GameSetting::Sharpening, SetValues, "%.1f" };
|
||||
sliders[3] = { "Camera distance", "##CamValue", SliderType::Float, &cameraDistancevalue, 0, 5, GameSetting::CameraDistance, SetValues, "%.1f",
|
||||
"Value is a multiplier.\nFinal value reported below is in meters."};
|
||||
sliders[3] = { "Ultrawide enforce delay", "##AltEnterValue", SliderType::Int, &triggerDelayMs, 1000, 5000, GameSetting::Threshold, SetValues, "",
|
||||
"This value is a threshold in ms between the simulated alt + enter." };
|
||||
sliders[4] = { "Ultrawide enforce delay", "##AltEnterValue", SliderType::Int, &triggerDelayMs, 1000, 5000, GameSetting::Threshold, SetValues, "",
|
||||
"This value is a delay in ms between the simulated shortcuts to enforce aspect ratio on launch." };
|
||||
}
|
||||
}
|
||||
|
||||
@@ -124,10 +130,12 @@ static void SaveSettings() {
|
||||
pluginIniFile["2#Individual fix"]["Camera"] = camera_fix_enabled;
|
||||
pluginIniFile["2#Individual fix"]["DOF"] = DOF_fix_enabled;
|
||||
pluginIniFile["2#Individual fix"]["Vignetting"] = vignetting_fix_enabled;
|
||||
pluginIniFile["2#Individual fix"]["Sharpening"] = sharpening_fix_enabled;
|
||||
pluginIniFile["3#Fixes tuning"].setComment("Individual fix fine tune");
|
||||
pluginIniFile["3#Fixes tuning"]["World FOV"] = worldFOVvalue;
|
||||
pluginIniFile["3#Fixes tuning"]["HUD scaling"] = HUDvalue;
|
||||
pluginIniFile["3#Fixes tuning"]["Camera distance"] = cameraDistancevalue;
|
||||
pluginIniFile["3#Fixes tuning"]["Sharpening value"] = sharpeningvalue;
|
||||
|
||||
pluginIniFile.save(SETTINGS_FILE);
|
||||
}
|
||||
@@ -144,9 +152,11 @@ static void LoadSettings() {
|
||||
camera_fix_enabled = pluginIniFile["2#Individual fix"]["Camera"].as<bool>();
|
||||
DOF_fix_enabled = pluginIniFile["2#Individual fix"]["DOF"].as<bool>();
|
||||
vignetting_fix_enabled = pluginIniFile["2#Individual fix"]["Vignetting"].as<bool>();
|
||||
sharpening_fix_enabled = pluginIniFile["2#Individual fix"]["Sharpening"].as<bool>();
|
||||
worldFOVvalue = pluginIniFile["3#Fixes tuning"]["World FOV"].as<int>();
|
||||
HUDvalue = pluginIniFile["3#Fixes tuning"]["HUD scaling"].as<int>();
|
||||
cameraDistancevalue = pluginIniFile["3#Fixes tuning"]["Camera distance"].as<float>();
|
||||
sharpeningvalue = pluginIniFile["3#Fixes tuning"]["Sharpening value"].as<float>();
|
||||
}
|
||||
catch (const std::exception& e) {}
|
||||
}
|
||||
@@ -219,9 +229,9 @@ static void on_overlay_draw(reshade::api::effect_runtime* runtime) {
|
||||
ImGui::TableNextRow();
|
||||
|
||||
ImGui::TableSetColumnIndex(0);
|
||||
for (int i = 0; i < 3; ++i) DrawFixCheckbox(individualFixes[i]);
|
||||
for (int i = 0; i < 4; ++i) DrawFixCheckbox(individualFixes[i]);
|
||||
ImGui::TableSetColumnIndex(1);
|
||||
for (int i = 3; i < IM_ARRAYSIZE(individualFixes); ++i) DrawFixCheckbox(individualFixes[i]);
|
||||
for (int i = 4; i < IM_ARRAYSIZE(individualFixes); ++i) DrawFixCheckbox(individualFixes[i]);
|
||||
|
||||
ImGui::EndTable();
|
||||
}
|
||||
@@ -233,9 +243,9 @@ static void on_overlay_draw(reshade::api::effect_runtime* runtime) {
|
||||
if (ImGui::BeginTable("FixesSliders", 2, ImGuiTableFlags_SizingStretchSame)) {
|
||||
ImGui::TableNextRow();
|
||||
ImGui::TableSetColumnIndex(0);
|
||||
for (int i = 0; i < 2; ++i) DrawSlider2(sliders[i], 200);
|
||||
for (int i = 0; i < 3; ++i) DrawSlider2(sliders[i], 200);
|
||||
ImGui::TableSetColumnIndex(1);
|
||||
for (int i = 2; i < 4; ++i) DrawSlider2(sliders[i], 200);
|
||||
for (int i = 3; i < 5; ++i) DrawSlider2(sliders[i], 200);
|
||||
ImGui::EndTable();
|
||||
}
|
||||
ImGui::PopStyleVar();
|
||||
|
||||
Reference in New Issue
Block a user