From 86bd06795abd249fe7ddefee45944f9187c6f02c Mon Sep 17 00:00:00 2001 From: itsmattkc Date: Thu, 28 Mar 2019 21:04:15 +1100 Subject: [PATCH] use resolution for feather values --- effects/shaders/crop.frag | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/effects/shaders/crop.frag b/effects/shaders/crop.frag index 084466485..340f6fdaf 100644 --- a/effects/shaders/crop.frag +++ b/effects/shaders/crop.frag @@ -3,6 +3,7 @@ uniform float top; uniform float right; uniform float bottom; uniform float feather; +uniform vec2 resolution; uniform mediump float amount_val; @@ -15,23 +16,26 @@ vec4 process(vec4 col) { alpha = 0.0; } } else { - float f = pow(2.0, 10.0-(feather*0.1)); + + float f = pow(2.0, 10.0-(feather*0.25)); if (left > 0.0) { - alpha *= clamp(((v_texcoord.x+(0.5/f))-(left*0.01))*f, 0.0, 1.0); // left + alpha *= clamp(((resolution.x*v_texcoord.x+(0.5/f))-(left*0.01*resolution.x))*f, 0.0, 1.0); // left } if (top > 0.0) { - alpha *= clamp(((v_texcoord.y+(0.5/f))-(top*0.01))*f, 0.0, 1.0); // top + alpha *= clamp(((resolution.y*v_texcoord.y+(0.5/f))-(top*0.01*resolution.y))*f, 0.0, 1.0); // top } if (right > 0.0) { - alpha *= clamp((((1.0-v_texcoord.x)+(0.5/f))-(right*0.01))*f, 0.0, 1.0); // right + alpha *= clamp(((resolution.x*(1.0-v_texcoord.x)+(0.5/f))-(right*0.01*resolution.x))*f, 0.0, 1.0); // right } if (bottom > 0.0) { - alpha *= clamp((((1.0-v_texcoord.y)+(0.5/f))-(bottom*0.01))*f, 0.0, 1.0); // bottom + alpha *= clamp(((resolution.y*(1.0-v_texcoord.y)+(0.5/f))-(bottom*0.01*resolution.y))*f, 0.0, 1.0); // bottom } + + } return col * alpha;