From aca04e52e05eb78862c8ac398f1ccc2c99c2ecd5 Mon Sep 17 00:00:00 2001 From: Monroe88 Date: Fri, 4 Aug 2017 23:20:03 -0500 Subject: [PATCH] (LUT) Clamp mixer to 1.0 to fix black color issue --- reshade/shaders/LUT/LUT.slang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reshade/shaders/LUT/LUT.slang b/reshade/shaders/LUT/LUT.slang index 1270197..a54c0f1 100755 --- a/reshade/shaders/LUT/LUT.slang +++ b/reshade/shaders/LUT/LUT.slang @@ -48,7 +48,7 @@ void main() float green = ( imgColor.g * (params.LUT_Size - 1.0) + 0.4999 ) / params.LUT_Size; float blue1 = (floor( imgColor.b * (params.LUT_Size - 1.0) ) / params.LUT_Size) + red; float blue2 = (ceil( imgColor.b * (params.LUT_Size - 1.0) ) / params.LUT_Size) + red; - float mixer = max((imgColor.b - blue1) / (blue2 - blue1), 0.0); + float mixer = clamp(max((imgColor.b - blue1) / (blue2 - blue1), 0.0), 0.0, 1.0); vec4 color1 = texture( SamplerLUT, vec2( blue1, green )); vec4 color2 = texture( SamplerLUT, vec2( blue2, green )); FragColor = mixfix(color1, color2, mixer);