const VIGNETTE: &str = r#"
void main() {
vec2 uv = gl_FragCoord.xy / u_res;
vec4 src = texture(tex, uv);
float d = length((uv - 0.5) * u_res) / max(length(u_res * 0.5), 1.0);
float fall = smoothstep(0.0, 1.0, (d - p0) / max(p1, 0.001));
float k = 1.0 - clamp(p2, 0.0, 1.0) * fall;
vec4 res = vec4(src.rgb * k, src.a);
float m = u_has_mask > 0.5 ? texture(u_mask, uv).r : 1.0;
out_color = mix(src, res, m);
}
"#;Expand description
Darken outside p0 (fraction of the half diagonal) with p1 softness by p2.