From a4bd523dbf1512a3e4c84938669de0349a887426 Mon Sep 17 00:00:00 2001 From: ElTioRata Date: Wed, 23 Oct 2024 09:13:24 -0300 Subject: [PATCH 01/12] Spanish localization fixes (#630) --- text/spanishFF.txt | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/text/spanishFF.txt b/text/spanishFF.txt index 3427693c..ffdc3e7a 100644 --- a/text/spanishFF.txt +++ b/text/spanishFF.txt @@ -11,7 +11,7 @@ Ventana Ventana sin bordes [Focus Loss] -Juego en pausa al cambiar de ventana +Pausar en segundo plano [LightSyncRGB] Logitech LightSync RGB @@ -20,10 +20,10 @@ Logitech LightSync RGB Contador de FPS [Letterbox] -Caja de texto en escenas +Barras horizontales en escenas [Pillarbox] -Caja de pilar en escenas +Barras laterales en escenas [Alt. Dialogues] Diálogos alternativos @@ -32,7 +32,7 @@ Diálogos alternativos Buscar actualizaciones de Fusion Fix [Raw Input] -Entrada simple +Entrada directa [Always Run] Correr siempre @@ -41,7 +41,7 @@ Correr siempre Centrar cámara al cubrirse [Centering Delay] -Posponer centralización cámara +Demora al centrar cámara [Gamepad Icons] Iconos del mando @@ -50,7 +50,7 @@ Iconos del mando Desenfoque de movimiento [Bloom] -Efecto bloom +Resplandor [Console Gamma] Gamma de consola @@ -68,7 +68,7 @@ Iluminación de árboles Rayos solares [Antialiasing] -Anti-aliasing +Suavizado de líneas [FPS Limiter] Limitador de FPS @@ -77,13 +77,13 @@ Limitador de FPS Sombras de farolas [Tree Alpha] -Transparencia de los árboles +Transparencia de árboles [Shadow Filter] Filtro de sombras [HeadlightShadow] -Sombras de los faros +Sombras de faros [FF_WARN0] ~p~Archivos IMG: @@ -95,13 +95,13 @@ Sombras de los faros ~r~ATENCIÓN: Las sombras de farolas pueden causar errores visuales y problemas de rendimiento. [FF_WARN3] -~r~ATENCIÓN: El valor de Distancia visible superior a 25 y el de Detalle de distancia superior a 31 pueden causar "pop-in" en los objetos. +~r~ATENCIÓN: Los valores de distancia visible superiores a 25 y los valores de detalle de distancia superiores a 31 pueden causar que los objetos se dibujen bruscamente ("pop-in"). [FF_WARN4] -~r~ATENCIÓN: El valor de Distancia visible superior a 25 puede causar "pop-in" en los objetos. +~r~ATENCIÓN: Los valores de distancia visible superiores a 25 pueden causar que los objetos se dibujen bruscamente ("pop-in"). [FF_WARN5] -~r~ATENCIÓN: El valor de Detalle de distancia superior a 31 puede causar "pop-in" en los objetos. +~r~ATENCIÓN: Los valores de detalle de distancia superiores a 31 pueden causar que los objetos se dibujen bruscamente ("pop-in"). [DUMMY_l11] Dummy label. From 2d68e5114fd8dee6231e1738ebc7ea1f140f2b2d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 23 Oct 2024 15:13:34 +0300 Subject: [PATCH 02/12] Bump shaders/GTAIV.EFLC.FusionShaders in the submodules group (#640) Bumps the submodules group with 1 update: [shaders/GTAIV.EFLC.FusionShaders](https://github.com/Parallellines0451/GTAIV.EFLC.FusionShaders). Updates `shaders/GTAIV.EFLC.FusionShaders` from `1693b34` to `94d3b98` - [Release notes](https://github.com/Parallellines0451/GTAIV.EFLC.FusionShaders/releases) - [Commits](https://github.com/Parallellines0451/GTAIV.EFLC.FusionShaders/compare/1693b344b2ba65a6746d5a28493f448d0d665fa0...94d3b9811c260013c8284a8fec860501caea028f) --- updated-dependencies: - dependency-name: shaders/GTAIV.EFLC.FusionShaders dependency-type: direct:production dependency-group: submodules ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- shaders/GTAIV.EFLC.FusionShaders | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shaders/GTAIV.EFLC.FusionShaders b/shaders/GTAIV.EFLC.FusionShaders index 1693b344..94d3b981 160000 --- a/shaders/GTAIV.EFLC.FusionShaders +++ b/shaders/GTAIV.EFLC.FusionShaders @@ -1 +1 @@ -Subproject commit 1693b344b2ba65a6746d5a28493f448d0d665fa0 +Subproject commit 94d3b9811c260013c8284a8fec860501caea028f From 2f770d5a3c6cc6d38cfa45ebef9b2fe00dd17c45 Mon Sep 17 00:00:00 2001 From: sTc2201 <41953894+sTc2201@users.noreply.github.com> Date: Wed, 30 Oct 2024 15:11:12 +0100 Subject: [PATCH 03/12] some small updates (#644) * Partially hide mouse cursor when using a controller * Enable first person crosshair (annihilator, buzzard) for controllers * More framerate related "fixes" * some more shader module changes * More shadows module updates/changes * Fix compiler error --- data/plugins/GTAIV.EFLC.FusionFix.ini | 2 ++ source/fixes.ixx | 23 +++++++++++++++ source/frameratevigilante.ixx | 41 ++++++++++++++++++++++++++- source/shaders.ixx | 23 +++++++++++++++ source/shadows.ixx | 27 ++++++++++++++++++ 5 files changed, 115 insertions(+), 1 deletion(-) diff --git a/data/plugins/GTAIV.EFLC.FusionFix.ini b/data/plugins/GTAIV.EFLC.FusionFix.ini index efcb66a9..75e5a67a 100644 --- a/data/plugins/GTAIV.EFLC.FusionFix.ini +++ b/data/plugins/GTAIV.EFLC.FusionFix.ini @@ -11,6 +11,7 @@ ShadowBlendRange = 0.3 // controls the size of the cascad ForceShadowFilter = 0 // 0 : shadow filter tied to definition | 1 : force 4 sample filter | 2 : force 16 sample filter HighResolutionShadows = 0 // doubles cascaded shadowmap resolution, very GPU intensive HighResolutionNightShadows = 0 // increases night shadows resolution, extremely GPU intensive +bOverrideShadowMatrix = 1 // Do not touch this setting, for debug purposes only [SHADOWFILTERSHARP] // CE-like shadows ShadowSoftness = 1.5 // controls shadow blur @@ -43,6 +44,7 @@ FixAutoExposure = 1 // restores auto exposure from con TreeAlphaPC = 0.625 TreeAlphaConsole = 4.0 CoronaReflectionIntensity = 1.0 // controls intensity of coronas in reflections +ConsoleCarReflectionsAndDirt = 1 [BudgetedIV] VehicleBudget = 0 // may cause issues, set to e.g. 260000000 to increase budget limit diff --git a/source/fixes.ixx b/source/fixes.ixx index 7adc0b8c..653299d0 100644 --- a/source/fixes.ixx +++ b/source/fixes.ixx @@ -490,6 +490,29 @@ public: // } // } // } + + // HACK: Visually hide the mouse cursor when using a gamepad, doesn't actually disable the cursor so it might still interact with UI, also still shows in the start menu because...?? + { + auto pattern = hook::pattern("75 1B 83 3D ? ? ? ? ? 75 12 6A 00 E8"); + if (!pattern.empty()) + { + injector::WriteMemory(pattern.get_first(0), 0x840F, true); // jnz short -> jz long + injector::WriteMemory(pattern.get_first(2), (uintptr_t)hook::get_pattern("C6 05 ? ? ? ? ? 5F 5E 5D 5B 83 C4 2C C3", 7) - (uintptr_t)pattern.get_first(6), true); + injector::MakeNOP(pattern.get_first(6), 23, true); + } + } + + // Enable the "first person" reticle (Annihilator, Buzzard) on gamepads as well, this used to be a keyboard & mouse feature only. + { + auto pattern = hook::pattern("85 F6 0F 84 ? ? ? ? 80 BE ? ? ? ? ? 0F 84 ? ? ? ? 85 C9 0F 84"); + if (!pattern.empty()) + injector::MakeNOP(pattern.get_first(0), 21, true); + else + { + pattern = hook::pattern("8B 4C 24 24 85 C9 0F 84 ? ? ? ? 80 B9 ? ? ? ? ? 0F 84"); + injector::MakeNOP(pattern.get_first(0), 25, true); + } + } }; } } Fixes; \ No newline at end of file diff --git a/source/frameratevigilante.ixx b/source/frameratevigilante.ixx index ce6f37d6..7fea7969 100644 --- a/source/frameratevigilante.ixx +++ b/source/frameratevigilante.ixx @@ -51,7 +51,7 @@ public: }; injector::MakeInline(pattern.get_first(0), pattern.get_first(6)); } - pattern = hook::pattern("F3 0F 10 05 ? ? ? ? F3 0F 58 C1 F3 0F 11 05 ? ? ? ? EB 36"); + pattern = find_pattern("F3 0F 10 05 ? ? ? ? F3 0F 58 C1 F3 0F 11 05 ? ? ? ? EB 36", "F3 0F 10 05 ? ? ? ? F3 0F 58 05 ? ? ? ? F3 0F 11 05 ? ? ? ? EB 30"); if (!pattern.empty()) { static auto f1032790 = *pattern.get_first(4); @@ -75,6 +75,17 @@ public: } }; injector::MakeInline(pattern.get_first(0), pattern.get_first(8)); } + else + { + pattern = hook::pattern("F3 0F 59 05 ? ? ? ? F3 0F 59 05 ? ? ? ? F3 0F 58 05 ? ? ? ? F3 0F 11 05"); + struct LoadingTextSpeed2 + { + void operator()(injector::reg_pack& regs) + { + regs.xmm0.f32[0] *= (1000.0f) / 10.0f; + } + }; injector::MakeInline(pattern.get_first(0), pattern.get_first(8)); + } pattern = hook::pattern("F3 0F 58 0D ? ? ? ? 0F 5B C0 F3 0F 11 0D"); if (!pattern.empty()) @@ -87,6 +98,34 @@ public: } }; injector::MakeInline(pattern.get_first(0), pattern.get_first(8)); } + else + { + pattern = hook::pattern("F3 0F 58 05 ? ? ? ? F3 0F 2A 0D"); + struct LoadingTextSparks + { + void operator()(injector::reg_pack& regs) + { + regs.xmm0.f32[0] += (0.085f) / 5.0f; + } + }; injector::MakeInline(pattern.get_first(0), pattern.get_first(8)); + } + + // Slow down the "CD/busy spinner" at 60 FPS, will be slower below or faster above this framerate + pattern = find_pattern("F3 0F 58 05 ? ? ? ? 33 C0 A3 ? ? ? ? F3 0F 11 05", "F3 0F 58 15 ? ? ? ? 33 C0 F3 0F 11 15 ? ? ? ? A3 ? ? ? ? 8B 0D"); + if (!pattern.empty()) + { + struct CDSpinnerHook + { + void operator()(injector::reg_pack& regs) + { + regs.xmm2.f32[0] += (0.17453294f) / 3.0f; + } + }; injector::MakeInline(pattern.get_first(0), pattern.get_first(8)); + } + + // Slow down the cop blips at 60 FPS, will be slower below or faster above this framerate + pattern = find_pattern("6B C0 15 53 8B DA B9 ? ? ? ? 33 D2 F7 F1", "6B C0 15 C1 EA 05 53 8B DA 33 D2 B9"); + injector::WriteMemory(pattern.get_first(2), 7, true); }; } } FramerateVigilante; \ No newline at end of file diff --git a/source/shaders.ixx b/source/shaders.ixx index b6cb783c..bb057035 100644 --- a/source/shaders.ixx +++ b/source/shaders.ixx @@ -74,6 +74,7 @@ public: fSHADOWFILTERSOFTShadowBias = iniReader.ReadFloat("SHADOWFILTERSOFT", "ShadowBias", 8.0f); fShadowBlendRange = std::clamp(iniReader.ReadFloat("SHADOWS", "ShadowBlendRange", 0.3f), 0.0f, 1.0f); nForceShadowFilter = std::clamp(iniReader.ReadInteger("SHADOWS", "ForceShadowFilter", 0), 0, 2); + bool bConsoleCarReflectionsAndDirt = iniReader.ReadInteger("MISC", "ConsoleCarReflectionsAndDirt", 1) != 0; // Redirect path to one unified folder auto pattern = hook::pattern("8B 04 8D ? ? ? ? A3 ? ? ? ? 8B 44 24 04"); @@ -102,6 +103,28 @@ public: } }; injector::MakeInline(pattern.get_first(0), pattern.get_first(7)); } + + // Pass the correct value for gAmbientAmount to the rain shader (gta_rmptfx_gpurender). + // The Game reads the rain.* values in visualsettings.dat properly but then overrides them with custom values. + // This makes rain drops more visible, this was done in shader before but moved here instead. + { + auto pattern = find_pattern("F3 0F 10 05 ? ? ? ? 6A 10 8B D9 8B 4F 18 F3 0F 11 44 24 ? F3 0F 10 05", "F3 0F 10 05 ? ? ? ? 68 ? ? ? ? F3 0F 11 44 24 ? F3 0F 10 05 ? ? ? ? 50 F3 0F 11 44 24"); + if (!pattern.empty()) + { + injector::MakeNOP(pattern.get_first(0), 8, true); // rain.ambient (gAmbientAmount): 0.1 -> 0.4 + pattern = find_pattern("F3 0F 11 44 24 ? F3 0F 10 05 ? ? ? ? 68 ? ? ? ? FF 73 14 F3 0F 11 44 24", "F3 0F 11 44 24 ? F3 0F 10 05 ? ? ? ? 50 F3 0F 11 44 24 ? F3 0F 10 05 ? ? ? ? 8D 5F 14 53 F3 0F 11 44 24"); + injector::MakeNOP(pattern.get_first(0), 6, true); + } + } + + // Restore console car reflections and dirt level settings. Any car on console could have dirt when they would spawn while on PC some cars _always_ spawn fully cleaned. + if (bConsoleCarReflectionsAndDirt) + { + auto pattern = find_pattern("75 0C C7 87 ? ? ? ? ? ? ? ? EB 20 66 0F 6E C2 F3 0F E6 C0 C1 EA 1F F2 0F 58 04 D5", "75 0D 0F 57 C0 F3 0F 11 86 ? ? ? ? EB 18 85 D2 89 54 24 10 DB 44 24 10 7D 06 D8 05"); + injector::WriteMemory(pattern.get_first(0), 0xEB, true); + pattern = find_pattern("75 37 C7 47 ? ? ? ? ? C7 87 ? ? ? ? ? ? ? ? C7 87", "75 3A F3 0F 10 05 ? ? ? ? F3 0F 11 46 ? F3 0F 11 86"); + injector::MakeNOP(pattern.get_first(0), 2, true); + } }; FusionFix::onGameInitEvent() += []() diff --git a/source/shadows.ixx b/source/shadows.ixx index d5b06b90..f000d087 100644 --- a/source/shadows.ixx +++ b/source/shadows.ixx @@ -142,6 +142,7 @@ public: bool bOverrideCascadeRanges = iniReader.ReadInteger("SHADOWS", "OverrideCascadeRanges", 1) != 0; bool bHighResolutionShadows = iniReader.ReadInteger("SHADOWS", "HighResolutionShadows", 0) != 0; bHighResolutionNightShadows = iniReader.ReadInteger("SHADOWS", "HighResolutionNightShadows", 0) != 0; + bool bOverrideShadowMatrix = iniReader.ReadInteger("SHADOWS", "OverrideShadowMatrix", 1) != 0; if (bExtraDynamicShadows || bDynamicShadowForTrees) { @@ -302,6 +303,32 @@ public: } } } + + // Subtract shadow static bias directly in game code. Should this have an ini option...? + if (bOverrideShadowMatrix) + { + struct ShadowMatrix + { + float ShadowMatrix0; + float ShadowMatrix1; + float ShadowMatrix2; + float ShadowMatrix3; + }; + + auto pattern = find_pattern("F3 0F 10 14 85 ? ? ? ? F3 0F 10 0C 85 ? ? ? ? F3 0F 5C CA F3 0F 59 C8 F3 0F 58 CA F3 0F 11 0C B5", + "F3 0F 10 94 00 ? ? ? ? F3 0F 10 9C 00 ? ? ? ? 03 C0 F3 0F 5C DA F3 0F 5E D9 F3 0F 59 D8 F3 0F 58 DA F3 0F 11 1C BD"); + auto pShadowMatrix = *pattern.get_first(5); + + for (size_t i = 0; i < 4; i++) // low medium high veryhigh + { + injector::scoped_unprotect(&pShadowMatrix[i], sizeof(pShadowMatrix)); + + pShadowMatrix[i].ShadowMatrix0 = 0.0f; + pShadowMatrix[i].ShadowMatrix1 = 0.0f; + pShadowMatrix[i].ShadowMatrix2 = 0.0f; + pShadowMatrix[i].ShadowMatrix3 = 0.0f; + } + } }; } } Shadows; \ No newline at end of file From 62ad2907c52f27e8b25356b068448f6cc8c517ba Mon Sep 17 00:00:00 2001 From: ThirteenAG Date: Thu, 31 Oct 2024 01:47:05 +0800 Subject: [PATCH 04/12] changes for latest shaders --- data/plugins/GTAIV.EFLC.FusionFix.ini | 9 ++- .../TBoGT/common/data/frontend_menus.xml | 5 +- .../TLAD/common/data/frontend_menus.xml | 5 +- data/update/common/data/frontend_menus.xml | 5 +- shaders/GTAIV.EFLC.FusionShaders | 2 +- source/comvars.ixx | 1 + source/extrainfo.ixx | 11 ++++ source/fixes.ixx | 3 +- source/frameratevigilante.ixx | 59 ++++++++----------- source/settings.ixx | 4 +- source/shaders.ixx | 31 +++++++++- source/shadows.ixx | 4 +- text/americanFF.txt | 3 + 13 files changed, 94 insertions(+), 48 deletions(-) diff --git a/data/plugins/GTAIV.EFLC.FusionFix.ini b/data/plugins/GTAIV.EFLC.FusionFix.ini index 75e5a67a..656bc97b 100644 --- a/data/plugins/GTAIV.EFLC.FusionFix.ini +++ b/data/plugins/GTAIV.EFLC.FusionFix.ini @@ -10,8 +10,6 @@ OverrideCascadeRanges = 1 // increases shadow view distance ShadowBlendRange = 0.3 // controls the size of the cascade blending regions | [0.0; 1.0] ForceShadowFilter = 0 // 0 : shadow filter tied to definition | 1 : force 4 sample filter | 2 : force 16 sample filter HighResolutionShadows = 0 // doubles cascaded shadowmap resolution, very GPU intensive -HighResolutionNightShadows = 0 // increases night shadows resolution, extremely GPU intensive -bOverrideShadowMatrix = 1 // Do not touch this setting, for debug purposes only [SHADOWFILTERSHARP] // CE-like shadows ShadowSoftness = 1.5 // controls shadow blur @@ -21,6 +19,13 @@ ShadowBias = 5.0 // controls shadow bias, adjust ac ShadowSoftness = 3.0 // controls shadow blur ShadowBias = 8.0 // controls shadow bias, adjust according to softness +[SHADOWFILTERCHSS] // CHSS / PCSS +ShadowSoftness = 1.5 // controls minimum shadow blur +ShadowBias = 5.0 // controls shadow bias, adjust according to minimum softness +MaxSoftness = 10.0 // controls maximum shadow blur +LightSize = 500.0 // how quickly the maximum blur is reached +ExtraBias = 2.0 // extra bias for large penumbras + [NIGHTSHADOWS] // WARNING: enabling this option is not recommended VehicleNightShadows = 0 // 1: with Headlight Shadows option, casts vehicle night shadows and disables player shadow(to avoid bugs), without Headlight Shadows enables shadows cast by vehicles from artificial lights diff --git a/data/update/TBoGT/common/data/frontend_menus.xml b/data/update/TBoGT/common/data/frontend_menus.xml index 47a8b54b..7ead2722 100644 --- a/data/update/TBoGT/common/data/frontend_menus.xml +++ b/data/update/TBoGT/common/data/frontend_menus.xml @@ -388,6 +388,7 @@ + @@ -1110,7 +1111,7 @@ - + @@ -1164,7 +1165,7 @@ - + diff --git a/data/update/TLAD/common/data/frontend_menus.xml b/data/update/TLAD/common/data/frontend_menus.xml index 6bd9d5d3..0a3ebb52 100644 --- a/data/update/TLAD/common/data/frontend_menus.xml +++ b/data/update/TLAD/common/data/frontend_menus.xml @@ -464,6 +464,7 @@ + @@ -1183,7 +1184,7 @@ - + @@ -1210,7 +1211,7 @@ - + diff --git a/data/update/common/data/frontend_menus.xml b/data/update/common/data/frontend_menus.xml index 735a109e..31d6785b 100644 --- a/data/update/common/data/frontend_menus.xml +++ b/data/update/common/data/frontend_menus.xml @@ -318,6 +318,7 @@ + @@ -780,7 +781,7 @@ - + @@ -808,7 +809,7 @@ - + diff --git a/shaders/GTAIV.EFLC.FusionShaders b/shaders/GTAIV.EFLC.FusionShaders index 94d3b981..3c797ad4 160000 --- a/shaders/GTAIV.EFLC.FusionShaders +++ b/shaders/GTAIV.EFLC.FusionShaders @@ -1 +1 @@ -Subproject commit 94d3b9811c260013c8284a8fec860501caea028f +Subproject commit 3c797ad4baaefb353caac4c880edcdb3ce8751ba diff --git a/source/comvars.ixx b/source/comvars.ixx index 099aa505..d03f93ed 100644 --- a/source/comvars.ixx +++ b/source/comvars.ixx @@ -1050,6 +1050,7 @@ export bool bEnableSnow = false; export bool bEnableHall = false; export bool bFixAutoExposure = true; export bool bHeadlightShadows = false; +export bool bHighResolutionShadows = false; export inline LONG getWindowWidth() { diff --git a/source/extrainfo.ixx b/source/extrainfo.ixx index d74da0b4..cb320612 100644 --- a/source/extrainfo.ixx +++ b/source/extrainfo.ixx @@ -95,6 +95,17 @@ public: extra += FF_WARN5[0] ? FF_WARN5 : L"~r~WARNING: Detail Distance slider above 31 may cause object pop-in."; } + if (FusionFixSettings.Get("PREF_SHADOWFILTER") == FusionFixSettings.ShadowFilterText.eCHSS) + { + if (FusionFixSettings.Get("PREF_SHADOW_QUALITY") < 4) // Very High + { + extra += L"~n~"; + extra += L" "; + auto FF_WARN6 = CText::getText("FF_WARN6"); + extra += FF_WARN6[0] ? FF_WARN6 : L"~r~WARNING: CHSS only takes effect with Shadow Quality set to Very High."; + } + } + regs.eax = (uintptr_t)extra.c_str(); } }); diff --git a/source/fixes.ixx b/source/fixes.ixx index 653299d0..d18a0f2d 100644 --- a/source/fixes.ixx +++ b/source/fixes.ixx @@ -496,8 +496,9 @@ public: auto pattern = hook::pattern("75 1B 83 3D ? ? ? ? ? 75 12 6A 00 E8"); if (!pattern.empty()) { + auto ptr = (uintptr_t)hook::get_pattern("C6 05 ? ? ? ? ? 5F 5E 5D 5B 83 C4 2C C3", 7) - (uintptr_t)pattern.get_first(6); injector::WriteMemory(pattern.get_first(0), 0x840F, true); // jnz short -> jz long - injector::WriteMemory(pattern.get_first(2), (uintptr_t)hook::get_pattern("C6 05 ? ? ? ? ? 5F 5E 5D 5B 83 C4 2C C3", 7) - (uintptr_t)pattern.get_first(6), true); + injector::WriteMemory(pattern.get_first(2), ptr, true); injector::MakeNOP(pattern.get_first(6), 23, true); } } diff --git a/source/frameratevigilante.ixx b/source/frameratevigilante.ixx index 7fea7969..d72347b3 100644 --- a/source/frameratevigilante.ixx +++ b/source/frameratevigilante.ixx @@ -59,32 +59,10 @@ public: { void operator()(injector::reg_pack& regs) { - regs.xmm0.f32[0] = (*f1032790) / 10.0f; + regs.xmm0.f32[0] = *f1032790 * *CTimer::fTimeStep; + regs.xmm0.f32[0] += regs.xmm1.f32[0]; } - }; injector::MakeInline(pattern.get_first(0), pattern.get_first(8)); - } - - pattern = hook::pattern("F3 0F 59 05 ? ? ? ? F3 0F 59 05 ? ? ? ? F3 0F 59 05 ? ? ? ? F3 0F 58 05 ? ? ? ? F3 0F 11 05"); - if (!pattern.empty()) - { - struct LoadingTextSpeed2 - { - void operator()(injector::reg_pack& regs) - { - regs.xmm0.f32[0] *= (1000.0f) / 10.0f; - } - }; injector::MakeInline(pattern.get_first(0), pattern.get_first(8)); - } - else - { - pattern = hook::pattern("F3 0F 59 05 ? ? ? ? F3 0F 59 05 ? ? ? ? F3 0F 58 05 ? ? ? ? F3 0F 11 05"); - struct LoadingTextSpeed2 - { - void operator()(injector::reg_pack& regs) - { - regs.xmm0.f32[0] *= (1000.0f) / 10.0f; - } - }; injector::MakeInline(pattern.get_first(0), pattern.get_first(8)); + }; injector::MakeInline(pattern.get_first(0), pattern.get_first(12)); } pattern = hook::pattern("F3 0F 58 0D ? ? ? ? 0F 5B C0 F3 0F 11 0D"); @@ -94,7 +72,7 @@ public: { void operator()(injector::reg_pack& regs) { - regs.xmm1.f32[0] += (0.085f) / 10.0f; + regs.xmm1.f32[0] += 0.085f * *CTimer::fTimeStep; } }; injector::MakeInline(pattern.get_first(0), pattern.get_first(8)); } @@ -105,27 +83,42 @@ public: { void operator()(injector::reg_pack& regs) { - regs.xmm0.f32[0] += (0.085f) / 5.0f; + regs.xmm0.f32[0] += 0.085f * *CTimer::fTimeStep; } }; injector::MakeInline(pattern.get_first(0), pattern.get_first(8)); } - // Slow down the "CD/busy spinner" at 60 FPS, will be slower below or faster above this framerate - pattern = find_pattern("F3 0F 58 05 ? ? ? ? 33 C0 A3 ? ? ? ? F3 0F 11 05", "F3 0F 58 15 ? ? ? ? 33 C0 F3 0F 11 15 ? ? ? ? A3 ? ? ? ? 8B 0D"); + // CD/busy spinner + pattern = find_pattern("F3 0F 58 05 ? ? ? ? 33 C0 A3 ? ? ? ? F3 0F 11 05"); if (!pattern.empty()) { struct CDSpinnerHook { void operator()(injector::reg_pack& regs) { - regs.xmm2.f32[0] += (0.17453294f) / 3.0f; + regs.xmm0.f32[0] += *CTimer::fTimeStep * 5.0f; } }; injector::MakeInline(pattern.get_first(0), pattern.get_first(8)); } - // Slow down the cop blips at 60 FPS, will be slower below or faster above this framerate - pattern = find_pattern("6B C0 15 53 8B DA B9 ? ? ? ? 33 D2 F7 F1", "6B C0 15 C1 EA 05 53 8B DA 33 D2 B9"); - injector::WriteMemory(pattern.get_first(2), 7, true); + // Cop blips + static int CustomFrameCounter = 0; + pattern = hook::pattern("A1 ? ? ? ? 6B C0 15"); + if (!pattern.empty()) + injector::WriteMemory(pattern.get_first(1), &CustomFrameCounter, true); + + pattern = hook::pattern("FF 05 ? ? ? ? F3 0F 2C C0"); + if (!pattern.empty()) + { + static auto CounterHook = safetyhook::create_mid(pattern.get_first(), [](SafetyHookContext& regs) + { + static float accumulator = 0.0f; + accumulator += (*CTimer::fTimeStep / (1.0f / 30.0f)); + int increment = static_cast(accumulator); + CustomFrameCounter += increment; + accumulator -= increment; + }); + } }; } } FramerateVigilante; \ No newline at end of file diff --git a/source/settings.ixx b/source/settings.ixx index 7a8a09c4..a1108f45 100644 --- a/source/settings.ixx +++ b/source/settings.ixx @@ -425,9 +425,9 @@ public: struct { enum eShadowFilterText { - eRadio, eSequential, eShuffle, eSoft, eSharp + eRadio, eSequential, eShuffle, eSoft, eSharp, eCHSS }; - std::vector data = { "Radio", "Sequential", "Shuffle", "Soft", "Sharp", }; + std::vector data = { "Radio", "Sequential", "Shuffle", "Soft", "Sharp", "CHSS",}; } ShadowFilterText; struct diff --git a/source/shaders.ixx b/source/shaders.ixx index bb057035..348c8ee2 100644 --- a/source/shaders.ixx +++ b/source/shaders.ixx @@ -57,6 +57,12 @@ public: static float fSHADOWFILTERSOFTShadowSoftness = 3.0f; static float fSHADOWFILTERSOFTShadowBias = 8.0f; + static float fSHADOWFILTERCHSSShadowSoftness = 1.5f; + static float fSHADOWFILTERCHSSShadowBias = 5.0f; + static float fSHADOWFILTERCHSSMaxSoftness = 10.0f; + static float fSHADOWFILTERCHSSLightSize = 500.0f; + static float fSHADOWFILTERCHSSExtraBias = 2.0f; + static float fShadowBlendRange = 0.3f; static int nForceShadowFilter = 0; @@ -72,6 +78,13 @@ public: fSHADOWFILTERSHARPShadowBias = iniReader.ReadFloat("SHADOWFILTERSHARP", "ShadowBias", 5.0f); fSHADOWFILTERSOFTShadowSoftness = iniReader.ReadFloat("SHADOWFILTERSOFT", "ShadowSoftness", 3.0f); fSHADOWFILTERSOFTShadowBias = iniReader.ReadFloat("SHADOWFILTERSOFT", "ShadowBias", 8.0f); + + fSHADOWFILTERCHSSShadowSoftness = iniReader.ReadFloat("SHADOWFILTERCHSS", "ShadowSoftness", 1.5f); + fSHADOWFILTERCHSSShadowBias = iniReader.ReadFloat("SHADOWFILTERCHSS", "ShadowBias", 5.0f); + fSHADOWFILTERCHSSMaxSoftness = iniReader.ReadFloat("SHADOWFILTERCHSS", "MaxSoftness", 10.0f); + fSHADOWFILTERCHSSLightSize = iniReader.ReadFloat("SHADOWFILTERCHSS", "LightSize", 500.0f); + fSHADOWFILTERCHSSExtraBias = iniReader.ReadFloat("SHADOWFILTERCHSS", "ExtraBias", 2.0f); + fShadowBlendRange = std::clamp(iniReader.ReadFloat("SHADOWS", "ShadowBlendRange", 0.3f), 0.0f, 1.0f); nForceShadowFilter = std::clamp(iniReader.ReadInteger("SHADOWS", "ForceShadowFilter", 0), 0, 2); bool bConsoleCarReflectionsAndDirt = iniReader.ReadInteger("MISC", "ConsoleCarReflectionsAndDirt", 1) != 0; @@ -172,6 +185,7 @@ public: // Shadow Ini Settings { static float arr7[4]; + static float arr9[4]; static auto shadowFilter = FusionFixSettings.GetRef("PREF_SHADOWFILTER"); if (shadowFilter->get() == FusionFixSettings.ShadowFilterText.eSoft) @@ -179,16 +193,31 @@ public: arr7[0] = fSHADOWFILTERSOFTShadowSoftness; arr7[1] = fSHADOWFILTERSOFTShadowBias; } - else + else if (shadowFilter->get() == FusionFixSettings.ShadowFilterText.eSharp) { arr7[0] = fSHADOWFILTERSHARPShadowSoftness; arr7[1] = fSHADOWFILTERSHARPShadowBias; } + else //eCHSS + { + arr7[0] = fSHADOWFILTERCHSSShadowSoftness; + arr7[1] = fSHADOWFILTERCHSSShadowBias; + } arr7[2] = fShadowBlendRange; arr7[3] = bEnableSnow ? 1.0f : 0.0f; pDevice->SetPixelShaderConstantF(218, &arr7[0], 1); + + arr9[0] = bHighResolutionShadows ? fSHADOWFILTERCHSSMaxSoftness * 2.0f : fSHADOWFILTERCHSSMaxSoftness; + arr9[1] = bHighResolutionShadows ? fSHADOWFILTERCHSSLightSize * 2.0f : fSHADOWFILTERCHSSLightSize; + arr9[2] = fSHADOWFILTERCHSSExtraBias; + if (FusionFixSettings.Get("PREF_SHADOW_QUALITY") >= 4) // Very High + arr9[3] = shadowFilter->get() == FusionFixSettings.ShadowFilterText.eCHSS ? 1.0f : 0.0f; + else + arr9[3] = 0.0f; + + pDevice->SetPixelShaderConstantF(217, &arr9[0], 1); } // Shadow Quality diff --git a/source/shadows.ixx b/source/shadows.ixx index f000d087..a50fa75b 100644 --- a/source/shadows.ixx +++ b/source/shadows.ixx @@ -140,7 +140,7 @@ public: bExtraDynamicShadows = iniReader.ReadInteger("SHADOWS", "ExtraDynamicShadows", 1); bDynamicShadowForTrees = iniReader.ReadInteger("SHADOWS", "DynamicShadowForTrees", 1) != 0; bool bOverrideCascadeRanges = iniReader.ReadInteger("SHADOWS", "OverrideCascadeRanges", 1) != 0; - bool bHighResolutionShadows = iniReader.ReadInteger("SHADOWS", "HighResolutionShadows", 0) != 0; + bHighResolutionShadows = iniReader.ReadInteger("SHADOWS", "HighResolutionShadows", 0) != 0; bHighResolutionNightShadows = iniReader.ReadInteger("SHADOWS", "HighResolutionNightShadows", 0) != 0; bool bOverrideShadowMatrix = iniReader.ReadInteger("SHADOWS", "OverrideShadowMatrix", 1) != 0; @@ -321,7 +321,7 @@ public: for (size_t i = 0; i < 4; i++) // low medium high veryhigh { - injector::scoped_unprotect(&pShadowMatrix[i], sizeof(pShadowMatrix)); + injector::scoped_unprotect(&pShadowMatrix[i], sizeof(ShadowMatrix)); pShadowMatrix[i].ShadowMatrix0 = 0.0f; pShadowMatrix[i].ShadowMatrix1 = 0.0f; diff --git a/text/americanFF.txt b/text/americanFF.txt index 4c5ef310..c3a18550 100644 --- a/text/americanFF.txt +++ b/text/americanFF.txt @@ -103,5 +103,8 @@ Headlight Shadows [FF_WARN5] ~r~WARNING: Detail Distance slider above 31 may cause object pop-in. +[FF_WARN6] +~r~WARNING: CHSS only takes effect with Shadow Quality set to Very High. + [DUMMY_l11] Dummy label. \ No newline at end of file From 8149432fd186768a911d715a96fd3343986ffdfb Mon Sep 17 00:00:00 2001 From: Rene <97738487+ReneSchimmelpfennig@users.noreply.github.com> Date: Fri, 1 Nov 2024 11:45:22 +0100 Subject: [PATCH 05/12] Add German translation of [FF_WARN6] (#645) Translation of new menu item related to CHSS shadows --- text/germanFF.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/text/germanFF.txt b/text/germanFF.txt index ead84920..fda507e7 100644 --- a/text/germanFF.txt +++ b/text/germanFF.txt @@ -103,5 +103,8 @@ Scheinwerfer-Schatten [FF_WARN5] ~r~ACHTUNG: Bei Werten von über 31 für die Detaildistanz kann es zu Pop-in von Objekten kommen. +[FF_WARN6] +~r~ACHTUNG: CHSS bewirkt nur etwas, wenn die Schattenqualität auf "Sehr hoch" eingestellt ist. + [DUMMY_l11] Dummy label. From 5fd90d311cb43d4c0268d68a756d9e6a49d4b663 Mon Sep 17 00:00:00 2001 From: MarioSonic2987 Date: Fri, 1 Nov 2024 11:45:31 +0100 Subject: [PATCH 06/12] Add Spanish translation of [FF_WARN6] (#646) --- text/spanishFF.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/text/spanishFF.txt b/text/spanishFF.txt index ffdc3e7a..35b1e50a 100644 --- a/text/spanishFF.txt +++ b/text/spanishFF.txt @@ -103,5 +103,8 @@ Sombras de faros [FF_WARN5] ~r~ATENCIÓN: Los valores de detalle de distancia superiores a 31 pueden causar que los objetos se dibujen bruscamente ("pop-in"). +[FF_WARN6] +~r~ATENCIÓN: CHSS se activa solamente con la calidad de las sombras puesta en "Muy alta". + [DUMMY_l11] Dummy label. From e3eb1ec2565d459abaf9e94a08dabca1b67019a7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 1 Nov 2024 13:45:41 +0300 Subject: [PATCH 07/12] Bump shaders/GTAIV.EFLC.FusionShaders in the submodules group (#648) Bumps the submodules group with 1 update: [shaders/GTAIV.EFLC.FusionShaders](https://github.com/Parallellines0451/GTAIV.EFLC.FusionShaders). Updates `shaders/GTAIV.EFLC.FusionShaders` from `3c797ad` to `944398d` - [Release notes](https://github.com/Parallellines0451/GTAIV.EFLC.FusionShaders/releases) - [Commits](https://github.com/Parallellines0451/GTAIV.EFLC.FusionShaders/compare/3c797ad4baaefb353caac4c880edcdb3ce8751ba...944398d52bdab5e7b2e68bd904f280756d7d0366) --- updated-dependencies: - dependency-name: shaders/GTAIV.EFLC.FusionShaders dependency-type: direct:production dependency-group: submodules ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- shaders/GTAIV.EFLC.FusionShaders | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shaders/GTAIV.EFLC.FusionShaders b/shaders/GTAIV.EFLC.FusionShaders index 3c797ad4..944398d5 160000 --- a/shaders/GTAIV.EFLC.FusionShaders +++ b/shaders/GTAIV.EFLC.FusionShaders @@ -1 +1 @@ -Subproject commit 3c797ad4baaefb353caac4c880edcdb3ce8751ba +Subproject commit 944398d52bdab5e7b2e68bd904f280756d7d0366 From 4b58f7a2f8d5d4a9d65c2b9ee5752801df586a33 Mon Sep 17 00:00:00 2001 From: sTc2201 <41953894+sTc2201@users.noreply.github.com> Date: Fri, 1 Nov 2024 11:46:04 +0100 Subject: [PATCH 08/12] some updates/additions (#649) * Always enable health on reticle option * Update rain lighting values patch --- data/plugins/GTAIV.EFLC.FusionFix.ini | 1 + source/fixes.ixx | 42 +++++++++++++++++++++++++++ source/shaders.ixx | 29 +++++++++++++----- 3 files changed, 65 insertions(+), 7 deletions(-) diff --git a/data/plugins/GTAIV.EFLC.FusionFix.ini b/data/plugins/GTAIV.EFLC.FusionFix.ini index 656bc97b..ef8cc27a 100644 --- a/data/plugins/GTAIV.EFLC.FusionFix.ini +++ b/data/plugins/GTAIV.EFLC.FusionFix.ini @@ -50,6 +50,7 @@ TreeAlphaPC = 0.625 TreeAlphaConsole = 4.0 CoronaReflectionIntensity = 1.0 // controls intensity of coronas in reflections ConsoleCarReflectionsAndDirt = 1 +AlwaysDisplayHealthOnReticle = 1 [BudgetedIV] VehicleBudget = 0 // may cause issues, set to e.g. 260000000 to increase budget limit diff --git a/source/fixes.ixx b/source/fixes.ixx index d18a0f2d..f6268d3f 100644 --- a/source/fixes.ixx +++ b/source/fixes.ixx @@ -70,6 +70,8 @@ public: bool bDefaultCameraAngleInTLAD = iniReader.ReadInteger("MISC", "DefaultCameraAngleInTLAD", 0) != 0; bool bPedDeathAnimFixFromTBOGT = iniReader.ReadInteger("MISC", "PedDeathAnimFixFromTBOGT", 1) != 0; + bool bAlwaysDisplayHealthOnReticle = iniReader.ReadInteger("MISC", "AlwaysDisplayHealthOnReticle", 0) != 0; + //fix for zoom flag in tbogt if (nAimingZoomFix) { @@ -514,6 +516,46 @@ public: injector::MakeNOP(pattern.get_first(0), 25, true); } } + + // Always display the ped health on the reticle with free-aim while on foot, used to be a gamepad + multiplayer only feature (PC is always free-aim unless it's melee combat). + if (bAlwaysDisplayHealthOnReticle) + { + auto pattern = hook::pattern("80 3D ? ? ? ? ? 75 64 A1 ? ? ? ? 8B 0C 85"); + if (!pattern.empty()) + { + static auto loc_5C8E93 = (uintptr_t)pattern.get_first(0); + + pattern = hook::pattern("80 BB ? ? ? ? ? 74 61 56 57 E8"); + struct ReticleHealthHook + { + void operator()(injector::reg_pack& regs) + { + if (!(*(uint8_t*)(regs.ebx + 12941)) || !(*(uint8_t*)(regs.ebx + 12940))) + *(uintptr_t*)(regs.esp - 4) = loc_5C8E93; + } + }; injector::MakeInline(pattern.get_first(0), pattern.get_first(9)); + + pattern = hook::pattern("75 0C 38 83 ? ? ? ? 0F 84"); + injector::WriteMemory(pattern.get_first(0), 0xEB, true); + } + else + { + static auto loc_5C8E93 = (uintptr_t)hook::get_pattern("80 3D ? ? ? ? ? 75 6A A1 ? ? ? ? 8B 04 85"); + + pattern = hook::pattern("80 B9 ? ? ? ? ? 74 6D 56 57 E8"); + struct ReticleHealthHook + { + void operator()(injector::reg_pack& regs) + { + if (!(*(uint8_t*)(regs.ecx + 12941)) || !(*(uint8_t*)(regs.ecx + 12940))) + *(uintptr_t*)(regs.esp - 4) = loc_5C8E93; + } + }; injector::MakeInline(pattern.get_first(0), pattern.get_first(9)); + + pattern = hook::pattern("75 0C 38 86 ? ? ? ? 0F 84"); + injector::WriteMemory(pattern.get_first(0), 0xEB, true); + } + } }; } } Fixes; \ No newline at end of file diff --git a/source/shaders.ixx b/source/shaders.ixx index 348c8ee2..131ec4d6 100644 --- a/source/shaders.ixx +++ b/source/shaders.ixx @@ -117,16 +117,31 @@ public: }; injector::MakeInline(pattern.get_first(0), pattern.get_first(7)); } - // Pass the correct value for gAmbientAmount to the rain shader (gta_rmptfx_gpurender). - // The Game reads the rain.* values in visualsettings.dat properly but then overrides them with custom values. - // This makes rain drops more visible, this was done in shader before but moved here instead. + // Actually read the rain lighting settings in the visualsettings.dat { - auto pattern = find_pattern("F3 0F 10 05 ? ? ? ? 6A 10 8B D9 8B 4F 18 F3 0F 11 44 24 ? F3 0F 10 05", "F3 0F 10 05 ? ? ? ? 68 ? ? ? ? F3 0F 11 44 24 ? F3 0F 10 05 ? ? ? ? 50 F3 0F 11 44 24"); + auto pattern = hook::pattern("8D 44 24 2C 50 FF 33 F3 0F 11 44 24 ? 56 E8"); if (!pattern.empty()) { - injector::MakeNOP(pattern.get_first(0), 8, true); // rain.ambient (gAmbientAmount): 0.1 -> 0.4 - pattern = find_pattern("F3 0F 11 44 24 ? F3 0F 10 05 ? ? ? ? 68 ? ? ? ? FF 73 14 F3 0F 11 44 24", "F3 0F 11 44 24 ? F3 0F 10 05 ? ? ? ? 50 F3 0F 11 44 24 ? F3 0F 10 05 ? ? ? ? 8D 5F 14 53 F3 0F 11 44 24"); - injector::MakeNOP(pattern.get_first(0), 6, true); + injector::WriteMemory(pattern.get_first(3), 0x34, true); + pattern = hook::pattern("8D 44 24 2C 50 FF 73 04 F3 0F 11 44 24 ? 56 E8"); + injector::WriteMemory(pattern.get_first(3), 0x30, true); + pattern = hook::pattern("8D 44 24 2C 50 FF 73 08 F3 0F 11 44 24 ? 56 E8"); + injector::WriteMemory(pattern.get_first(3), 0x38, true); + pattern = hook::pattern("8D 44 24 2C 50 FF 73 0C F3 0F 11 44 24 ? 56 E8"); + injector::WriteMemory(pattern.get_first(3), 0x3C, true); + } + else + { + pattern = hook::pattern("F3 0F 10 05 ? ? ? ? 53 56 57 8B 7C 24 10 6A 05"); + injector::MakeNOP(pattern.get_first(0), 8, true); + pattern = hook::pattern("F3 0F 11 44 24 ? F3 0F 10 05 ? ? ? ? 68 ? ? ? ? F3 0F 11 44 24 ? F3 0F 10 05 ? ? ? ? 50"); + injector::MakeNOP(pattern.get_first(0), 14, true); + pattern = hook::pattern("F3 0F 11 44 24 ? F3 0F 10 05 ? ? ? ? 50 F3 0F 11 44 24 ? F3 0F 10 05 ? ? ? ? 8D 5F 14"); + injector::MakeNOP(pattern.get_first(0), 14, true); + pattern = hook::pattern("F3 0F 11 44 24 ? F3 0F 10 05 ? ? ? ? 8D 5F 14 53 F3 0F 11 44 24"); + injector::MakeNOP(pattern.get_first(0), 14, true); + pattern = hook::pattern("F3 0F 11 44 24 ? E8 ? ? ? ? 8B 0D ? ? ? ? 8B 56 10"); + injector::MakeNOP(pattern.get_first(0), 6, true); } } From a881a74d0d4cb0867287eb87ada3737c94c2a853 Mon Sep 17 00:00:00 2001 From: ThirteenAG Date: Fri, 1 Nov 2024 19:03:25 +0800 Subject: [PATCH 09/12] changes for latest shaders pt2 --- data/plugins/GTAIV.EFLC.FusionFix.ini | 3 ++- data/update/TBoGT/common/data/frontend_menus.xml | 4 ++-- data/update/TLAD/common/data/frontend_menus.xml | 4 ++-- data/update/common/data/frontend_menus.xml | 4 ++-- source/settings.ixx | 6 +++--- source/shaders.ixx | 12 +++++++----- 6 files changed, 18 insertions(+), 15 deletions(-) diff --git a/data/plugins/GTAIV.EFLC.FusionFix.ini b/data/plugins/GTAIV.EFLC.FusionFix.ini index ef8cc27a..ec6e1b61 100644 --- a/data/plugins/GTAIV.EFLC.FusionFix.ini +++ b/data/plugins/GTAIV.EFLC.FusionFix.ini @@ -7,7 +7,8 @@ ForceNoMemRestrict = 1 // forces -nomemrestrict commandli ExtraDynamicShadows = 2 // adds some missing shadows | 1: for fences and grates | 2: for fences, grates and vegetation DynamicShadowForTrees = 1 // replaces static tree shadows with dynamic ones OverrideCascadeRanges = 1 // increases shadow view distance and improves quality at lower settings -ShadowBlendRange = 0.3 // controls the size of the cascade blending regions | [0.0; 1.0] +ShadowSoftnessBlendRange = 0.3 // size of the cascade blur blending region | [0.0; 1.0] +ShadowBiasBlendRange = 0.3 // size of the cascade bias blending region, needs to be equal to or larger than softness blend | [0.0; 1.0] ForceShadowFilter = 0 // 0 : shadow filter tied to definition | 1 : force 4 sample filter | 2 : force 16 sample filter HighResolutionShadows = 0 // doubles cascaded shadowmap resolution, very GPU intensive diff --git a/data/update/TBoGT/common/data/frontend_menus.xml b/data/update/TBoGT/common/data/frontend_menus.xml index 7ead2722..8726322c 100644 --- a/data/update/TBoGT/common/data/frontend_menus.xml +++ b/data/update/TBoGT/common/data/frontend_menus.xml @@ -386,8 +386,8 @@ - - + + diff --git a/data/update/TLAD/common/data/frontend_menus.xml b/data/update/TLAD/common/data/frontend_menus.xml index 0a3ebb52..d6185377 100644 --- a/data/update/TLAD/common/data/frontend_menus.xml +++ b/data/update/TLAD/common/data/frontend_menus.xml @@ -462,8 +462,8 @@ - - + + diff --git a/data/update/common/data/frontend_menus.xml b/data/update/common/data/frontend_menus.xml index 31d6785b..ce61e96c 100644 --- a/data/update/common/data/frontend_menus.xml +++ b/data/update/common/data/frontend_menus.xml @@ -316,8 +316,8 @@ - - + + diff --git a/source/settings.ixx b/source/settings.ixx index a1108f45..beae6ecb 100644 --- a/source/settings.ixx +++ b/source/settings.ixx @@ -206,7 +206,7 @@ public: { 0, "PREF_TIMECYC", "MISC", "ScreenFilter", "MENU_DISPLAY_TIMECYC", 5, nullptr, TimecycText.eMO_DEF, std::distance(std::begin(TimecycText.data), std::end(TimecycText.data)) - 1 }, { 0, "PREF_WINDOWED", "MAIN", "Windowed", "", 0, nullptr, 0, 1 }, { 0, "PREF_DEFINITION", "MAIN", "Definition", "", 1, nullptr, 0, 1 }, - { 0, "PREF_SHADOWFILTER", "SHADOWS", "ShadowFilter", "MENU_DISPLAY_SHADOWFILTER", 5, nullptr, ShadowFilterText.eSoft, std::distance(std::begin(ShadowFilterText.data), std::end(ShadowFilterText.data)) - 1 }, + { 0, "PREF_SHADOWFILTER", "SHADOWS", "ShadowFilter", "MENU_DISPLAY_SHADOWFILTER", 3, nullptr, ShadowFilterText.eSharp, std::distance(std::begin(ShadowFilterText.data), std::end(ShadowFilterText.data)) - 1 }, { 0, "PREF_TREE_LIGHTING", "MISC", "TreeLighting", "MENU_DISPLAY_TREE_LIGHTING", 7, nullptr, TreeFxText.ePC, std::distance(std::begin(TreeFxText.data), std::end(TreeFxText.data)) - 1 }, { 0, "PREF_TCYC_DOF", "MISC", "DepthOfField", "MENU_DISPLAY_DOF", 7, nullptr, DofText.eOff, std::distance(std::begin(DofText.data), std::end(DofText.data)) - 1 }, { 0, "PREF_MOTIONBLUR", "MAIN", "MotionBlur", "", 0, nullptr, 0, 1 }, @@ -425,9 +425,9 @@ public: struct { enum eShadowFilterText { - eRadio, eSequential, eShuffle, eSoft, eSharp, eCHSS + eRadio, eSequential, eShuffle, eSharp, eSoft, eCHSS }; - std::vector data = { "Radio", "Sequential", "Shuffle", "Soft", "Sharp", "CHSS",}; + std::vector data = { "Radio", "Sequential", "Shuffle", "Sharp", "Soft", "CHSS",}; } ShadowFilterText; struct diff --git a/source/shaders.ixx b/source/shaders.ixx index 131ec4d6..84f90077 100644 --- a/source/shaders.ixx +++ b/source/shaders.ixx @@ -63,7 +63,8 @@ public: static float fSHADOWFILTERCHSSLightSize = 500.0f; static float fSHADOWFILTERCHSSExtraBias = 2.0f; - static float fShadowBlendRange = 0.3f; + static float fShadowSoftnessBlendRange = 0.3f; + static float fShadowBiasBlendRange = 0.3f; static int nForceShadowFilter = 0; @@ -85,7 +86,8 @@ public: fSHADOWFILTERCHSSLightSize = iniReader.ReadFloat("SHADOWFILTERCHSS", "LightSize", 500.0f); fSHADOWFILTERCHSSExtraBias = iniReader.ReadFloat("SHADOWFILTERCHSS", "ExtraBias", 2.0f); - fShadowBlendRange = std::clamp(iniReader.ReadFloat("SHADOWS", "ShadowBlendRange", 0.3f), 0.0f, 1.0f); + fShadowSoftnessBlendRange = std::clamp(iniReader.ReadFloat("SHADOWS", "ShadowSoftnessBlendRange", 0.3f), 0.0f, 1.0f); + 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; @@ -219,8 +221,8 @@ public: arr7[1] = fSHADOWFILTERCHSSShadowBias; } - arr7[2] = fShadowBlendRange; - arr7[3] = bEnableSnow ? 1.0f : 0.0f; + arr7[2] = (fShadowBiasBlendRange < fShadowSoftnessBlendRange) ? fShadowSoftnessBlendRange : fShadowBiasBlendRange; + arr7[3] = fShadowSoftnessBlendRange; pDevice->SetPixelShaderConstantF(218, &arr7[0], 1); @@ -296,7 +298,7 @@ public: arr5[0] = 1.0f; } - arr5[1] = 0.0f; + arr5[1] = bEnableSnow ? 1.0f : 0.0f; arr5[2] = 1.0f / (30.0f * Natives::Timestep()); arr5[3] = treealpha->get() == FusionFixSettings.TreeAlphaText.eConsole ? fTreeAlphaConsole : fTreeAlphaPC; pDevice->SetPixelShaderConstantF(221, &arr5[0], 1); From 25557383c9bafc207fd21ffd5d686f15a74923e6 Mon Sep 17 00:00:00 2001 From: ThirteenAG Date: Sat, 2 Nov 2024 11:55:39 +0800 Subject: [PATCH 10/12] update translations --- premake5.lua | 2 +- text/frenchFF.txt | 3 +++ text/italianFF.txt | 3 +++ text/japaneseFF.txt | 3 +++ text/russianFF.txt | 3 +++ 5 files changed, 13 insertions(+), 1 deletion(-) diff --git a/premake5.lua b/premake5.lua index c4f163bd..7dcb20c8 100644 --- a/premake5.lua +++ b/premake5.lua @@ -14,7 +14,7 @@ workspace "GTAIV.EFLC.FusionFix" language "C++" targetdir "bin/%{cfg.buildcfg}" targetextension ".asi" - buildoptions { "/dxifcInlineFunctions-" } + buildoptions { "/dxifcInlineFunctions- /Zc:__cplusplus /utf-8" } staticruntime "On" characterset ("Unicode") diff --git a/text/frenchFF.txt b/text/frenchFF.txt index eb1150b1..7761170f 100644 --- a/text/frenchFF.txt +++ b/text/frenchFF.txt @@ -103,5 +103,8 @@ Ombres des phares [FF_WARN5] ~r~AVERTISSEMENT : Une valeur de barre de distance de détail supérieure à 31 pourrait entraîner l'apparition d'objets. +[FF_WARN6] +~r~AVERTISSEMENT : CHSS ne fonctionne qu'avec la Qualité des Ombres réglée sur Très Élevée. + [DUMMY_l11] Dummy label. \ No newline at end of file diff --git a/text/italianFF.txt b/text/italianFF.txt index 58f57797..e896dcd2 100644 --- a/text/italianFF.txt +++ b/text/italianFF.txt @@ -103,5 +103,8 @@ Ombre dei fari [FF_WARN5] ~r~ATTENZIONE: un valore della barra Distanza dettaglio superiore a 31 potrebbe causare l'effetto pop-in degli oggetti. +[FF_WARN6] +~r~ATTENZIONE: CHSS ha effetto solo con la Qualità delle Ombre impostata su Molto Alta. + [DUMMY_l11] Dummy label. \ No newline at end of file diff --git a/text/japaneseFF.txt b/text/japaneseFF.txt index 27eb9a53..2c2be391 100644 --- a/text/japaneseFF.txt +++ b/text/japaneseFF.txt @@ -103,5 +103,8 @@ FPSリミッター [FF_WARN5] ~r~警告: 詳細距離スライダーを 31 より上にすると、オブジェクトがポップインする可能性があります。 +[FF_WARN6] +~r~警告: CHSS は影の品質を「最高」に設定した場合のみ有効になります。 + [DUMMY_l11] Dummy label. \ No newline at end of file diff --git a/text/russianFF.txt b/text/russianFF.txt index a9d58242..1887a48a 100644 --- a/text/russianFF.txt +++ b/text/russianFF.txt @@ -103,5 +103,8 @@ Fusion Fix: Проверять Обновления [FF_WARN5] ~r~ПРЕДУПРЕЖДЕНИЕ: Глубина детализации выше 31 негативно влияет на отображение объектов. +[FF_WARN6] +~r~ПРЕДУПРЕЖДЕНИЕ: CHSS работает только при настройке качества теней на «Очень высоко». + [DUMMY_l11] Dummy label. From 200ebcb4912bdc4dfbc4364225002b80098a57f8 Mon Sep 17 00:00:00 2001 From: ThirteenAG Date: Sat, 2 Nov 2024 11:56:25 +0800 Subject: [PATCH 11/12] update submodules --- shaders/GTAIV.EFLC.FusionShaders | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shaders/GTAIV.EFLC.FusionShaders b/shaders/GTAIV.EFLC.FusionShaders index 944398d5..c36e2ac3 160000 --- a/shaders/GTAIV.EFLC.FusionShaders +++ b/shaders/GTAIV.EFLC.FusionShaders @@ -1 +1 @@ -Subproject commit 944398d52bdab5e7b2e68bd904f280756d7d0366 +Subproject commit c36e2ac3d8b0d363ea2d1e920197d8da9d4db0da From f9ede9bdfae78cc2f4cf9014ac7d2b949afe46b5 Mon Sep 17 00:00:00 2001 From: ThirteenAG Date: Sat, 2 Nov 2024 15:04:33 +0800 Subject: [PATCH 12/12] radio fix --- source/fixes.ixx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/source/fixes.ixx b/source/fixes.ixx index f6268d3f..8f3d6070 100644 --- a/source/fixes.ixx +++ b/source/fixes.ixx @@ -556,6 +556,13 @@ public: injector::WriteMemory(pattern.get_first(0), 0xEB, true); } } + + // Radio reset fix + { + auto pattern = hook::pattern("74 ? 85 C9 75 ? 32 C0 50"); + if (!pattern.empty()) + injector::WriteMemory(pattern.get_first(0), 0xEB, true); // jz -> jmp + } }; } } Fixes; \ No newline at end of file