Created
December 30, 2018 21:04
-
-
Save digitalohm/e0947172ab9724ef793089e2183e777d to your computer and use it in GitHub Desktop.
veda example no longer working
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
/*{ "vertexCount": 100, "midi": true }*/ | |
precision mediump float; | |
attribute float vertexId; | |
uniform float vertexCount; | |
uniform float time; | |
uniform vec2 resolution; | |
varying vec4 v_color; | |
uniform sampler2D midi; | |
uniform sampler2D note; | |
void main() { | |
float i = vertexId + time * 0.01; | |
// float k = texture2D(midi, vec2(181. / 256., 119. / 256.)).x; | |
float k = ( | |
texture2D(note, vec2(120. / 128.)).x * 1. + | |
texture2D(note, vec2(122. / 128.)).x * 2. + | |
texture2D(note, vec2(124. / 128.)).x * 3. + | |
texture2D(note, vec2(125. / 128.)).x | |
) * 20.; | |
float m = ( | |
texture2D(midi, vec2(176. / 256., 119. / 128.)).x * 1. + | |
texture2D(midi, vec2(176. / 256., 118. / 128.)).x * 2. + | |
texture2D(midi, vec2(176. / 256., 117. / 128.)).x * 3. + | |
texture2D(midi, vec2(176. / 256., 116. / 128.)).x | |
) * 20.; | |
vec3 pos = vec3(cos(i * m), sin(i * 9.), cos(i * 2.)); | |
gl_Position = vec4(pos.x, pos.y, pos.z, 1); | |
v_color = vec4(fract(vertexId / 1.), 1,1,1); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment