mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-12 14:31:50 +00:00
add vignette effect
This commit is contained in:
parent
64039f0e43
commit
4157bde156
1 changed files with 15 additions and 0 deletions
15
res/shaders/effects/vignette.glsl
Normal file
15
res/shaders/effects/vignette.glsl
Normal 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));
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue