2023-12-13 22:48:27 +01:00
|
|
|
shader_type canvas_item;
|
|
|
|
|
|
|
|
// inspired by: https://www.youtube.com/watch?v=aVzY6n3e19A
|
|
|
|
|
|
|
|
uniform sampler2D SCREEN_TEXTURE : hint_screen_texture, filter_linear;
|
2023-12-14 22:38:34 +01:00
|
|
|
uniform float strength = 20.0;
|
2023-12-13 22:48:27 +01:00
|
|
|
|
|
|
|
void fragment() {
|
2023-12-14 22:38:34 +01:00
|
|
|
vec2 ca_offset = vec2(strength, 0.0) * SCREEN_PIXEL_SIZE;
|
2023-12-13 22:48:27 +01:00
|
|
|
float red = texture(SCREEN_TEXTURE, SCREEN_UV - ca_offset).r;
|
|
|
|
float green = texture(SCREEN_TEXTURE, SCREEN_UV).g;
|
|
|
|
float blue = texture(SCREEN_TEXTURE, SCREEN_UV + ca_offset).b;
|
|
|
|
|
|
|
|
COLOR = vec4(red, green, blue, 1.0);
|
|
|
|
}
|