Skip to content

Commit

Permalink
Silenthill2remake (#59)
Browse files Browse the repository at this point in the history
* feat(silenthill2remake): silent hill 2 black floor fix

* feat(silenthill2remake): update. added UI shaders to fix eventual framegen issues if it ever gets an official implementation

* fix(silenthill2remake): update readme

* feat(silenthill2remake): update. added UI shaders to fix eventual framegen issues if it ever gets an official implementation

* fix(silenthill2remake): update readme
  • Loading branch information
ersh1 authored Oct 15, 2024
1 parent 98cdec2 commit bed5eb6
Show file tree
Hide file tree
Showing 30 changed files with 27 additions and 13 deletions.
Binary file modified src/games/silenthill2remake/0x063CCF18.cso
Binary file not shown.
Binary file modified src/games/silenthill2remake/0x18A5ACE1.cso
Binary file not shown.
Binary file added src/games/silenthill2remake/0x1BC9EFE2.cso
Binary file not shown.
Binary file modified src/games/silenthill2remake/0x1E7B589F.cso
Binary file not shown.
Binary file modified src/games/silenthill2remake/0x309584F8.cso
Binary file not shown.
Binary file modified src/games/silenthill2remake/0x39235257.cso
Binary file not shown.
Binary file added src/games/silenthill2remake/0x394B5831.cso
Binary file not shown.
Binary file added src/games/silenthill2remake/0x3CB03848.cso
Binary file not shown.
Binary file modified src/games/silenthill2remake/0x421733C7.cso
Binary file not shown.
Binary file added src/games/silenthill2remake/0x43713652.cso
Binary file not shown.
Binary file added src/games/silenthill2remake/0x4B7B660D.cso
Binary file not shown.
Binary file modified src/games/silenthill2remake/0x4CC68F73.cso
Binary file not shown.
Binary file modified src/games/silenthill2remake/0x507B8FB6.cso
Binary file not shown.
Binary file modified src/games/silenthill2remake/0x68E782E2.cso
Binary file not shown.
Binary file modified src/games/silenthill2remake/0x72A44486.cso
Binary file not shown.
Binary file modified src/games/silenthill2remake/0x77178C51.cso
Binary file not shown.
Binary file added src/games/silenthill2remake/0x82F211C7.cso
Binary file not shown.
Binary file modified src/games/silenthill2remake/0x865E53FC.cso
Binary file not shown.
Binary file added src/games/silenthill2remake/0x95CC270F.cso
Binary file not shown.
Binary file modified src/games/silenthill2remake/0x99145AE9.cso
Binary file not shown.
Binary file modified src/games/silenthill2remake/0x9DF2DDD4.cso
Binary file not shown.
Binary file modified src/games/silenthill2remake/0x9EB78561.cso
Binary file not shown.
Binary file modified src/games/silenthill2remake/0xA0A20D27.cso
Binary file not shown.
Binary file modified src/games/silenthill2remake/0xBBB5CA7B.cso
Binary file not shown.
Binary file added src/games/silenthill2remake/0xBF32ABFA.cso
Binary file not shown.
Binary file modified src/games/silenthill2remake/0xC496B5C3.cso
Binary file not shown.
Binary file modified src/games/silenthill2remake/0xDA6D5332.cso
Binary file not shown.
Binary file modified src/games/silenthill2remake/0xFDFD3CB7.cso
Binary file not shown.
17 changes: 8 additions & 9 deletions src/games/silenthill2remake/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,26 +18,25 @@ float3 ColorCorrectAll( float3 WorkingColor )

// Shadow CC
+ float4 ShadowOffset = ColorOffsetShadows+ColorOffset;
+ float4 GammaOffset = 0;
+ float4 ContrastOffset = 0;
+ float4 ShadowGammaOffset = 0;
+ float4 ShadowContrastOffset = 0;
+ if (injectedData.type > 0) {
+ if (any(saturate(ShadowOffset)))
+ {
+ ShadowOffset.xyz *= pow(saturate(WorkingColor.xyz), 1.f / 2.2f);
+ ShadowOffset.w *= pow(saturate(Luma), 1.f / 2.2f);
+ float4 OtherOffset = saturate((ColorOffsetShadows - ShadowOffset) * injectedData.magicNumber);
+ float4 OtherOffset = saturate((ShadowOffset) * injectedData.magicNumber);
+ ShadowOffset = 0;
+ if (injectedData.type == 2) {
+ GammaOffset = OtherOffset;
+ ShadowGammaOffset = OtherOffset;
+ } else if (injectedData.type == 3) {
+ ContrastOffset = -OtherOffset;
+ ShadowContrastOffset = -OtherOffset;
+ }
+ }
+ }
+
float3 CCColorShadows = ColorCorrect(WorkingColor,
ColorSaturationShadows*ColorSaturation,
ColorContrastShadows*ColorContrast + ContrastOffset,
ColorGammaShadows*ColorGamma + GammaOffset,
ColorContrastShadows*ColorContrast + ShadowContrastOffset,
ColorGammaShadows*ColorGamma + ShadowGammaOffset,
ColorGainShadows*ColorGain,
- ColorOffsetShadows - ShadowOffset);
+ ShadowOffset);
Expand Down
23 changes: 19 additions & 4 deletions src/games/silenthill2remake/addon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,16 @@
#include <embed/0x9EB78561.h>
#include <embed/0xC496B5C3.h>
#include <embed/0x39235257.h>

#include <embed/0x1BC9EFE2.h>
#include <embed/0x3CB03848.h>
#include <embed/0x4B7B660D.h>
#include <embed/0x82F211C7.h>
#include <embed/0x95CC270F.h>
#include <embed/0x394B5831.h>
#include <embed/0x43713652.h>
#include <embed/0xBF32ABFA.h>

#include <include/reshade.hpp>

#include "../../mods/shader.hpp"
Expand Down Expand Up @@ -58,6 +68,15 @@ renodx::mods::shader::CustomShaders custom_shaders = {
CustomShaderEntry(0x9EB78561),
CustomShaderEntry(0xC496B5C3),
CustomShaderEntry(0x39235257),

CustomShaderEntry(0x1BC9EFE2),
CustomShaderEntry(0x3CB03848),
CustomShaderEntry(0x4B7B660D),
CustomShaderEntry(0x82F211C7),
CustomShaderEntry(0x95CC270F),
CustomShaderEntry(0x394B5831),
CustomShaderEntry(0x43713652),
CustomShaderEntry(0xBF32ABFA),
};

ShaderInjectData shader_injection;
Expand Down Expand Up @@ -139,17 +158,13 @@ BOOL APIENTRY DllMain(HMODULE h_module, DWORD fdw_reason, LPVOID lpv_reserved) {
};
renodx::mods::shader::force_pipeline_cloning = true;
renodx::mods::shader::expected_constant_buffer_space = 50;
//renodx::mods::swapchain::force_borderless = true;
//renodx::mods::swapchain::prevent_full_screen = true;
//renodx::mods::swapchain::SetUseHDR10(true);
break;
case DLL_PROCESS_DETACH:
reshade::unregister_addon(h_module);
break;
}

renodx::mods::shader::Use(fdw_reason, custom_shaders, &shader_injection);
//renodx::mods::swapchain::Use(fdw_reason);
renodx::utils::settings::Use(fdw_reason, &settings, &OnPresetOff);

return TRUE;
Expand Down

0 comments on commit bed5eb6

Please sign in to comment.