From 3113d60bc1723e2246518200936c0cb131a77576 Mon Sep 17 00:00:00 2001 From: Lucas Alber Date: Wed, 27 Nov 2024 14:14:03 +0100 Subject: [PATCH] merian-shader: tonemap: cleanup eps --- include/merian-shaders/tonemap.glsl | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/include/merian-shaders/tonemap.glsl b/include/merian-shaders/tonemap.glsl index deecb6f..708cc58 100644 --- a/include/merian-shaders/tonemap.glsl +++ b/include/merian-shaders/tonemap.glsl @@ -77,10 +77,9 @@ vec3 tonemap_lottes(const vec3 rgb, const float contrast, const float shoulder, const float c = (pow(hdrMax, contrast*shoulder)*pow(midIn, contrast) - pow(hdrMax, contrast)*pow(midIn, contrast*shoulder)*midOut) / (pow(hdrMax, contrast*shoulder)*midOut - pow(midIn, contrast*shoulder)*midOut); - #define EPS 1e-7f float peak = max(rgb.r, max(rgb.g, rgb.b)); - peak = max(EPS, peak); + peak = max(1e-7f, peak); vec3 ratio = rgb / peak; const float z = pow(peak, contrast); @@ -96,8 +95,6 @@ vec3 tonemap_lottes(const vec3 rgb, const float contrast, const float shoulder, ratio = mix(ratio, vec3(white), pow(peak, crosstalk)); ratio = pow(abs(ratio), vec3(crossSaturation)); - #undef EPS - return peak * ratio; }