27 lines
721 B
Text
27 lines
721 B
Text
|
/*
|
||
|
Shader from Godot Shaders - the free shader library.
|
||
|
godotshaders.com/shader/VHS-and-CRT-monitor-effect
|
||
|
|
||
|
This shader is under CC0 license. Feel free to use, improve and
|
||
|
change this shader according to your needs and consider sharing
|
||
|
the modified result to godotshaders.com.
|
||
|
*/
|
||
|
|
||
|
shader_type canvas_item;
|
||
|
|
||
|
uniform float vignette_intensity = 0.4;
|
||
|
uniform float vignette_opacity : hint_range(0.0, 1.0) = 0.5;
|
||
|
|
||
|
uniform sampler2D SCREEN_TEXTURE : hint_screen_texture, filter_linear_mipmap;
|
||
|
|
||
|
float vignette(vec2 uv){
|
||
|
uv *= 1.0 - uv.xy;
|
||
|
float vignette = uv.x * uv.y * 15.0;
|
||
|
return pow(vignette, vignette_intensity * vignette_opacity);
|
||
|
}
|
||
|
|
||
|
void fragment()
|
||
|
{
|
||
|
COLOR = texture(SCREEN_TEXTURE, UV);
|
||
|
COLOR.rgb *= vignette(UV);
|
||
|
}
|