From 9415cbf5bd740adbd6e9130a408c9344086ae66e Mon Sep 17 00:00:00 2001 From: Carlos Lopez Date: Tue, 17 Dec 2024 21:22:11 -0500 Subject: [PATCH] feat(shaders::tonemap): add reno_drt_working_color_space and reno_drt_per_channel --- src/shaders/tonemap.hlsl | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/shaders/tonemap.hlsl b/src/shaders/tonemap.hlsl index a6c382a5..b0abc575 100644 --- a/src/shaders/tonemap.hlsl +++ b/src/shaders/tonemap.hlsl @@ -180,6 +180,8 @@ struct Config { float3 hue_correction_color; uint reno_drt_hue_correction_method; uint reno_drt_tone_map_method; + uint reno_drt_working_color_space; + bool reno_drt_per_channel; }; float3 UpgradeToneMap(float3 color_hdr, float3 color_sdr, float3 post_process_color, float post_process_strength) { @@ -243,7 +245,9 @@ Config Create( float hue_correction_strength = 1.f, float3 hue_correction_color = 0, uint reno_drt_hue_correction_method = renodrt::config::hue_correction_method::OKLAB, - uint reno_drt_tone_map_method = renodrt::config::tone_map_method::DANIELE) { + uint reno_drt_tone_map_method = renodrt::config::tone_map_method::DANIELE, + uint reno_drt_working_color_space = 0u, + bool reno_drt_per_channel = false) { const Config tm_config = { type, peak_nits, @@ -266,7 +270,9 @@ Config Create( hue_correction_strength, hue_correction_color, reno_drt_hue_correction_method, - reno_drt_tone_map_method + reno_drt_tone_map_method, + reno_drt_working_color_space, + reno_drt_per_channel }; return tm_config; } @@ -305,6 +311,8 @@ float3 ApplyRenoDRT(float3 color, Config tm_config) { } reno_drt_config.hue_correction_method = tm_config.reno_drt_hue_correction_method; reno_drt_config.tone_map_method = tm_config.reno_drt_tone_map_method; + reno_drt_config.working_color_space = tm_config.reno_drt_working_color_space; + reno_drt_config.per_channel = tm_config.reno_drt_per_channel; return renodrt::BT709(color, reno_drt_config); }