From 36b12d971b02081c33b3c9a4524c9f91179cc3a4 Mon Sep 17 00:00:00 2001 From: Michael Fabian 'Xaymar' Dirks Date: Wed, 14 Apr 2021 11:36:45 +0200 Subject: [PATCH] filters/color-grading: Fix incorrect Lift logic (#515) Fixes #515 --- data/effects/color-grade.effect | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/data/effects/color-grade.effect b/data/effects/color-grade.effect index cbae6779..a0516448 100644 --- a/data/effects/color-grade.effect +++ b/data/effects/color-grade.effect @@ -50,8 +50,10 @@ uniform float4 pCorrection; // Functionality //------------------------------------------------------------------------------ -float3 grade_lift(float3 v) { // same as grade_offset? - return (v.rgb + pLift.rgb) + pLift.a; +float3 grade_lift(float3 v) { + float3 multiplier1 = float3(1., 1., 1.) - pLift.rgb; + float3 multiplier2 = float3(1., 1., 1.) - pLift.aaa; + return float3(1., 1., 1.) - ((float3(1., 1., 1.) - v) * multiplier1 * multiplier2); }; float3 grade_gamma(float3 v) {