Skip to content

Instantly share code, notes, and snippets.

@fand
Last active November 20, 2017 07:27
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 fand/527a7c334c337cf8f23cf93c29723619 to your computer and use it in GitHub Desktop.
Save fand/527a7c334c337cf8f23cf93c29723619 to your computer and use it in GitHub Desktop.
OSC example for VEDA
/*{ "osc": 4000 }*/
precision mediump float;
uniform float time;
uniform vec2 resolution;
uniform sampler2D osc_mouse_tx; // /mouse/tx [float]
uniform sampler2D osc_mouse_ty; // /mouse/ty [float]
uniform sampler2D osc_noise; // /noise [float]
uniform sampler2D osc_lfo; // /noise [float]
void main() {
vec2 uv = gl_FragCoord.xy / resolution;
float x = texture2D(osc_mouse_tx, uv).x;
float y = texture2D(osc_mouse_ty, uv).x;
float c = .1 / length(uv - (vec2(x, y) + .5));
gl_FragColor = vec4(c);
float noise = texture2D(osc_noise, uv).x * .5 + .5;
float lfo = texture2D(osc_lfo, uv).x * .5 + .5;
gl_FragColor = vec4(c, noise, lfo, 0);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment