Skip to content

Commit

Permalink
[TEW2] Remove 709 clamp, upgrade fp11
Browse files Browse the repository at this point in the history
- Remove rec709 clamp
- Upgrade fp11 render targets
  • Loading branch information
marat569 committed Nov 2, 2024
1 parent e675543 commit 688c6f3
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 16 deletions.
2 changes: 2 additions & 0 deletions src/games/tew2/X_Final_0xFFFFFFFE.ps_5_0.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,7 @@ void main(
}
}

color.rgb = renodx::color::bt709::clamp::AP1(color.rgb); // Clamp to AP1 to avoid invalid colors

output.rgba = color;
}
30 changes: 15 additions & 15 deletions src/games/tew2/addon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -480,21 +480,21 @@ BOOL APIENTRY DllMain(HMODULE h_module, DWORD fdw_reason, LPVOID lpv_reserved) {
.new_format = reshade::api::format::r16g16b16a16_float,
});

// R11G11B10_Float / FP11
// renodx::mods::swapchain::swap_chain_upgrade_targets.push_back({.old_format = reshade::api::format::r11g11b10_float,
// .new_format = reshade::api::format::r16g16b16a16_float,
// .ignore_size = true,
// .view_upgrades = {
// {{reshade::api::resource_usage::shader_resource,
// reshade::api::format::r11g11b10_float},
// reshade::api::format::r16g16b16a16_float},
// {{reshade::api::resource_usage::unordered_access,
// reshade::api::format::r11g11b10_float},
// reshade::api::format::r16g16b16a16_float},
// {{reshade::api::resource_usage::render_target,
// reshade::api::format::r11g11b10_float},
// reshade::api::format::r16g16b16a16_float},
// }});
// R11G11B10
renodx::mods::swapchain::swap_chain_upgrade_targets.push_back({.old_format = reshade::api::format::r11g11b10_float,
.new_format = reshade::api::format::r16g16b16a16_float,
.ignore_size = true,
.view_upgrades = {
{{reshade::api::resource_usage::shader_resource,
reshade::api::format::r11g11b10_float},
reshade::api::format::r16g16b16a16_float},
{{reshade::api::resource_usage::unordered_access,
reshade::api::format::r11g11b10_float},
reshade::api::format::r16g16b16a16_float},
{{reshade::api::resource_usage::render_target,
reshade::api::format::r11g11b10_float},
reshade::api::format::r16g16b16a16_float},
}});

break;
case DLL_PROCESS_DETACH:
Expand Down
2 changes: 1 addition & 1 deletion src/games/tew2/noise_0x6F66059D.ps_5_0.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ void main(
r0.z = 1 + downsampletype.w;
r1.xyz = r1.xyz * r1.xyz + -r2.xyz;
r1.xyz = r0.zzz * r1.xyz + r2.xyz;
r1.xyz = max(float3(0,0,0), r1.xyz);
//r1.xyz = max(float3(0,0,0), r1.xyz); //709 clamp
r0.z = cmp(downsampletype.z == 1.000000);
if (r0.z != 0) {
r0.z = dot(r1.xyz, float3(0.212599993,0.715200007,0.0722000003));
Expand Down

0 comments on commit 688c6f3

Please sign in to comment.