Skip to content

Instantly share code, notes, and snippets.

@sorskoot
Created February 6, 2021 09:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sorskoot/315d0687d4c1e06ebf512cb607dbc7e0 to your computer and use it in GitHub Desktop.
Save sorskoot/315d0687d4c1e06ebf512cb607dbc7e0 to your computer and use it in GitHub Desktop.
Funny little shader to apply to the camera in OBS using the 'user-defined shader' filter
uniform float speed;
uniform float stepsize;
// Default settings in OBS
// speed: 4.0
// stepsize: 2.0
float rand(float co){
return frac(sin(dot(float2(co,co) ,float2(12.9898,78.233))) * 43758.5453);
}
float4 mainImage(VertData v_in) : TARGET
{
float time = elapsed_time * speed;
float x = v_in.uv.x + (sin(v_in.uv.x*50+time)*sin(time)*0.02);
float y = v_in.uv.y + (cos(v_in.uv.y*100+time/2)*cos(time)*0.02);
float2 gl = float2(x,y);
float4 c = image.Sample(textureSampler, gl);
return c;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment