-
-
Save derplak/31848b4f48683e224b616998dec567db to your computer and use it in GitHub Desktop.
OBS RGB Glitch shader
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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