From 783d4cf6ab25d608566a20fbd47296c36621f0b1 Mon Sep 17 00:00:00 2001 From: ThirteenAG Date: Wed, 6 Nov 2024 20:06:15 +0800 Subject: [PATCH] water foam fix --- data/plugins/GTAIV.EFLC.FusionFix.ini | 1 + shaders/GTAIV.EFLC.FusionShaders | 2 +- source/fixes.ixx | 10 +++++----- source/settings.ixx | 4 ++-- source/shaders.ixx | 5 ++++- 5 files changed, 13 insertions(+), 9 deletions(-) diff --git a/data/plugins/GTAIV.EFLC.FusionFix.ini b/data/plugins/GTAIV.EFLC.FusionFix.ini index ec6e1b61..8583e502 100644 --- a/data/plugins/GTAIV.EFLC.FusionFix.ini +++ b/data/plugins/GTAIV.EFLC.FusionFix.ini @@ -52,6 +52,7 @@ TreeAlphaConsole = 4.0 CoronaReflectionIntensity = 1.0 // controls intensity of coronas in reflections ConsoleCarReflectionsAndDirt = 1 AlwaysDisplayHealthOnReticle = 1 +SmoothShorelines = 1 // improves water transparency [BudgetedIV] VehicleBudget = 0 // may cause issues, set to e.g. 260000000 to increase budget limit diff --git a/shaders/GTAIV.EFLC.FusionShaders b/shaders/GTAIV.EFLC.FusionShaders index 1a7823a7..9d4dd670 160000 --- a/shaders/GTAIV.EFLC.FusionShaders +++ b/shaders/GTAIV.EFLC.FusionShaders @@ -1 +1 @@ -Subproject commit 1a7823a76c84cbc24ed42ea0a86ea3ce9a96f0bf +Subproject commit 9d4dd67054622c9bc7fea6dc5ba1f6069c85ecc7 diff --git a/source/fixes.ixx b/source/fixes.ixx index 8f3d6070..93541fe4 100644 --- a/source/fixes.ixx +++ b/source/fixes.ixx @@ -424,11 +424,11 @@ public: } // Water Foam Height Weirdness - { - auto pattern = hook::pattern("F3 0F 58 0D ? ? ? ? 83 EC 08 F3 0F 59 05"); - if (!pattern.empty()) - injector::MakeNOP(pattern.get_first(0), 8, true); - } + //{ + // auto pattern = hook::pattern("F3 0F 58 0D ? ? ? ? 83 EC 08 F3 0F 59 05"); + // if (!pattern.empty()) + // injector::MakeNOP(pattern.get_first(0), 8, true); + //} // Render LOD lights during cutscenes (console behavior) { diff --git a/source/settings.ixx b/source/settings.ixx index beae6ecb..7c99acfa 100644 --- a/source/settings.ixx +++ b/source/settings.ixx @@ -427,7 +427,7 @@ public: enum eShadowFilterText { eRadio, eSequential, eShuffle, eSharp, eSoft, eCHSS }; - std::vector data = { "Radio", "Sequential", "Shuffle", "Sharp", "Soft", "CHSS",}; + std::vector data = { "Radio", "Sequential", "Shuffle", "Sharp", "Soft", "CHSS" }; } ShadowFilterText; struct @@ -435,7 +435,7 @@ public: enum eDofText { eAuto, e43, e54, e159, e169, eOff, eCutscenesOnly, eLow, eMedium, eHigh, eVeryHigh }; - std::vector data = { "Auto", "4:3", "5:4", "15:9", "16:9", "Off", "Cutscenes Only", "Low", "Medium", "High", "Very High"}; + std::vector data = { "Auto", "4:3", "5:4", "15:9", "16:9", "Off", "Cutscenes Only", "Low", "Medium", "High", "Very High" }; } DofText; struct diff --git a/source/shaders.ixx b/source/shaders.ixx index 84f90077..c4ae3916 100644 --- a/source/shaders.ixx +++ b/source/shaders.ixx @@ -68,6 +68,8 @@ public: static int nForceShadowFilter = 0; + static bool bSmoothShorelines = true; + FusionFix::onInitEvent() += []() { CIniReader iniReader(""); @@ -90,6 +92,7 @@ public: fShadowBiasBlendRange = std::clamp(iniReader.ReadFloat("SHADOWS", "ShadowBiasBlendRange", 0.3f), 0.0f, 1.0f); nForceShadowFilter = std::clamp(iniReader.ReadInteger("SHADOWS", "ForceShadowFilter", 0), 0, 2); bool bConsoleCarReflectionsAndDirt = iniReader.ReadInteger("MISC", "ConsoleCarReflectionsAndDirt", 1) != 0; + bSmoothShorelines = iniReader.ReadInteger("MISC", "SmoothShorelines", 1) != 0; // Redirect path to one unified folder auto pattern = hook::pattern("8B 04 8D ? ? ? ? A3 ? ? ? ? 8B 44 24 04"); @@ -310,7 +313,7 @@ public: static auto mblur = FusionFixSettings.GetRef("PREF_MOTIONBLUR"); static float arr3[4]; arr3[0] = (bFixAutoExposure ? 1.0f : 0.0f); - arr3[1] = 0.0f; + arr3[1] = (bSmoothShorelines ? 1.0f : 0.0f); arr3[2] = static_cast(gamma->get()); arr3[3] = static_cast(mblur->get()); pDevice->SetPixelShaderConstantF(222, &arr3[0], 1);