Skip to content

Commit

Permalink
feat(shaders::tonemap): add reno_drt_working_color_space and reno_drt…
Browse files Browse the repository at this point in the history
…_per_channel
  • Loading branch information
clshortfuse committed Dec 18, 2024
1 parent e8e6be0 commit 9415cbf
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/shaders/tonemap.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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,
Expand All @@ -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;
}
Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit 9415cbf

Please sign in to comment.