Skip to content

Commit

Permalink
update to upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
SandeMC committed Dec 28, 2024
2 parents 6d7943d + fa2f5d1 commit ae7b515
Show file tree
Hide file tree
Showing 12 changed files with 68 additions and 56 deletions.
Binary file not shown.
Binary file not shown.
8 changes: 4 additions & 4 deletions data/update/TBoGT/common/data/frontend_menus.xml
Original file line number Diff line number Diff line change
Expand Up @@ -393,10 +393,10 @@
<menupc enum="MENU_DISPLAY_DOF">
<options text="MO_OFF" action="ACTION_NONE" value="1" />
<options text="Cutscenes Only" action="ACTION_NONE" value="2" />
<options text="Low" action="ACTION_NONE" value="3" />
<options text="Medium" action="ACTION_NONE" value="4" />
<options text="High" action="ACTION_NONE" value="5" />
<options text="Very High" action="ACTION_NONE" value="6" />
<options text="MO_LOW" action="ACTION_NONE" value="3" />
<options text="MO_MED" action="ACTION_NONE" value="4" />
<options text="MO_HIGH" action="ACTION_NONE" value="5" />
<options text="MO_VHIGH" action="ACTION_NONE" value="6" />
</menupc>
<menupc enum="MENU_DISPLAY_TREE_LIGHTING">
<options text="PC" action="ACTION_NONE" value="1" />
Expand Down
8 changes: 4 additions & 4 deletions data/update/TLAD/common/data/frontend_menus.xml
Original file line number Diff line number Diff line change
Expand Up @@ -469,10 +469,10 @@
<menupc enum="MENU_DISPLAY_DOF">
<options text="MO_OFF" action="ACTION_NONE" value="1" />
<options text="Cutscenes Only" action="ACTION_NONE" value="2" />
<options text="Low" action="ACTION_NONE" value="3" />
<options text="Medium" action="ACTION_NONE" value="4" />
<options text="High" action="ACTION_NONE" value="5" />
<options text="Very High" action="ACTION_NONE" value="6" />
<options text="MO_LOW" action="ACTION_NONE" value="3" />
<options text="MO_MED" action="ACTION_NONE" value="4" />
<options text="MO_HIGH" action="ACTION_NONE" value="5" />
<options text="MO_VHIGH" action="ACTION_NONE" value="6" />
</menupc>
<menupc enum="MENU_DISPLAY_TREE_LIGHTING">
<options text="PC" action="ACTION_NONE" value="1" />
Expand Down
Binary file added data/update/TLAD/pc/data/effects/gta_ep1.wpfl
Binary file not shown.
14 changes: 7 additions & 7 deletions data/update/common/data/frontend_menus.xml
Original file line number Diff line number Diff line change
Expand Up @@ -324,10 +324,10 @@
<menupc enum="MENU_DISPLAY_DOF">
<options text="MO_OFF" action="ACTION_NONE" value="1" />
<options text="Cutscenes Only" action="ACTION_NONE" value="2" />
<options text="Low" action="ACTION_NONE" value="3" />
<options text="Medium" action="ACTION_NONE" value="4" />
<options text="High" action="ACTION_NONE" value="5" />
<options text="Very High" action="ACTION_NONE" value="6" />
<options text="MO_LOW" action="ACTION_NONE" value="3" />
<options text="MO_MED" action="ACTION_NONE" value="4" />
<options text="MO_HIGH" action="ACTION_NONE" value="5" />
<options text="MO_VHIGH" action="ACTION_NONE" value="6" />
</menupc>

<menupc enum="MENU_DISPLAY_TREE_LIGHTING">
Expand Down Expand Up @@ -368,10 +368,10 @@
<options action="MENUOPT_ADJUST" label="MO_REPLAY" value="PREF_REPLAY_MODE" scaler="2" displayValue="MENU_DISPLAY_ON_OFF" />
<options action="MENUOPT_JUMP_GUIDE" label="MO_GUIDE" value="PREF_NULL" scaler="0" displayValue="MENU_DISPLAY_NONE" />
<options action="MENUOPT_NONE" label="" value="PREF_NULL" scaler="0" displayValue="MENU_DISPLAY_NONE" />
<optionspc action="MENUOPT_ADJUST_GAMEMODE" label="Skip Intro" value="PREF_SKIP_INTRO" scaler="2" displayValue="MENU_DISPLAY_ON_OFF" />
<optionspc action="MENUOPT_ADJUST_GAMEMODE" label="Skip Menu" value="PREF_SKIP_MENU" scaler="2" displayValue="MENU_DISPLAY_ON_OFF" />
<optionspc action="MENUOPT_ADJUST" label="Skip Intro" value="PREF_SKIP_INTRO" scaler="2" displayValue="MENU_DISPLAY_ON_OFF" />
<optionspc action="MENUOPT_ADJUST" label="Skip Menu" value="PREF_SKIP_MENU" scaler="2" displayValue="MENU_DISPLAY_ON_OFF" />
<optionspc action="MENUOPT_ADJUST" label="Windowed" value="PREF_WINDOWED" scaler="2" displayValue="MENU_DISPLAY_ON_OFF" />
<optionspc action="MENUOPT_ADJUST_GAMEMODE" label="Borderless" value="PREF_BORDERLESS" scaler="2" displayValue="MENU_DISPLAY_ON_OFF" />
<optionspc action="MENUOPT_ADJUST" label="Borderless" value="PREF_BORDERLESS" scaler="2" displayValue="MENU_DISPLAY_ON_OFF" />
<optionspc action="MENUOPT_ADJUST" label="Focus Loss" value="PREF_BLOCKONLOSTFOCUS" scaler="2" displayValue="MENU_DISPLAY_ON_OFF" />
<optionspc action="MENUOPT_ADJUST" label="FPS Counter" value="PREF_FPSCOUNTER" scaler="2" displayValue="MENU_DISPLAY_ON_OFF" />
<options action="MENUOPT_NONE" label="" value="PREF_NULL" scaler="0" displayValue="MENU_DISPLAY_NONE" />
Expand Down
Binary file added data/update/pc/data/effects/gta_core.wpfl
Binary file not shown.
Binary file modified premake5.exe
Binary file not shown.
35 changes: 21 additions & 14 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,11 @@ This projects aims to fix some issues in Grand Theft Auto IV: Complete Edition.
> [!WARNING]
> Non-Windows users (Proton/Wine) need to perform a [DLL override](https://cookieplmonster.github.io/setup-instructions/#proton-wine).
>
> Additionally:
> * Install and run Protontricks.
> * Select "Grand Theft Auto IV" -> "Select the default Wineprefix" -> "Install a Windows DLL or component".
> * Search for "d3dx9_43", select it and click OK.
> [!IMPORTANT]
> This fix was tested only with latest official update and latest [ASI Loader](https://github.com/ThirteenAG/Ultimate-ASI-Loader/releases/latest/download/Ultimate-ASI-Loader.zip) (included in the archive).
Expand Down Expand Up @@ -307,27 +312,28 @@ Note: most of this content requires additional modifications by the end user to

**Special thanks to [Parallellines0451](https://github.com/Parallellines0451) [AssaultKifle47](https://github.com/akifle47), [RaphaelK12](https://github.com/RaphaelK12), [robi29](https://github.com/robi29) and [\_CP_](https://github.com/cpmodding) for directly contributing with fixes, to [Shvab](https://github.com/d3g0n-byte) for making RAGE Shader Editor.**

**Fusion Fix uses dx hook to implement some features. It causes certain 3rd party software to crash/hang the game. To avoid this, Fusion Fix prevents [certain dlls from injecting into the game's process](https://github.com/ThirteenAG/GTAIV.EFLC.FusionFix/blob/master/source/dllblacklist.ixx#L15).**
**Fusion Fix prevents [certain dlls from injecting into the game's process, to avoid issues](https://github.com/ThirteenAG/GTAIV.EFLC.FusionFix/blob/master/source/dllblacklist.ixx#L15).**

### General
#### General
- Fixed z-fighting
- Fixed object pop-in caused by version 1.0.6.0
- Improved screen door transparency
### Lighting
#### Lighting
- Fixed volumetric lights occlusion
- Restored console foliage translucency
- Added an improved tree lighting mode based on PC
- Fixed orange glow under trees
- Fixed mismatched intensity of shadow casting lights causing visible pop-in
- Fixed lights that were made invisible with version 1.0.6.0
- Fixed black normal map halos on several surfaces such as asphalt, sidewalks and rocks
### Shadows
- Restored shadow filter from versions prior to 1.0.6.0 and also added an improved one based on it
#### Shadows
- Restored rotated disk filter from versions prior to 1.0.6.0
- Fixed large shadow artifacts visible from high altitudes
- Fixed shadowmap being erroneously blurred before the lighting pass
- Fixed shadows stretching at certain camera angles
- Fixed shadow view distance being lower than the actual rendered distance
- Fixed cutoff penumbras of distant shadows
- Restored normal offset bias from versions prior to 1.0.6.0
- Added contact hardening shadows
- Fixed disconnected night shadows
- Fixed blur artifacts between shadow cascades under some conditions
- Added "pseudo" shadow cascade blending to reduce the disparity between cascades
Expand All @@ -336,20 +342,20 @@ Note: most of this content requires additional modifications by the end user to
- Fixed incorrectly offset shadows on water
- Fixed flickering when shadows of transparent objects overlap
- Added parameters to control shadow softness and bias
### Post processing
#### Post processing
- Split depth of field, motion blur and stippling filter into separate passes to prevent overlap
- Fixed color banding, most noticeably in the sky
- Added a mask to selectively filter screen door transparency
- Fixed depth of field and bloom not scaling correctly at resolutions higher than 720p
- Improved bloom weights and stability in motion
- Fixed excessively blurry screen compared to consoles caused by leftover anti aliasing code
- Restored console bloom and auto exposure
- Restored console timecyc gamma bump
- Fixed flickering auto exposure
- Fixed motion blur losing intensity at high framerates
- Fixed incorrect TLAD noise tiling on water quality levels other than medium
- Fixed TLAD noise aspect ratio
- Added a console-like gamma toggle
### Reflections
#### Reflections
- Restored console behavior for tree and terrain reflections
- Fixed excessive specularity of several meshes in Alderney
- Fixed distorted vehicle reflections
Expand All @@ -360,22 +366,23 @@ Note: most of this content requires additional modifications by the end user to
- Restored console environment reflection intensity
- Fixed distorted mirror reflections at certain camera angles
- Restored console mirror blur
### Particles
#### Particles
- Fixed soft particles
- Fixed stuttery particle animations caused by version 1.0.5.0
- Fixed rain being almost invisible, especially at night
- Fixed rain streaks becoming shorter at high framerates
### Water
#### Water
- Fixed flickering outlines around shores and thin objects
- Fixed invisible water foam
- Improved shallow water transparency and improved foam texture
- Fixed incorrect water texture tiling on quality levels other than medium
- Fixed flat, mirror-like water surface on AMD graphics cards
- Removed broken shore foam effect
### Misc
#### Misc
- Fixed outlines around objects when using DXVK
- Partially restored console object fade speed
- Fixed terrain pop-in
- Reduced procobj pop-in for the default view and detail distance values
- Partially fixed building windows visible near the far plane if emissive depth write is disabled
- Adjusted tree mipmap bias
- Restored fence mipmap bias from versions prior to 1.0.6.0
- Fixed incorrect texture filtering used in several shaders
- Added a parameter to control the alpha threshold of tree leaves
Expand Down
12 changes: 12 additions & 0 deletions source/fixes.ixx
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,18 @@ public:
if (!pattern.empty())
injector::WriteMemory<uint8_t>(pattern.get_first(0), 0xEB, true); // jz -> jmp
}

// Subtract Contrast slider value by 1 internally, same as on Xbox 360
{
auto pattern = find_pattern("F3 0F 59 C7 0F 2F C8 76 05 0F 28 C1 EB 05 0F 2F E0 76 16", "F3 0F 59 C6 0F 2F E8 76 05 0F 28 C5 EB 05 0F 2F D8 76 16");
if (!pattern.empty())
{
static auto ContrastSliderHook = safetyhook::create_mid(pattern.get_first(0), [](SafetyHookContext& regs)
{
regs.xmm0.f32[0] -= 1.0f;
});
}
}
};
}
} Fixes;
40 changes: 13 additions & 27 deletions source/frameratevigilante.ixx
Original file line number Diff line number Diff line change
Expand Up @@ -19,36 +19,22 @@ public:
FramerateVigilante()
{
FusionFix::onInitEventAsync() += []()
{
// Handbrake Cam (test)
auto pattern = find_pattern("E8 ? ? ? ? D9 5C 24 7C F3 0F 10 4C 24", "E8 ? ? ? ? D9 5C 24 70 F3 0F 10 44 24 ? F3 0F 58 86");
hbsub_A18510.fun = injector::MakeCALL(pattern.get_first(0), sub_A18510).get();
{
// Handbrake Cam (test)
auto pattern = find_pattern("E8 ? ? ? ? D9 5C 24 7C F3 0F 10 4C 24", "E8 ? ? ? ? D9 5C 24 70 F3 0F 10 44 24 ? F3 0F 58 86");
hbsub_A18510.fun = injector::MakeCALL(pattern.get_first(0), sub_A18510).get();

pattern = hook::pattern("F3 0F 58 05 ? ? ? ? F3 0F 2A 0D");
if (!pattern.empty())
{
struct LoadingTextSparks
{
void operator()(injector::reg_pack& regs)
{
regs.xmm1.f32[0] += 0.085f * *CTimer::fTimeStep;
}
}; injector::MakeInline<LoadingTextSparks>(pattern.get_first(0), pattern.get_first(8));
}
else
pattern = hook::pattern("F3 0F 58 05 ? ? ? ? F3 0F 2A 0D");
if (!pattern.empty())
{
struct LoadingTextSparks
{
pattern = hook::pattern("F3 0F 58 0D ? ? ? ? 0F 5B C0 F3 0F 11 0D");
if (!pattern.empty())
void operator()(injector::reg_pack& regs)
{
struct LoadingTextSparks
{
void operator()(injector::reg_pack& regs)
{
regs.xmm0.f32[0] += 0.085f * *CTimer::fTimeStep;
}
}; injector::MakeInline<LoadingTextSparks>(pattern.get_first(0), pattern.get_first(8));
regs.xmm0.f32[0] += 0.085f * *CTimer::fTimeStep;
}
}
};
}; injector::MakeInline<LoadingTextSparks>(pattern.get_first(0), pattern.get_first(8));
}
};
}
} FramerateVigilante;
7 changes: 7 additions & 0 deletions source/shaders.ixx
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,13 @@ public:
}
}

// Override reflection multiplier that resulted in weaker reflections on PC, a fix/workaround used to be in place on the shader side, move it in here instead.
{
static float dw103F984 = 1.0f; // 0.6f -> 1.0f
auto pattern = find_pattern("F3 0F 10 05 ? ? ? ? F3 0F 59 C1 51 F3 0F 11 04 24 E8", "F3 0F 10 0D ? ? ? ? 51 F3 0F 59 C8 F3 0F 11 0C 24 E8");
injector::WriteMemory(pattern.get_first(4), &dw103F984, 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)
{
Expand Down

0 comments on commit ae7b515

Please sign in to comment.