rgb offset shader v2
i decided to go back and fix the offset system by adding xy support to the shader
remember, you must credit me for using this shader
Shader code
shader_type canvas_item;
render_mode unshaded;
uniform sampler2D displace : hint_albedo;
uniform float dispAmt: hint_range(0,0.1);
uniform vec2 abberationAmtXR = vec2(0,0);
uniform vec2 abberationAmtXG = vec2(0,0);
uniform vec2 abberationAmtXB = vec2(0,0);
uniform float dispSize: hint_range(0.1, 2.0);
uniform float maxAlpha : hint_range(0.1,1.0);
void fragment()
{
//displace effect
vec4 disp = texture(displace, SCREEN_UV * dispSize);
vec2 newUV = SCREEN_UV + disp.xy * dispAmt;
//abberation
COLOR.r = texture(SCREEN_TEXTURE, newUV - abberationAmtXR).r;
COLOR.g = texture(SCREEN_TEXTURE, newUV + abberationAmtXG).g;
COLOR.b = texture(SCREEN_TEXTURE, newUV + abberationAmtXB).b;
COLOR.a = texture(SCREEN_TEXTURE, newUV).a * maxAlpha;
}