Skip to content

Instantly share code, notes, and snippets.

@fand fand/osc.frag
Last active Nov 20, 2017

Embed
What would you like to do?
/*{ "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
You can’t perform that action at this time.