]> git.sesse.net Git - movit/blobdiff - vignette_effect.frag
Reduce the amount of arithmetic in the BlurEffect shader a bit.
[movit] / vignette_effect.frag
index 54fafffca138342f8aa1f33993862a02eefe201f..60d4b335858ba33a2522fce2f49db891ee68a042 100644 (file)
@@ -2,13 +2,14 @@
        
 uniform float PREFIX(pihalf_div_radius);
 uniform vec2 PREFIX(aspect_correction);
+uniform vec2 PREFIX(flipped_center);
 
 vec4 FUNCNAME(vec2 tc) {
        vec4 x = INPUT(tc);
 
        const float pihalf = 0.5 * 3.14159265358979324;
 
-       vec2 normalized_pos = (tc - PREFIX(center)) * PREFIX(aspect_correction);
+       vec2 normalized_pos = (tc - PREFIX(flipped_center)) * PREFIX(aspect_correction);
        float dist = (length(normalized_pos) - PREFIX(inner_radius)) * PREFIX(pihalf_div_radius);
        float linear_falloff = clamp(dist, 0.0, pihalf);
        float falloff = cos(linear_falloff) * cos(linear_falloff);