Last active
November 20, 2017 07:27
-
-
Save fand/527a7c334c337cf8f23cf93c29723619 to your computer and use it in GitHub Desktop.
OSC example for VEDA
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
/*{ "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