Skip to content

Commit

Permalink
Merge pull request #67 from marat569/visionsofmana
Browse files Browse the repository at this point in the history
Visionsofmana
  • Loading branch information
marat569 authored Dec 21, 2024
2 parents 216c92b + 6a4444b commit 6ae168b
Show file tree
Hide file tree
Showing 9 changed files with 41 additions and 571 deletions.
26 changes: 12 additions & 14 deletions src/games/visionsofmana/addon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,14 @@ namespace {

renodx::mods::shader::CustomShaders custom_shaders = {

// CustomShaderEntry(0x82F9B4AC), // Movies, Intro
////
CustomShaderEntry(0xC1BCC6B5), // Lutbuilder1 [Game world]
CustomShaderEntry(0xBBA0606A), // Sample1
CustomShaderEntry(0xE6EB2840), // Lutbuilder 2 [Tokyo]
CustomShaderEntry(0x60E37F45), // Sample 2 [Cutscenes?]
CustomShaderEntry(0x6BC6B830), // Sample 3 [ Stats UI ]
CustomShaderEntry(0x61C2EA30), // Lutbuilder3 [Menu]
CustomShaderEntry(0xB7F426D8), // Sample 4
CustomShaderEntry(0xD102F1EB), // Sample 5
CustomShaderEntry(0x3FA88630), // Sandland Sample 1

// Sample shaders [Depricated]
// CustomShaderEntry(0xBBA0606A), // Sample1
// Lutbuilders
CustomShaderEntry(0xC1BCC6B5), // Lutbuilder1
CustomShaderEntry(0xE6EB2840), // Lutbuilder2
CustomShaderEntry(0x61C2EA30), // Lutbuilder3

};

Expand Down Expand Up @@ -225,17 +222,18 @@ renodx::utils::settings::Settings settings = {
};

void OnPresetOff() {
renodx::utils::settings::UpdateSetting("toneMapType", 2.f);
renodx::utils::settings::UpdateSetting("toneMapType", 0.f);
renodx::utils::settings::UpdateSetting("toneMapPeakNits", 203.f);
renodx::utils::settings::UpdateSetting("toneMapGameNits", 203.f);
renodx::utils::settings::UpdateSetting("toneMapUINits", 203.f);
renodx::utils::settings::UpdateSetting("toneMapHueCorrection", 0.f);
renodx::utils::settings::UpdateSetting("colorGradeExposure", 1.f);
renodx::utils::settings::UpdateSetting("colorGradeHighlights", 50.f);
renodx::utils::settings::UpdateSetting("colorGradeShadows", 50.f);
renodx::utils::settings::UpdateSetting("colorGradeContrast", 50.f);
renodx::utils::settings::UpdateSetting("colorGradeSaturation", 50.f);
// renodx::utils::settings::UpdateSetting("colorGradeBlowout", 50.f);
// renodx::utils::settings::UpdateSetting("toneMapHueCorrection", 50.f);
renodx::utils::settings::UpdateSetting("colorGradeBlowout", 0.f);
renodx::utils::settings::UpdateSetting("colorGradeColorSpace", 0.f);
}

} // namespace
Expand All @@ -255,7 +253,7 @@ BOOL APIENTRY DllMain(HMODULE h_module, DWORD fdw_reason, LPVOID lpv_reserved) {
return device->get_api() == reshade::api::device_api::d3d12; // So overlays dont kill the game
};
renodx::mods::shader::expected_constant_buffer_space = 50; // cbuffer slot 50
//renodx::mods::shader::allow_multiple_push_constants = true;
// renodx::mods::shader::allow_multiple_push_constants = true;
renodx::mods::swapchain::expected_constant_buffer_space = 50;

renodx::mods::shader::force_pipeline_cloning = true; // So the mod works with the toolkit
Expand Down
6 changes: 3 additions & 3 deletions src/games/visionsofmana/common.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ void tonemap(in float3 ap1_graded_color, in float3 ap1_aces_colored, out float3
config.exposure = injectedData.colorGradeExposure;
config.highlights = injectedData.colorGradeHighlights;
config.shadows = injectedData.colorGradeShadows;
if (injectedData.toneMapType == 3.f) {
config.contrast = injectedData.colorGradeContrast;
}
// if (injectedData.toneMapType == 3.f) {
config.contrast = injectedData.colorGradeContrast;
// }
config.saturation = injectedData.colorGradeSaturation;

config.reno_drt_highlights = 1.0f;
Expand Down
13 changes: 10 additions & 3 deletions src/games/visionsofmana/lutbuilder1_0xC1BCC6B5.ps_5_1.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ void main(
float3 log_input_color = r1.rgb;

r0.xyz = r0.zzz ? r0.xyw : r1.xyz;
r0.rgb = pq_input_color;
// r0.rgb = pq_input_color;

float3 lut_input_color = r0.rgb;

Expand Down Expand Up @@ -357,7 +357,7 @@ void main(

ap1_aces_colored = r3.xyz;

if (is_hdr) {
if (injectedData.toneMapType != 0.f) {
tonemap(ap1_graded_color, ap1_aces_colored, hdr_color, sdr_color, sdr_ap1_color);

} else { // Added else
Expand Down Expand Up @@ -463,10 +463,17 @@ void main(

float3 film_graded_color = r3.rgb;

if (is_hdr) {
if (injectedData.toneMapType != 0.f) {
float3 final_color = saturate(film_graded_color);
final_color = renodx::tonemap::UpgradeToneMap(hdr_color, sdr_color, final_color, 1.f);

final_color.rgb = scalePaperWhite(final_color.rgb);

// Scale for UE decoding
final_color *= 1.f / 1.05f;

o0.rgba = float4(final_color.rgb, 0);

return;
}

Expand Down
11 changes: 8 additions & 3 deletions src/games/visionsofmana/lutbuilder2_0xE6EB2840.ps_5_1.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ void main(
float3 log_input_color = r1.rgb;

r0.xyz = r0.zzz ? r0.xyw : r1.xyz;
r0.rgb = pq_input_color;
// r0.rgb = pq_input_color;

float3 lut_input_color = r0.rgb;

Expand Down Expand Up @@ -334,7 +334,7 @@ void main(
r3.xyz = r3.xyz * float3(0.959999979, 0.959999979, 0.959999979) + r0.www;
ap1_aces_colored = r3.xyz;

if (is_hdr) {
if (injectedData.toneMapType != 0.f) {
tonemap(ap1_graded_color, ap1_aces_colored, hdr_color, sdr_color, sdr_ap1_color);
} else {
r4.xy = float2(1, 0.180000007) + cb0[36].ww;
Expand Down Expand Up @@ -457,9 +457,14 @@ void main(

float3 film_graded_color = r3.rgb;

if (is_hdr) {
if (injectedData.toneMapType != 0.f) {
float3 final_color = saturate(film_graded_color);
final_color = renodx::tonemap::UpgradeToneMap(hdr_color, sdr_color, final_color, 1.f);
final_color.rgb = scalePaperWhite(final_color.rgb);

// Scale for UE decoding
final_color *= 1.f / 1.05f;

o0.rgba = float4(final_color.rgb, 0);
return;
}
Expand Down
11 changes: 8 additions & 3 deletions src/games/visionsofmana/lutbuilder3_0x61C2EA30.ps_5_1.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ void main(

r0.xyz = r0.zzz ? r0.xyw : r1.xyz;

r0.rgb = pq_input_color;
// r0.rgb = pq_input_color;

float3 lut_input_color = r0.rgb;

Expand Down Expand Up @@ -436,7 +436,7 @@ void main(

ap1_aces_colored = r3.xyz;

if (is_hdr) {
if (injectedData.toneMapType != 0.f) {
tonemap(ap1_graded_color, ap1_aces_colored, hdr_color, sdr_color, sdr_ap1_color);
} else {
r4.xy = float2(1, 0.180000007) + cb0[36].ww;
Expand Down Expand Up @@ -531,9 +531,14 @@ void main(

float3 film_graded_color = r3.rgb;

if (is_hdr) {
if (injectedData.toneMapType != 0.f) {
float3 final_color = saturate(film_graded_color);
final_color = renodx::tonemap::UpgradeToneMap(hdr_color, sdr_color, final_color, 1.f);
final_color.rgb = scalePaperWhite(final_color.rgb);

// Scale for UE decoding
final_color *= 1.f / 1.05f;

o0.rgba = float4(final_color.rgb, 0);
return;
}
Expand Down
130 changes: 0 additions & 130 deletions src/games/visionsofmana/sample2_0x60E37F45.ps_5_1.hlsl

This file was deleted.

Loading

0 comments on commit 6ae168b

Please sign in to comment.