tidying detour + usb rcording + a few other small bits

This commit is contained in:
langolierz
2019-07-02 20:41:51 +00:00
parent 37f2833090
commit 80d4eaa20a
31 changed files with 82 additions and 29 deletions

View File

@@ -0,0 +1,34 @@
//0-input
//written by Tim Caldwell
// a simple example of how to use continuous parameters to perform switching functions
#ifdef GL_ES
precision mediump float;
#endif
uniform float u_time;
uniform float u_x0;
uniform float u_x1;
void main() {
vec3 colour = vec3(0.0,0.0,0.0);
if(u_x0 < (1.0 / 3.0)){
colour[0] = 1.0;
}
else if(u_x0 > (2.0 / 3.0)){
colour[1] = 1.0;
}
else{
colour[2] = 1.0;
}
if(u_x1 < (1.0 / 3.0)){
colour[1] = 1.0;
}
else if(u_x1 > (2.0 / 3.0)){
colour[2] = 1.0;
}
else{
colour[0] = 1.0;
}
gl_FragColor = vec4(colour, 1.0);
}

View File

@@ -0,0 +1,27 @@
// copied from http://glslsandbox.com/e#47821.0
//0-input
#ifdef GL_ES
precision mediump float;
#endif
#extension GL_OES_standard_derivatives : enable
uniform float u_time;
uniform float u_x0;
uniform float u_x1;
uniform float u_x2;
uniform float u_x3;
uniform vec2 u_resolution;
void main( void ) {
vec2 position = ( gl_FragCoord.xy / u_resolution.xy ) + (u_resolution.x, u_resolution.y * (u_x0*0.01)) / 4.0;
float color = 0.0;
color += sin( position.x * cos( u_time / 15.0 ) * 80.0 ) + cos( position.y * cos( u_time / 15.0 ) * 10.0 ) * u_x1;
color += sin( position.y * sin( u_time / 10.0 ) * 40.0 ) + cos( position.x * sin( u_time / 25.0 ) * 40.0 ) * u_x2;
color += sin( position.x * sin( u_time / 5.0 ) * 10.0 ) + sin( position.y * sin( u_time / 35.0 ) * 80.0 ) * u_x3;
color *= sin( u_time / 10.0 ) * 0.8;
gl_FragColor = vec4( vec3( color, color * 0.5 * sin(0.02*u_time) , sin( color + u_time / 3.0 ) * 0.75 ), 1.0 );
}

View File

@@ -0,0 +1,37 @@
//0-input
//written by Ben Caldwell
#ifdef GL_ES
precision mediump float;
#endif
uniform vec2 u_resolution;
uniform float u_time;
uniform float u_x0;
uniform float u_x1;
uniform float u_x2;
uniform float u_x3;
void main() {
vec3 color = vec3(0.0,0.0,0.0);
float mod_time = u_x0 * u_time;
vec2 pos = gl_FragCoord.xy;
vec2 st = gl_FragCoord.xy/u_resolution.xy;
st.x *= u_resolution.x/u_resolution.y;
vec2 s1 = vec2(u_resolution.x*(0.5 + 0.25*cos(mod_time)), u_resolution*(0.5 + 0.25*sin(mod_time)));
vec2 s2 = vec2(u_resolution.x*(0.5 + 0.25*sin(mod_time)), u_resolution*(0.5 + 0.25*cos(mod_time)));
vec2 s3 = vec2(u_resolution.x*0.5, u_resolution*0.5);
float r1 = (pow(pow(pos.x-s1.x,2.0) + pow(pos.y-s1.y,2.0), 0.5))*u_x1;
float r2 = (pow(pow(pos.x-s2.x,2.0) + pow(pos.y-s2.y,2.0), 0.5))*u_x2;
float r3 = (pow(pow(pos.x-s3.x,2.0) + pow(pos.y-s3.y,2.0), 0.5))*u_x3;
color += vec3(0.5 + 0.5*sign(sin((0.1 + 0.05*sin(mod_time+2.0))*r1 - 1.0*mod_time)), 0.0, 0.0);
color += vec3(0.0, 0.0, 0.5 + 0.5*sign(sin((0.1 + 0.05*sin(mod_time))*r2 - 1.2*mod_time)));
color += vec3(0.0, 0.5 + 0.5*sign(sin((0.1 + 0.05*sin(mod_time+0.5))*r3 - 1.1*mod_time)), 0.0);
gl_FragColor = vec4(color,1.);
}

View File

@@ -0,0 +1,26 @@
//0-input
//written by Ben Caldwell
#ifdef GL_ES
precision mediump float;
#endif
uniform vec2 u_resolution;
uniform float u_time;
uniform float u_x0;
uniform float u_x1;
uniform float u_x2;
uniform float u_x3;
void main() {
vec3 color = vec3(0.0,0.0,0.0);
vec2 pos = gl_FragCoord.xy;
vec2 st = gl_FragCoord.xy/u_resolution.xy;
st.x *= u_resolution.x/u_resolution.y;
color += vec3(u_x0*sign(sin(0.05*pos.x - u_time + sin(0.05*pow(pos.y,(0.7 + u_x1)) - u_time))),0.,0.);
color += vec3(0., 0., sign(cos(0.05*pos.x*u_x2 - 2.0*u_time + 5.0*u_x3*sin(0.05*pos.y - 2.0*u_time))));
gl_FragColor = vec4(color,1.);
}

View File

@@ -0,0 +1,26 @@
//0-input
//written by Ben Caldwell
#ifdef GL_ES
precision mediump float;
#endif
uniform vec2 u_resolution;
uniform float u_time;
uniform float u_x0;
uniform float u_x1;
void main() {
float mod_time = u_time*u_x0;
vec2 pos = gl_FragCoord.xy;
vec2 st = gl_FragCoord.xy/u_resolution.xy;
st.x *= u_resolution.x/u_resolution.y;
vec3 color = vec3(0.0,0.0,0.0);
color += vec3(sin(0.7*u_x1*pos.x - cos(u_x0*mod_time)) + cos(0.05*pos.x/(0.1 + abs(cos(mod_time/5.0)))),0.0,0.0);
color += vec3(sin(0.05*pos.y - cos(mod_time/5.0)) + cos(0.5*pos.y/(0.1 + abs(cos(mod_time/5.0)))),0.0,0.0);
color += vec3(0.0, 0.0, sin(mod_time));
gl_FragColor = vec4(color,1.);
}