Skip to content

Instantly share code, notes, and snippets.

@sorskoot
Last active February 2, 2023 22:23
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save sorskoot/acb6245e6c1ffbb6cc35a4bc3fad03b2 to your computer and use it in GitHub Desktop.
Save sorskoot/acb6245e6c1ffbb6cc35a4bc3fad03b2 to your computer and use it in GitHub Desktop.
OBS RGB Glitch shader
uniform float speed;
uniform float stepsize;
uniform float amount;
float4 mainImage(VertData v_in) : TARGET
{
float time = elapsed_time*speed;
float glitch = 0;
if( frac(sin(time) * cos(v_in.uv.y*sin(time*1.45))) > amount) glitch=stepsize;
float4 g = image.Sample(textureSampler, float2(v_in.uv.x, v_in.uv.y));
float4 g2 = image.Sample(textureSampler, float2(v_in.uv.x + glitch, v_in.uv.y));
float4 g3 = image.Sample(textureSampler, float2(v_in.uv.x - glitch, v_in.uv.y));
return float4(g3.r,g.g,g2.b,1);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment