@@ -232,7 +232,6 @@ float3 CustomPsychoV17Peak(
232232 float current_average,
233233 float target_average,
234234 float peak_value,
235- float mid_gray_scale = 1.f ,
236235 int gamut_compression_mode = 1 ) {
237236 if (!(target_average > 0.0f )) {
238237 return 0.0f ;
@@ -272,7 +271,6 @@ float3 CustomPsychoV17Peak(
272271 if (RENODX_TONE_MAP_CONTRAST != 1.f ) {
273272 yf_target = renodx::color ::grade::ContrastSafe (yf_target, RENODX_TONE_MAP_CONTRAST, yf_midgray);
274273 }
275- yf_target *= mid_gray_scale;
276274
277275 float yf_scale = renodx::math::DivideSafe (yf_target, yf_input, 1.f );
278276 bt709_scene *= yf_scale;
@@ -302,27 +300,23 @@ float3 CustomPsychoV17Peak(
302300 gamut_compression_mode);
303301}
304302
305- float3 CustomPsychoV17AutoExposure (float3 untonemapped_bt709, float peak, float mid_gray_scale, float current_average, float target_average, bool is_sdr = false ) {
303+ float3 CustomPsychoV17AutoExposure (float3 untonemapped_bt709, float peak, float current_average, float target_average, bool is_sdr = false ) {
306304 return CustomPsychoV17Peak (
307305 untonemapped_bt709,
308306 current_average,
309307 target_average,
310308 peak,
311- mid_gray_scale,
312309 (int )(!is_sdr));
313310}
314311
315- float3 ProcessTonemap (float3 untonemapped_bt709, float calculated_peak, float mid_gray_scale, float current_average, float target_average, bool is_sdr = false ) {
312+ float3 ProcessTonemap (float3 untonemapped_bt709, float calculated_peak, float current_average, float target_average, bool is_sdr = false ) {
316313 if (RENODX_TONE_MAP_TYPE == 0.f ) {
317314 return untonemapped_bt709;
318315 }
319316
320- mid_gray_scale = lerp (1.f , mid_gray_scale, CUSTOM_TONE_MAP_MIDGRAY_ADJUST);
321-
322317 float3 output_color = CustomPsychoV17AutoExposure (
323318 untonemapped_bt709,
324319 calculated_peak,
325- mid_gray_scale,
326320 current_average,
327321 target_average,
328322 is_sdr);
@@ -344,14 +338,14 @@ float3 ProcessTonemap(float3 untonemapped_bt709, float calculated_peak, float mi
344338 return output_color;
345339}
346340
347- float3 CustomTonemap (float3 untonemapped_bt709, float mid_gray_scale = 1.f , float current_average = 0.18f , float target_average = 0.18f ) {
341+ float3 CustomTonemap (float3 untonemapped_bt709, float current_average = 0.18f , float target_average = 0.18f ) {
348342 float calculated_peak = RENODX_PEAK_WHITE_NITS / RENODX_DIFFUSE_WHITE_NITS;
349343
350344 if (RENODX_GAMMA_CORRECTION > 0.f ) {
351345 calculated_peak = RENODX_GAMMA_CORRECTION == 1.f ? renodx::color ::correct::GammaSafe (calculated_peak, true ) : GammaCorrectionByLuminosity (calculated_peak, true ).x;
352346 }
353347
354- float3 output_color = ProcessTonemap (untonemapped_bt709, calculated_peak, mid_gray_scale, current_average, target_average, false );
348+ float3 output_color = ProcessTonemap (untonemapped_bt709, calculated_peak, current_average, target_average, false );
355349
356350 if (RENODX_GAMMA_CORRECTION > 0.f ) {
357351 output_color = RENODX_GAMMA_CORRECTION == 1.f ? renodx::color ::correct::GammaSafe (output_color) : GammaCorrectionByLuminosity (output_color);
@@ -360,11 +354,11 @@ float3 CustomTonemap(float3 untonemapped_bt709, float mid_gray_scale = 1.f, floa
360354 return output_color;
361355}
362356
363- float3 CustomTonemapSDR (float3 untonemapped_bt709, float mid_gray_scale, float current_average = 0.18f , float target_average = 0.18f ) {
357+ float3 CustomTonemapSDR (float3 untonemapped_bt709, float current_average = 0.18f , float target_average = 0.18f ) {
364358 float calculated_peak = 1.f ;
365359 calculated_peak = CUSTOM_SDR_BLACK_CRUSH_FIX == 1 ? renodx::color ::correct::GammaSafe (calculated_peak) : calculated_peak;
366360
367- float3 output_color = ProcessTonemap (untonemapped_bt709, calculated_peak, mid_gray_scale, current_average, target_average, true );
361+ float3 output_color = ProcessTonemap (untonemapped_bt709, calculated_peak, current_average, target_average, true );
368362
369363 return output_color;
370364}
0 commit comments