diff --git a/effects/shaders/crop.frag b/effects/shaders/crop.frag index 7fed98944..0cfbeeba8 100644 --- a/effects/shaders/crop.frag +++ b/effects/shaders/crop.frag @@ -5,6 +5,7 @@ uniform float top; uniform float right; uniform float bottom; uniform float feather; +uniform bool invert; uniform mediump float amount_val; uniform sampler2D myTexture; @@ -25,10 +26,18 @@ void main(void) { if (bottom > 0.0) alpha = alpha * clamp((((1.0-vTexCoord.y)+(0.5/f))-(bottom*0.01))*f, 0.0, 1.0); // bottom } - gl_FragColor = vec4( - textureColor.r*alpha, - textureColor.g*alpha, - textureColor.b*alpha, + if (invert) + {gl_FragColor = vec4( + textureColor.r*(1.0 - alpha), + textureColor.g*(1.0 - alpha), + textureColor.b*(1.0 - alpha), + 1.0 - alpha + );} + else{ + gl_FragColor = vec4( + textureColor.r*(alpha), + textureColor.g*(alpha), + textureColor.b*(alpha), alpha - ); + );} } \ No newline at end of file diff --git a/effects/shaders/crop.xml b/effects/shaders/crop.xml index caa8a578c..be819a988 100644 --- a/effects/shaders/crop.xml +++ b/effects/shaders/crop.xml @@ -16,4 +16,7 @@ + + + \ No newline at end of file diff --git a/effects/shaders/vignette.frag b/effects/shaders/vignette.frag index cf8014b25..ae218dfc8 100644 --- a/effects/shaders/vignette.frag +++ b/effects/shaders/vignette.frag @@ -7,6 +7,7 @@ uniform float centerX; uniform float centerY; uniform bool circular; uniform vec2 resolution; +uniform bool invert; // uniform vec2 lensRadius; // 0.45, 0.38 varying vec2 vTexCoord; @@ -24,6 +25,11 @@ void main(void) { } float dist = distance(vignetteCoord, vec2(0.5 + centerX*0.01, 0.5 + centerY*0.01)); float size = (lensRadiusX*0.01); - c *= smoothstep(size, size*0.99*(1.0-lensRadiusY*0.01), dist); + + if (invert) + {c *= 1.0 - smoothstep(size, size*0.99*(1.0-lensRadiusY*0.01), dist);} + else + {c *= smoothstep(size, size*0.99*(1.0-lensRadiusY*0.01), dist);} + gl_FragColor = c; } \ No newline at end of file diff --git a/effects/shaders/vignette.xml b/effects/shaders/vignette.xml index a85e94be5..849e6393c 100644 --- a/effects/shaders/vignette.xml +++ b/effects/shaders/vignette.xml @@ -13,5 +13,8 @@ + + + \ No newline at end of file