Skip to content

Commit

Permalink
water foam fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ThirteenAG committed Nov 6, 2024
1 parent a0cce46 commit 783d4cf
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 9 deletions.
1 change: 1 addition & 0 deletions data/plugins/GTAIV.EFLC.FusionFix.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions source/fixes.ixx
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
4 changes: 2 additions & 2 deletions source/settings.ixx
Original file line number Diff line number Diff line change
Expand Up @@ -427,15 +427,15 @@ public:
enum eShadowFilterText {
eRadio, eSequential, eShuffle, eSharp, eSoft, eCHSS
};
std::vector<const char*> data = { "Radio", "Sequential", "Shuffle", "Sharp", "Soft", "CHSS",};
std::vector<const char*> data = { "Radio", "Sequential", "Shuffle", "Sharp", "Soft", "CHSS" };
} ShadowFilterText;

struct
{
enum eDofText {
eAuto, e43, e54, e159, e169, eOff, eCutscenesOnly, eLow, eMedium, eHigh, eVeryHigh
};
std::vector<const char*> data = { "Auto", "4:3", "5:4", "15:9", "16:9", "Off", "Cutscenes Only", "Low", "Medium", "High", "Very High"};
std::vector<const char*> data = { "Auto", "4:3", "5:4", "15:9", "16:9", "Off", "Cutscenes Only", "Low", "Medium", "High", "Very High" };
} DofText;

struct
Expand Down
5 changes: 4 additions & 1 deletion source/shaders.ixx
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ public:

static int nForceShadowFilter = 0;

static bool bSmoothShorelines = true;

FusionFix::onInitEvent() += []()
{
CIniReader iniReader("");
Expand All @@ -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");
Expand Down Expand Up @@ -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<float>(gamma->get());
arr3[3] = static_cast<float>(mblur->get());
pDevice->SetPixelShaderConstantF(222, &arr3[0], 1);
Expand Down

0 comments on commit 783d4cf

Please sign in to comment.