Samuel Wolffang based rgb shift shader

basic rgb shift shader, have fun with it 

Shader code
shader_type canvas_item;
render_mode unshaded;

uniform sampler2D displace : hint_albedo;
uniform float dispAmt: hint_range(0,0.1);
uniform float abberationAmtX: hint_range(0,1);
uniform float abberationAmtY: hint_range(0,1);
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;
    COLOR.r = texture(SCREEN_TEXTURE, newUV - vec2(abberationAmtX,abberationAmtY)).r; 
    COLOR.g = texture(SCREEN_TEXTURE, newUV).g; 
    COLOR.b = texture(SCREEN_TEXTURE, newUV + vec2(abberationAmtX,abberationAmtY)).b;
    COLOR.a = texture(SCREEN_TEXTURE, newUV).a * maxAlpha;
The shader code and all code snippets in this post are under GNU GPL v.3 license and can be used freely. Images and videos, and assets depicted in those, do not fall under this license. For more info, see our License terms.

More from snesmocha

Undertale Animation Skew

Reupload of outline shader

impact shader

Related shaders

rgb offset shader v2

Tilt-Shift Shader

Tile Based Triangles & Rects


Inline Feedbacks
View all comments