Last active
February 2, 2023 22:23
-
-
Save sorskoot/acb6245e6c1ffbb6cc35a4bc3fad03b2 to your computer and use it in GitHub Desktop.
OBS RGB Glitch shader
This file contains hidden or 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