add vignette effect

This commit is contained in:
MihailRis 2025-04-06 13:10:34 +03:00
parent 64039f0e43
commit 4157bde156

View File

@ -0,0 +1,15 @@
#include <commons>
#param float p_radius = 1.1
#param float p_softness = 0.7
vec4 apply_vignette(vec4 color) {
vec2 position = v_uv - vec2(0.5);
float dist = length(position);
float vignette = smoothstep(p_radius, p_radius - p_softness, dist);
return vec4(color.rgb * vignette, 1.0);
}
vec4 effect() {
return apply_vignette(texture(u_screen, v_uv));
}