Just Chromatic Aberration
This is a little shader to create a chromatic aberration without any other effect, you can control de X and Y displacement of each color (RGB) individually.
Shader code
// chromatic aberration
//---------------------------------
shader_type canvas_item;
uniform vec2 r_displacement = vec2(3.0, 0.0);
uniform vec2 g_displacement = vec2(0.0, 0.0);
uniform vec2 b_displacement = vec2(-3.0, 0.0);
void fragment()
{
float r = texture(SCREEN_TEXTURE, SCREEN_UV + vec2(SCREEN_PIXEL_SIZE*r_displacement), 0.0).r;
float g = texture(SCREEN_TEXTURE, SCREEN_UV + vec2(SCREEN_PIXEL_SIZE*g_displacement), 0.0).g;
float b = texture(SCREEN_TEXTURE, SCREEN_UV + vec2(SCREEN_PIXEL_SIZE*b_displacement), 0.0).b;
COLOR = vec4(r, g, b, 1.0);
}
Godot 4.x compatibility:
add following line after shader_type canvas_item:
uniform sampler2D SCREEN_TEXTURE : hint_screen_texture, filter_linear_mipmap;