mirror of
https://github.com/cyberboy666/r_e_c_u_r.git
synced 2025-12-13 11:50:12 +01:00
merge with dev
This commit is contained in:
18
Shaders/0-input/rgb_palette.frag
Normal file
18
Shaders/0-input/rgb_palette.frag
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
//0-input
|
||||||
|
//written by Tim Caldwell
|
||||||
|
#ifdef GL_ES
|
||||||
|
precision mediump float;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
uniform vec2 u_resolution;
|
||||||
|
uniform float u_time;
|
||||||
|
varying vec2 v_texcoord;
|
||||||
|
uniform sampler2D u_tex0;
|
||||||
|
uniform float u_x0;
|
||||||
|
uniform float u_x1;
|
||||||
|
uniform float u_x2;
|
||||||
|
uniform float u_x3;
|
||||||
|
|
||||||
|
void main() {
|
||||||
|
gl_FragColor = vec4(u_x0, u_x1, u_x2, u_x3);
|
||||||
|
}
|
||||||
30
Shaders/0-input/spotlight.frag
Normal file
30
Shaders/0-input/spotlight.frag
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
//1-input
|
||||||
|
//written by Tim Caldwell
|
||||||
|
#ifdef GL_ES
|
||||||
|
precision mediump float;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
uniform vec2 u_resolution;
|
||||||
|
uniform float u_time;
|
||||||
|
varying vec2 v_texcoord;
|
||||||
|
uniform sampler2D u_tex0;
|
||||||
|
uniform float u_x0;
|
||||||
|
uniform float u_x1;
|
||||||
|
uniform float u_x2;
|
||||||
|
uniform float u_x3;
|
||||||
|
|
||||||
|
void main() {
|
||||||
|
vec2 pos = v_texcoord;
|
||||||
|
vec4 tex_in = texture2D(u_tex0, pos);
|
||||||
|
float alpha = u_x3 / 10.0;
|
||||||
|
if(u_x3 == 1.0){alpha = 1.0;}
|
||||||
|
vec4 color = vec4(0.0,0.0,0.0, alpha);
|
||||||
|
vec2 pos_norm = gl_FragCoord.xy/ u_resolution.xy;
|
||||||
|
|
||||||
|
if(pow(pos_norm.x - u_x0,2.0) + pow(pos_norm.y - u_x1,2.0) < pow(u_x2,2.0) ){
|
||||||
|
color = vec4(tex_in[0],tex_in[1],tex_in[2], min(tex_in[3], 1.0) );
|
||||||
|
}
|
||||||
|
|
||||||
|
gl_FragColor = color;
|
||||||
|
|
||||||
|
}
|
||||||
76
Shaders/1-input/displace.frag
Normal file
76
Shaders/1-input/displace.frag
Normal file
@@ -0,0 +1,76 @@
|
|||||||
|
precision mediump float;
|
||||||
|
// template : glsl.ergonenous-tones.com
|
||||||
|
|
||||||
|
varying vec2 tcoord; // location
|
||||||
|
uniform sampler2D tex; // texture one
|
||||||
|
uniform sampler2D tex2; // texture two
|
||||||
|
uniform vec2 tres; // size of texture (screen)
|
||||||
|
uniform vec4 fparams; // 4 floats coming in
|
||||||
|
uniform ivec4 iparams; // 4 ints coming in
|
||||||
|
uniform float ftime; // 0.0 to 1.0
|
||||||
|
uniform int itime; // increases when ftime hits 1.0
|
||||||
|
//f0::
|
||||||
|
//f1::
|
||||||
|
//f2::
|
||||||
|
float f0 = mix(0.0, 1.0, fparams[0]);
|
||||||
|
float f1 = mix(0.0, 1.0, fparams[1]);
|
||||||
|
float f2 = mix(0.0, 1.0, fparams[2]);
|
||||||
|
|
||||||
|
float time = float(itime) + ftime;
|
||||||
|
vec2 resolution = tres;
|
||||||
|
|
||||||
|
#define PI 3.1415926538979323846
|
||||||
|
#define TWO_PI 2*PI
|
||||||
|
|
||||||
|
vec3 rgb2hsv(vec3 c)
|
||||||
|
{
|
||||||
|
vec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);
|
||||||
|
vec4 p = mix(vec4(c.bg, K.wz), vec4(c.gb, K.xy), step(c.b, c.g));
|
||||||
|
vec4 q = mix(vec4(p.xyw, c.r), vec4(c.r, p.yzx), step(p.x, c.r));
|
||||||
|
|
||||||
|
float d = q.x - min(q.w, q.y);
|
||||||
|
float e = 1.0e-10;
|
||||||
|
return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), d / (q.x + e), q.x);
|
||||||
|
}
|
||||||
|
|
||||||
|
vec3 hsv2rgb(vec3 c)
|
||||||
|
{
|
||||||
|
vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);
|
||||||
|
vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);
|
||||||
|
return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
vec4 displace(sampler2D tex, vec2 pos){
|
||||||
|
vec4 texColourZoom;
|
||||||
|
vec2 center;
|
||||||
|
|
||||||
|
vec4 color = texture2D(tex, pos);
|
||||||
|
vec3 hsv = rgb2hsv(color.rgb);
|
||||||
|
float hueR = (floor(hsv.x*10.0)/10.0);
|
||||||
|
float angle = (6.28 * hueR) + 6.28 * f1 ;
|
||||||
|
float length = f2*0.05;
|
||||||
|
|
||||||
|
if(hsv.z > 0.5){
|
||||||
|
pos.x = pos.x + length* cos(angle);
|
||||||
|
pos.y = pos.y + length* sin(angle);
|
||||||
|
}
|
||||||
|
if((pos.x < 0.0)||(pos.y < 0.0)||(pos.x > 1.0)||(pos.y > 1.0)){
|
||||||
|
texColourZoom = vec4(0.0);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
texColourZoom = texture2D(tex, pos);
|
||||||
|
}
|
||||||
|
return texColourZoom;
|
||||||
|
}
|
||||||
|
|
||||||
|
void main( void ) {
|
||||||
|
vec4 texColour0;
|
||||||
|
|
||||||
|
vec4 colour;
|
||||||
|
|
||||||
|
colour = displace(tex, tcoord);
|
||||||
|
gl_FragColor = colour;
|
||||||
|
|
||||||
|
}
|
||||||
29
Shaders/1-input/spotlight.frag
Normal file
29
Shaders/1-input/spotlight.frag
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
//1-input
|
||||||
|
//written by Tim Caldwell
|
||||||
|
#ifdef GL_ES
|
||||||
|
precision mediump float;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
uniform vec2 u_resolution;
|
||||||
|
uniform float u_time;
|
||||||
|
varying vec2 v_texcoord;
|
||||||
|
uniform sampler2D u_tex0;
|
||||||
|
uniform float u_x0;
|
||||||
|
uniform float u_x1;
|
||||||
|
uniform float u_x2;
|
||||||
|
uniform float u_x3;
|
||||||
|
|
||||||
|
void main() {
|
||||||
|
vec4 input = texture2D(u_tex0, v_texcoord);
|
||||||
|
vec4 color = vec4(0.0,0.0,0.0, 0.0);
|
||||||
|
vec2 pos = gl_FragCoord.xy/ u_resolution.xy;
|
||||||
|
|
||||||
|
if(pow(pos.x - u_x1,2.0) + pow(pos.y - u_x2,2.0) < pow(u_x0,2.0) ){
|
||||||
|
color = vec4(input.a,input.b,input.c, min(input.d, u_x3) );
|
||||||
|
}
|
||||||
|
// 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 = color;
|
||||||
|
|
||||||
|
}
|
||||||
71
Shaders/2-input/chroma_key.frag
Normal file
71
Shaders/2-input/chroma_key.frag
Normal file
@@ -0,0 +1,71 @@
|
|||||||
|
//2-input
|
||||||
|
#ifdef GL_ES
|
||||||
|
precision mediump float;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
varying vec2 v_texcoord;
|
||||||
|
uniform sampler2D u_tex0;
|
||||||
|
uniform sampler2D u_tex1;
|
||||||
|
uniform vec2 u_resolution;
|
||||||
|
uniform float u_time;
|
||||||
|
uniform float u_x0;
|
||||||
|
uniform float u_x1;
|
||||||
|
uniform float u_x2;
|
||||||
|
uniform float u_x3;
|
||||||
|
|
||||||
|
|
||||||
|
vec3 rgb2hsv(vec3 c)
|
||||||
|
{
|
||||||
|
vec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);
|
||||||
|
vec4 p = mix(vec4(c.bg, K.wz), vec4(c.gb, K.xy), step(c.b, c.g));
|
||||||
|
vec4 q = mix(vec4(p.xyw, c.r), vec4(c.r, p.yzx), step(p.x, c.r));
|
||||||
|
|
||||||
|
float d = q.x - min(q.w, q.y);
|
||||||
|
float e = 1.0e-10;
|
||||||
|
return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), d / (q.x + e), q.x);
|
||||||
|
}
|
||||||
|
|
||||||
|
vec3 hsv2rgb(vec3 c)
|
||||||
|
{
|
||||||
|
vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);
|
||||||
|
vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);
|
||||||
|
return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);
|
||||||
|
}
|
||||||
|
|
||||||
|
vec4 mixChroma0(vec4 texColour0, vec4 texColour1) {
|
||||||
|
vec4 colour;
|
||||||
|
vec3 hsvTexColour0 = rgb2hsv(texColour0.rgb);
|
||||||
|
|
||||||
|
if(u_x2 - u_x0 < hsvTexColour0.x && hsvTexColour0.x < u_x2 + u_x0){colour = texColour0;}
|
||||||
|
else {colour = texColour1;}
|
||||||
|
return colour;
|
||||||
|
}
|
||||||
|
|
||||||
|
vec4 mixChroma1(vec4 texColour0, vec4 texColour1) {
|
||||||
|
vec4 colour;
|
||||||
|
vec3 hsvTexColour1 = rgb2hsv(texColour1.rgb);
|
||||||
|
|
||||||
|
if(u_x2 - u_x0 < hsvTexColour1.x && hsvTexColour1.x < u_x2 + u_x0){colour = texColour1;}
|
||||||
|
else {colour = texColour0;}
|
||||||
|
return colour;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void main() {
|
||||||
|
|
||||||
|
vec2 pos = v_texcoord;
|
||||||
|
vec4 texColour0;
|
||||||
|
vec4 texColour1;
|
||||||
|
|
||||||
|
texColour0 = texture2D(u_tex0, v_texcoord);
|
||||||
|
texColour1 = texture2D(u_tex1, v_texcoord);
|
||||||
|
|
||||||
|
|
||||||
|
vec4 colour;
|
||||||
|
|
||||||
|
if(u_x1 > 0.5){colour = mixChroma0(texColour0, texColour1);}
|
||||||
|
else{colour = mixChroma1(texColour0, texColour1);}
|
||||||
|
|
||||||
|
gl_FragColor = colour;
|
||||||
|
|
||||||
|
}
|
||||||
91
Shaders/2-input/displace2in.frag
Normal file
91
Shaders/2-input/displace2in.frag
Normal file
@@ -0,0 +1,91 @@
|
|||||||
|
precision mediump float;
|
||||||
|
// template : glsl.ergonenous-tones.com
|
||||||
|
|
||||||
|
varying vec2 tcoord; // location
|
||||||
|
uniform sampler2D tex; // texture one
|
||||||
|
uniform sampler2D tex2; // texture two
|
||||||
|
uniform vec2 tres; // size of texture (screen)
|
||||||
|
uniform vec4 fparams; // 4 floats coming in
|
||||||
|
uniform ivec4 iparams; // 4 ints coming in
|
||||||
|
uniform float ftime; // 0.0 to 1.0
|
||||||
|
uniform int itime; // increases when ftime hits 1.0
|
||||||
|
//f0::
|
||||||
|
//f1::
|
||||||
|
//f2::
|
||||||
|
float f0 = mix(0.0, 1.0, fparams[0]);
|
||||||
|
float f1 = mix(0.0, 1.0, fparams[1]);
|
||||||
|
float f2 = mix(0.0, 1.0, fparams[2]);
|
||||||
|
|
||||||
|
float time = float(itime) + ftime;
|
||||||
|
vec2 resolution = tres;
|
||||||
|
|
||||||
|
#define PI 3.1415926538979323846
|
||||||
|
#define TWO_PI 2*PI
|
||||||
|
|
||||||
|
vec3 rgb2hsv(vec3 c)
|
||||||
|
{
|
||||||
|
vec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);
|
||||||
|
vec4 p = mix(vec4(c.bg, K.wz), vec4(c.gb, K.xy), step(c.b, c.g));
|
||||||
|
vec4 q = mix(vec4(p.xyw, c.r), vec4(c.r, p.yzx), step(p.x, c.r));
|
||||||
|
|
||||||
|
float d = q.x - min(q.w, q.y);
|
||||||
|
float e = 1.0e-10;
|
||||||
|
return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), d / (q.x + e), q.x);
|
||||||
|
}
|
||||||
|
|
||||||
|
vec3 hsv2rgb(vec3 c)
|
||||||
|
{
|
||||||
|
vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);
|
||||||
|
vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);
|
||||||
|
return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
vec4 displace(sampler2D tex, vec2 pos){
|
||||||
|
vec4 texColourZoom;
|
||||||
|
vec2 center;
|
||||||
|
|
||||||
|
vec4 color = texture2D(tex, pos);
|
||||||
|
vec3 hsv = rgb2hsv(color.rgb);
|
||||||
|
float hueR = (floor(hsv.x*10.0)/10.0);
|
||||||
|
float angle = (6.28 * hueR) + 6.28 * f1 ;
|
||||||
|
float length = f2*0.05;
|
||||||
|
|
||||||
|
if(hsv.z > 0.5){
|
||||||
|
pos.x = pos.x + length* cos(angle);
|
||||||
|
pos.y = pos.y + length* sin(angle);
|
||||||
|
}
|
||||||
|
if((pos.x < 0.0)||(pos.y < 0.0)||(pos.x > 1.0)||(pos.y > 1.0)){
|
||||||
|
texColourZoom = vec4(0.0);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
texColourZoom = texture2D(tex, pos);
|
||||||
|
}
|
||||||
|
return texColourZoom;
|
||||||
|
}
|
||||||
|
|
||||||
|
vec4 mixBlend(vec4 texColour0, vec4 texColour1) {
|
||||||
|
vec4 colour;
|
||||||
|
colour = texColour0;
|
||||||
|
colour.xyz = (1.0 - f0) * texColour0.xyz + f0 * texColour1.xyz;
|
||||||
|
|
||||||
|
return colour;
|
||||||
|
}
|
||||||
|
|
||||||
|
void main( void ) {
|
||||||
|
vec4 texColour0;
|
||||||
|
vec4 texColour1;
|
||||||
|
|
||||||
|
texColour0 = texture2D(tex, tcoord);
|
||||||
|
texColour1 = displace(tex2, tcoord);
|
||||||
|
|
||||||
|
vec4 colour;
|
||||||
|
|
||||||
|
|
||||||
|
colour = mixBlend(texColour0, texColour1);
|
||||||
|
gl_FragColor = colour;
|
||||||
|
|
||||||
|
|
||||||
|
//gl_FragColor = vec4(rgb, color.a);
|
||||||
|
}
|
||||||
71
Shaders/2-input/luma_key_black.frag
Normal file
71
Shaders/2-input/luma_key_black.frag
Normal file
@@ -0,0 +1,71 @@
|
|||||||
|
//2-input
|
||||||
|
#ifdef GL_ES
|
||||||
|
precision mediump float;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
varying vec2 v_texcoord;
|
||||||
|
uniform sampler2D u_tex0;
|
||||||
|
uniform sampler2D u_tex1;
|
||||||
|
uniform vec2 u_resolution;
|
||||||
|
uniform float u_time;
|
||||||
|
uniform float u_x0;
|
||||||
|
uniform float u_x1;
|
||||||
|
uniform float u_x2;
|
||||||
|
uniform float u_x3;
|
||||||
|
|
||||||
|
|
||||||
|
vec3 rgb2hsv(vec3 c)
|
||||||
|
{
|
||||||
|
vec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);
|
||||||
|
vec4 p = mix(vec4(c.bg, K.wz), vec4(c.gb, K.xy), step(c.b, c.g));
|
||||||
|
vec4 q = mix(vec4(p.xyw, c.r), vec4(c.r, p.yzx), step(p.x, c.r));
|
||||||
|
|
||||||
|
float d = q.x - min(q.w, q.y);
|
||||||
|
float e = 1.0e-10;
|
||||||
|
return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), d / (q.x + e), q.x);
|
||||||
|
}
|
||||||
|
|
||||||
|
vec3 hsv2rgb(vec3 c)
|
||||||
|
{
|
||||||
|
vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);
|
||||||
|
vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);
|
||||||
|
return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);
|
||||||
|
}
|
||||||
|
|
||||||
|
vec4 mixLuma0(vec4 texColour0, vec4 texColour1) {
|
||||||
|
vec4 colour;
|
||||||
|
vec3 hsvTexColour0 = rgb2hsv(texColour0.rgb);
|
||||||
|
|
||||||
|
if(hsvTexColour0.z > u_x0){colour = texColour0;}
|
||||||
|
else {colour = texColour1;}
|
||||||
|
return colour;
|
||||||
|
}
|
||||||
|
|
||||||
|
vec4 mixLuma1(vec4 texColour0, vec4 texColour1) {
|
||||||
|
vec4 colour;
|
||||||
|
vec3 hsvTexColour1 = rgb2hsv(texColour1.rgb);
|
||||||
|
|
||||||
|
if(hsvTexColour1.z > u_x0){colour = texColour1;}
|
||||||
|
else {colour = texColour0;}
|
||||||
|
return colour;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void main() {
|
||||||
|
|
||||||
|
vec2 pos = v_texcoord;
|
||||||
|
vec4 texColour0;
|
||||||
|
vec4 texColour1;
|
||||||
|
|
||||||
|
texColour0 = texture2D(u_tex0, v_texcoord);
|
||||||
|
texColour1 = texture2D(u_tex1, v_texcoord);
|
||||||
|
|
||||||
|
|
||||||
|
vec4 colour;
|
||||||
|
|
||||||
|
if(u_x1 > 0.5){colour = mixLuma0(texColour0, texColour1);}
|
||||||
|
else{colour = mixLuma1(texColour0, texColour1);}
|
||||||
|
|
||||||
|
gl_FragColor = colour;
|
||||||
|
|
||||||
|
}
|
||||||
71
Shaders/2-input/luma_key_white.frag
Normal file
71
Shaders/2-input/luma_key_white.frag
Normal file
@@ -0,0 +1,71 @@
|
|||||||
|
//2-input
|
||||||
|
#ifdef GL_ES
|
||||||
|
precision mediump float;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
varying vec2 v_texcoord;
|
||||||
|
uniform sampler2D u_tex0;
|
||||||
|
uniform sampler2D u_tex1;
|
||||||
|
uniform vec2 u_resolution;
|
||||||
|
uniform float u_time;
|
||||||
|
uniform float u_x0;
|
||||||
|
uniform float u_x1;
|
||||||
|
uniform float u_x2;
|
||||||
|
uniform float u_x3;
|
||||||
|
|
||||||
|
|
||||||
|
vec3 rgb2hsv(vec3 c)
|
||||||
|
{
|
||||||
|
vec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);
|
||||||
|
vec4 p = mix(vec4(c.bg, K.wz), vec4(c.gb, K.xy), step(c.b, c.g));
|
||||||
|
vec4 q = mix(vec4(p.xyw, c.r), vec4(c.r, p.yzx), step(p.x, c.r));
|
||||||
|
|
||||||
|
float d = q.x - min(q.w, q.y);
|
||||||
|
float e = 1.0e-10;
|
||||||
|
return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), d / (q.x + e), q.x);
|
||||||
|
}
|
||||||
|
|
||||||
|
vec3 hsv2rgb(vec3 c)
|
||||||
|
{
|
||||||
|
vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);
|
||||||
|
vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);
|
||||||
|
return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);
|
||||||
|
}
|
||||||
|
|
||||||
|
vec4 mixLuma0(vec4 texColour0, vec4 texColour1) {
|
||||||
|
vec4 colour;
|
||||||
|
vec3 hsvTexColour0 = rgb2hsv(texColour0.rgb);
|
||||||
|
|
||||||
|
if(hsvTexColour0.z < u_x0){colour = texColour0;}
|
||||||
|
else {colour = texColour1;}
|
||||||
|
return colour;
|
||||||
|
}
|
||||||
|
|
||||||
|
vec4 mixLuma1(vec4 texColour0, vec4 texColour1) {
|
||||||
|
vec4 colour;
|
||||||
|
vec3 hsvTexColour1 = rgb2hsv(texColour1.rgb);
|
||||||
|
|
||||||
|
if(hsvTexColour1.z < u_x0){colour = texColour1;}
|
||||||
|
else {colour = texColour0;}
|
||||||
|
return colour;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void main() {
|
||||||
|
|
||||||
|
vec2 pos = v_texcoord;
|
||||||
|
vec4 texColour0;
|
||||||
|
vec4 texColour1;
|
||||||
|
|
||||||
|
texColour0 = texture2D(u_tex0, v_texcoord);
|
||||||
|
texColour1 = texture2D(u_tex1, v_texcoord);
|
||||||
|
|
||||||
|
|
||||||
|
vec4 colour;
|
||||||
|
|
||||||
|
if(u_x1 > 0.5){colour = mixLuma0(texColour0, texColour1);}
|
||||||
|
else{colour = mixLuma1(texColour0, texColour1);}
|
||||||
|
|
||||||
|
gl_FragColor = colour;
|
||||||
|
|
||||||
|
}
|
||||||
10
actions.py
10
actions.py
@@ -564,16 +564,16 @@ class Actions(object):
|
|||||||
self.shaders.set_param_to_amount(3, amount, layer_offset=2)
|
self.shaders.set_param_to_amount(3, amount, layer_offset=2)
|
||||||
|
|
||||||
def set_the_shader_param_0_layer_offset_3_continuous(self, amount):
|
def set_the_shader_param_0_layer_offset_3_continuous(self, amount):
|
||||||
self.shaders.set_param_to_amount(0, amount, layer_offset=2)
|
self.shaders.set_param_to_amount(0, amount, layer_offset=3)
|
||||||
|
|
||||||
def set_the_shader_param_1_layer_offset_3_continuous(self, amount):
|
def set_the_shader_param_1_layer_offset_3_continuous(self, amount):
|
||||||
self.shaders.set_param_to_amount(1, amount, layer_offset=2)
|
self.shaders.set_param_to_amount(1, amount, layer_offset=3)
|
||||||
|
|
||||||
def set_the_shader_param_2_layer_offset_3_continuous(self, amount):
|
def set_the_shader_param_2_layer_offset_3_continuous(self, amount):
|
||||||
self.shaders.set_param_to_amount(2, amount, layer_offset=2)
|
self.shaders.set_param_to_amount(2, amount, layer_offset=3)
|
||||||
|
|
||||||
def set_the_shader_param_3_layer_offset_3_continuous(self, amount):
|
def set_the_shader_param_3_layer_offset_3_continuous(self, amount):
|
||||||
self.shaders.set_param_to_amount(3, amount, layer_offset=2)
|
self.shaders.set_param_to_amount(3, amount, layer_offset=3)
|
||||||
|
|
||||||
def set_strobe_amount_continuous(self, amount):
|
def set_strobe_amount_continuous(self, amount):
|
||||||
scaled_amount = int(amount * 10)
|
scaled_amount = int(amount * 10)
|
||||||
@@ -1017,6 +1017,8 @@ class Actions(object):
|
|||||||
for i in range(1, 4):
|
for i in range(1, 4):
|
||||||
if os.path.exists('/dev/sda{}'.format(i)):
|
if os.path.exists('/dev/sda{}'.format(i)):
|
||||||
subprocess.call(['sudo', 'eject', '/dev/sda{}'.format(i)])
|
subprocess.call(['sudo', 'eject', '/dev/sda{}'.format(i)])
|
||||||
|
self.message_handler.set_message('INFO', 'usb ejected')
|
||||||
|
|
||||||
|
|
||||||
# TODO: make this interrogate the various components for available routes to parse
|
# TODO: make this interrogate the various components for available routes to parse
|
||||||
# this would include eg a custom script module..
|
# this would include eg a custom script module..
|
||||||
|
|||||||
@@ -64,6 +64,22 @@
|
|||||||
"DEFAULT": ["set_strobe_amount_continuous"]
|
"DEFAULT": ["set_strobe_amount_continuous"]
|
||||||
},
|
},
|
||||||
|
|
||||||
|
"control_change 16": {
|
||||||
|
"DEFAULT": ["set_the_shader_param_0_layer_offset_2_continuous"]
|
||||||
|
},
|
||||||
|
"control_change 17": {
|
||||||
|
"DEFAULT": ["set_the_shader_param_1_layer_offset_2_continuous"]
|
||||||
|
},
|
||||||
|
"control_change 18": {
|
||||||
|
"DEFAULT": ["set_the_shader_param_2_layer_offset_2_continuous"]
|
||||||
|
},
|
||||||
|
"control_change 19": {
|
||||||
|
"DEFAULT": ["set_the_shader_param_3_layer_offset_2_continuous"]
|
||||||
|
},
|
||||||
|
"control_change 20": {
|
||||||
|
"DEFAULT": ["set_strobe_amount_continuous"]
|
||||||
|
},
|
||||||
|
|
||||||
"note_on 72": {
|
"note_on 72": {
|
||||||
"NAV_BROWSER": ["move_browser_selection_up", "move_browser_selection_page_up"],
|
"NAV_BROWSER": ["move_browser_selection_up", "move_browser_selection_page_up"],
|
||||||
"DEFAULT": ["seek_back_on_player", "decrease_seek_time"],
|
"DEFAULT": ["seek_back_on_player", "decrease_seek_time"],
|
||||||
@@ -271,6 +287,175 @@
|
|||||||
"note_on 54": {
|
"note_on 54": {
|
||||||
"DEFAULT": ["load_slot_9_into_next_player","confirm_shutdown"],
|
"DEFAULT": ["load_slot_9_into_next_player","confirm_shutdown"],
|
||||||
"PLAY_SHADER": ["play_shader_9","confirm_shutdown"]
|
"PLAY_SHADER": ["play_shader_9","confirm_shutdown"]
|
||||||
|
},
|
||||||
|
|
||||||
|
"control_change 58": {
|
||||||
|
"NAV_BROWSER": ["move_browser_selection_up", "move_browser_selection_page_up"],
|
||||||
|
"DEFAULT": ["seek_back_on_player", "decrease_seek_time"],
|
||||||
|
"NAV_SETTINGS": ["move_settings_selection_up", "move_settings_selection_page_up"],
|
||||||
|
"NAV_SHADERS": ["move_shaders_selection_up", "move_shaders_selection_page_up"],
|
||||||
|
"LENGTH_SET": ["return_to_default_control_mode"],
|
||||||
|
"CONFIRM": ["return_to_default_control_mode"],
|
||||||
|
"SHADER_PARAM": ["decrease_this_param", "decrease_shader_param"],
|
||||||
|
"PLAY_SHADER": ["decrease_this_param", "decrease_shader_param"]
|
||||||
|
},
|
||||||
|
"control_change 59": {
|
||||||
|
"NAV_BROWSER": ["move_browser_selection_down", "move_browser_selection_page_down"],
|
||||||
|
"DEFAULT": ["seek_forward_on_player", "increase_seek_time"],
|
||||||
|
"NAV_SETTINGS": ["move_settings_selection_down", "move_settings_selection_page_down"],
|
||||||
|
"NAV_SHADERS": ["move_shaders_selection_down", "move_shaders_selection_page_down"],
|
||||||
|
"LENGTH_SET": ["return_to_default_control_mode"],
|
||||||
|
"CONFIRM": ["return_to_default_control_mode"],
|
||||||
|
"SHADER_PARAM": ["increase_this_param", "increase_shader_param"],
|
||||||
|
"PLAY_SHADER": ["increase_this_param", "increase_shader_param"]
|
||||||
|
},
|
||||||
|
"control_change 43": {
|
||||||
|
"NAV_BROWSER": ["move_browser_selection_up", "move_browser_selection_page_up"],
|
||||||
|
"DEFAULT": ["seek_back_on_player", "decrease_seek_time"],
|
||||||
|
"NAV_SETTINGS": ["move_settings_selection_up", "move_settings_selection_page_up"],
|
||||||
|
"NAV_SHADERS": ["move_shaders_selection_up", "move_shaders_selection_page_up"],
|
||||||
|
"LENGTH_SET": ["return_to_default_control_mode"],
|
||||||
|
"CONFIRM": ["return_to_default_control_mode"],
|
||||||
|
"SHADER_PARAM": ["decrease_this_param", "decrease_shader_param"],
|
||||||
|
"PLAY_SHADER": ["decrease_this_param", "decrease_shader_param"]
|
||||||
|
},
|
||||||
|
"control_change 44": {
|
||||||
|
"NAV_BROWSER": ["move_browser_selection_down", "move_browser_selection_page_down"],
|
||||||
|
"DEFAULT": ["seek_forward_on_player", "increase_seek_time"],
|
||||||
|
"NAV_SETTINGS": ["move_settings_selection_down", "move_settings_selection_page_down"],
|
||||||
|
"NAV_SHADERS": ["move_shaders_selection_down", "move_shaders_selection_page_down"],
|
||||||
|
"LENGTH_SET": ["return_to_default_control_mode"],
|
||||||
|
"CONFIRM": ["return_to_default_control_mode"],
|
||||||
|
"SHADER_PARAM": ["increase_this_param", "increase_shader_param"],
|
||||||
|
"PLAY_SHADER": ["increase_this_param", "increase_shader_param"]
|
||||||
|
},
|
||||||
|
"control_change 42": {
|
||||||
|
"NAV_BROWSER": ["enter_on_browser_selection"],
|
||||||
|
"DEFAULT": ["toggle_action_on_player","toggle_show_on_player"],
|
||||||
|
"NAV_SETTINGS": ["enter_on_settings_selection"],
|
||||||
|
"NAV_SHADERS": ["enter_on_shaders_selection", "map_on_shaders_selection"],
|
||||||
|
"LENGTH_SET": ["record_fixed_length"],
|
||||||
|
"SHADER_PARAM": ["return_to_default_control_mode"],
|
||||||
|
"CONFIRM": ["perform_confirm_action"],
|
||||||
|
"NAV_DETOUR": ["toggle_detour_play"],
|
||||||
|
"PLAY_SHADER": ["toggle_shaders", "toggle_shader_speed"]
|
||||||
|
},
|
||||||
|
"control_change 41": {
|
||||||
|
"DEFAULT": ["switch_to_next_player", "toggle_player_mode"],
|
||||||
|
"NAV_DETOUR": ["toggle_detour_record", "toggle_detour_record_loop"]
|
||||||
|
},
|
||||||
|
"control_change 61": {
|
||||||
|
"DEFAULT": ["set_playing_sample_start_to_current_duration", "clear_playing_sample_start_time"],
|
||||||
|
"SHADER_PARAM": ["decrease_param_focus"],
|
||||||
|
"PLAY_SHADER": ["decrease_param_focus"],
|
||||||
|
"NAV_DETOUR": ["decrease_mix_shader"]
|
||||||
|
},
|
||||||
|
"control_change 62": {
|
||||||
|
"DEFAULT": ["set_playing_sample_end_to_current_duration", "clear_playing_sample_end_time"],
|
||||||
|
"SHADER_PARAM": ["increase_param_focus"],
|
||||||
|
"PLAY_SHADER": ["increase_param_focus"],
|
||||||
|
"NAV_DETOUR": ["increase_mix_shader"]
|
||||||
|
},
|
||||||
|
"control_change 45": {
|
||||||
|
"DEFAULT": ["toggle_capture_preview", "toggle_capture_recording"]},
|
||||||
|
"control_change 46": {
|
||||||
|
"DEFAULT": ["cycle_display_mode", "cycle_display_mode_back"]
|
||||||
|
},
|
||||||
|
"control_change 60": {
|
||||||
|
"DEFAULT": ["toggle_function"]
|
||||||
|
},
|
||||||
|
"control_change 32": {
|
||||||
|
"DEFAULT": ["load_slot_0_into_next_player","previous_bank"],
|
||||||
|
"PLAY_SHADER": ["play_shader_0","previous_shader_layer"],
|
||||||
|
"NAV_SHADERS": ["play_shader_0","previous_shader_layer"],
|
||||||
|
"NAV_DETOUR": ["switch_to_detour_0", "set_the_detour_mix_0"]
|
||||||
|
},
|
||||||
|
"control_change 33": {
|
||||||
|
"DEFAULT": ["load_slot_1_into_next_player","next_bank"],
|
||||||
|
"PLAY_SHADER": ["play_shader_1","next_shader_layer"],
|
||||||
|
"NAV_SHADERS": ["play_shader_1","next_shader_layer"],
|
||||||
|
"NAV_DETOUR": ["switch_to_detour_1", "set_the_detour_mix_1"]
|
||||||
|
},
|
||||||
|
"control_change 34": {
|
||||||
|
"DEFAULT": ["load_slot_2_into_next_player","clear_all_slots"],
|
||||||
|
"PLAY_SHADER": ["play_shader_2","clear_shader_bank"],
|
||||||
|
"NAV_SHADERS": ["play_shader_2","clear_shader_bank"],
|
||||||
|
"NAV_DETOUR": ["switch_to_detour_2", "clear_this_detour"]
|
||||||
|
},
|
||||||
|
"control_change 35": {
|
||||||
|
"DEFAULT": ["load_slot_3_into_next_player"],
|
||||||
|
"PLAY_SHADER": ["play_shader_3"],
|
||||||
|
"NAV_DETOUR": ["switch_to_detour_3"]
|
||||||
|
},
|
||||||
|
"control_change 36": {
|
||||||
|
"DEFAULT": ["load_slot_4_into_next_player"],
|
||||||
|
"PLAY_SHADER": ["play_shader_4"]
|
||||||
|
},
|
||||||
|
"control_change 37": {
|
||||||
|
"DEFAULT": ["load_slot_5_into_next_player","toggle_screen_mirror"],
|
||||||
|
"PLAY_SHADER": ["play_shader_5", "toggle_screen_mirror"]
|
||||||
|
},
|
||||||
|
"control_change 38": {
|
||||||
|
"DEFAULT": ["load_slot_6_into_next_player","toggle_shaders"],
|
||||||
|
"PLAY_SHADER": ["play_shader_6","toggle_shaders"]
|
||||||
|
},
|
||||||
|
"control_change 39": {
|
||||||
|
"DEFAULT": ["load_slot_7_into_next_player", "toggle_detour_mode"],
|
||||||
|
"PLAY_SHADER": ["play_shader_7","toggle_detour_mode"]
|
||||||
|
},
|
||||||
|
"control_change 48": {
|
||||||
|
"DEFAULT": ["load_slot_8_into_next_player", "toggle_feedback"],
|
||||||
|
"PLAY_SHADER": ["play_shader_8", "toggle_feedback"]
|
||||||
|
},
|
||||||
|
"control_change 49": {
|
||||||
|
"DEFAULT": ["load_slot_9_into_next_player","confirm_shutdown"],
|
||||||
|
"PLAY_SHADER": ["play_shader_9","confirm_shutdown"]
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
"control_change 51": {
|
||||||
|
"DEFAULT": ["toggle_x3_as_speed"]
|
||||||
|
},
|
||||||
|
"control_change 52": {
|
||||||
|
"DEFAULT": ["toggle_feedback"]
|
||||||
|
},
|
||||||
|
"control_change 53": {
|
||||||
|
"DEFAULT": ["toggle_shader_layer_0"]
|
||||||
|
},
|
||||||
|
"control_change 54": {
|
||||||
|
"DEFAULT": ["toggle_shader_layer_1"]
|
||||||
|
},
|
||||||
|
"control_change 55": {
|
||||||
|
"DEFAULT": ["toggle_shader_layer_2"]
|
||||||
|
},
|
||||||
|
"control_change 64": {
|
||||||
|
"DEFAULT": ["play_shader_0"]
|
||||||
|
},
|
||||||
|
"control_change 65": {
|
||||||
|
"DEFAULT": ["play_shader_1"]
|
||||||
|
},
|
||||||
|
"control_change 66": {
|
||||||
|
"DEFAULT": ["play_shader_2"]
|
||||||
|
},
|
||||||
|
"control_change 67": {
|
||||||
|
"DEFAULT": ["play_shader_3"]
|
||||||
|
},
|
||||||
|
"control_change 68": {
|
||||||
|
"DEFAULT": ["play_shader_4"]
|
||||||
|
},
|
||||||
|
"control_change 69": {
|
||||||
|
"DEFAULT": ["play_shader_5"]
|
||||||
|
},
|
||||||
|
"control_change 70": {
|
||||||
|
"DEFAULT": ["play_shader_6"]
|
||||||
|
},
|
||||||
|
"control_change 71": {
|
||||||
|
"DEFAULT": ["play_shader_7"]
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -15,6 +15,34 @@
|
|||||||
"DEFAULT": ["set_the_shader_param_3_layer_offset_0_continuous"],
|
"DEFAULT": ["set_the_shader_param_3_layer_offset_0_continuous"],
|
||||||
"NAV_DETOUR": ["set_detour_end_continuous"]
|
"NAV_DETOUR": ["set_detour_end_continuous"]
|
||||||
},
|
},
|
||||||
|
"/shaderparam4": {
|
||||||
|
"DEFAULT": ["set_the_shader_param_0_layer_offset_1_continuous"]
|
||||||
|
},
|
||||||
|
"/shaderparam5": {
|
||||||
|
"DEFAULT": ["set_the_shader_param_1_layer_offset_1_continuous"]
|
||||||
|
},
|
||||||
|
"/shaderparam6": {
|
||||||
|
"DEFAULT": ["set_the_shader_param_2_layer_offset_1_continuous"]
|
||||||
|
},
|
||||||
|
"/shaderparam7": {
|
||||||
|
"DEFAULT": ["set_the_shader_param_3_layer_offset_1_continuous"]
|
||||||
|
},
|
||||||
|
"/shaderparam8": {
|
||||||
|
"DEFAULT": ["set_the_shader_param_0_layer_offset_2_continuous"]
|
||||||
|
},
|
||||||
|
"/shaderparam9": {
|
||||||
|
"DEFAULT": ["set_the_shader_param_1_layer_offset_2_continuous"]
|
||||||
|
},
|
||||||
|
"/shaderparam10": {
|
||||||
|
"DEFAULT": ["set_the_shader_param_2_layer_offset_2_continuous"]
|
||||||
|
},
|
||||||
|
"/shaderparam11": {
|
||||||
|
"DEFAULT": ["set_the_shader_param_3_layer_offset_2_continuous"]
|
||||||
|
},
|
||||||
|
"/shaderparam12": {
|
||||||
|
"DEFAULT": ["set_strobe_amount_continuous"]
|
||||||
|
},
|
||||||
|
|
||||||
"a": {
|
"a": {
|
||||||
"NAV_BROWSER": ["move_browser_selection_down", "move_browser_selection_page_down"],
|
"NAV_BROWSER": ["move_browser_selection_down", "move_browser_selection_page_down"],
|
||||||
"DEFAULT": ["seek_forward_on_player", "increase_seek_time"],
|
"DEFAULT": ["seek_forward_on_player", "increase_seek_time"],
|
||||||
@@ -121,6 +149,53 @@
|
|||||||
"DEFAULT": ["load_slot_9_into_next_player","confirm_shutdown"],
|
"DEFAULT": ["load_slot_9_into_next_player","confirm_shutdown"],
|
||||||
"PLAY_SHADER": ["play_shader_9","confirm_shutdown"]
|
"PLAY_SHADER": ["play_shader_9","confirm_shutdown"]
|
||||||
},
|
},
|
||||||
|
"toggle_x3": {
|
||||||
|
"DEFAULT": ["toggle_x3_as_speed"]
|
||||||
|
},
|
||||||
|
"feedback": {
|
||||||
|
"DEFAULT": ["toggle_feedback"]
|
||||||
|
},
|
||||||
|
"shader_layer_0": {
|
||||||
|
"DEFAULT": ["toggle_shader_layer_0"]
|
||||||
|
},
|
||||||
|
"shader_layer_1": {
|
||||||
|
"DEFAULT": ["toggle_shader_layer_1"]
|
||||||
|
},
|
||||||
|
"shader_layer_2": {
|
||||||
|
"DEFAULT": ["toggle_shader_layer_2"]
|
||||||
|
},
|
||||||
|
"play_shader_0": {
|
||||||
|
"DEFAULT": ["play_shader_0"]
|
||||||
|
},
|
||||||
|
"play_shader_1": {
|
||||||
|
"DEFAULT": ["play_shader_1"]
|
||||||
|
},
|
||||||
|
"play_shader_2": {
|
||||||
|
"DEFAULT": ["play_shader_2"]
|
||||||
|
},
|
||||||
|
"play_shader_3": {
|
||||||
|
"DEFAULT": ["play_shader_3"]
|
||||||
|
},
|
||||||
|
"play_shader_4": {
|
||||||
|
"DEFAULT": ["play_shader_4"]
|
||||||
|
},
|
||||||
|
"play_shader_5": {
|
||||||
|
"DEFAULT": ["play_shader_5"]
|
||||||
|
},
|
||||||
|
"play_shader_6": {
|
||||||
|
"DEFAULT": ["play_shader_6"]
|
||||||
|
},
|
||||||
|
"play_shader_7": {
|
||||||
|
"DEFAULT": ["play_shader_7"]
|
||||||
|
},
|
||||||
|
"play_shader_8": {
|
||||||
|
"DEFAULT": ["play_shader_8"]
|
||||||
|
},
|
||||||
|
"play_shader_9": {
|
||||||
|
"DEFAULT": ["play_shader_9"]
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
"/volume": {
|
"/volume": {
|
||||||
"DEFAULT": ["modulate_param_0_to_amount_continuous"]
|
"DEFAULT": ["modulate_param_0_to_amount_continuous"]
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -136,7 +136,7 @@ class MidiInput(object):
|
|||||||
self.actions.call_method_name(method_name, norm_message_value)
|
self.actions.call_method_name(method_name, norm_message_value)
|
||||||
except TypeError:
|
except TypeError:
|
||||||
## to support using cc-0 as button presses
|
## to support using cc-0 as button presses
|
||||||
if norm_message_value == 0:
|
if norm_message_value:
|
||||||
self.actions.call_method_name(method_name, None)
|
self.actions.call_method_name(method_name, None)
|
||||||
## only update screen if not continuous - seeing if cc can respond faster if not refreshing screen on every action
|
## only update screen if not continuous - seeing if cc can respond faster if not refreshing screen on every action
|
||||||
if 'continuous' not in message_name:
|
if 'continuous' not in message_name:
|
||||||
|
|||||||
@@ -153,8 +153,11 @@ class OfCapture(object):
|
|||||||
### wait for omx to finish creating video ...
|
### wait for omx to finish creating video ...
|
||||||
if os.path.exists(self.video_dir + 'raw.h264'):
|
if os.path.exists(self.video_dir + 'raw.h264'):
|
||||||
recording_path , recording_name = self.generate_recording_path()
|
recording_path , recording_name = self.generate_recording_path()
|
||||||
|
framerate = 30 # hardcoded in openframeworks code for now
|
||||||
|
if self.capture_type == "piCaptureSd1":
|
||||||
|
framerate = framerate*2 # because picapture is interlaced
|
||||||
try:
|
try:
|
||||||
mp4box_process = subprocess.Popen(['MP4Box', '-add', self.video_dir + 'raw.h264', recording_path])
|
mp4box_process = subprocess.Popen(['MP4Box', '-add', self.video_dir + 'raw.h264:fps={}'.format(framerate), recording_path])
|
||||||
return mp4box_process , recording_name
|
return mp4box_process , recording_name
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(e)
|
print(e)
|
||||||
|
|||||||
@@ -207,7 +207,7 @@ class Shaders(object):
|
|||||||
|
|
||||||
def set_param_layer_to_amount(self, param, layer, amount):
|
def set_param_layer_to_amount(self, param, layer, amount):
|
||||||
if self.data.settings['shader']['X3_AS_SPEED']['value'] == 'enabled' and param == 3:
|
if self.data.settings['shader']['X3_AS_SPEED']['value'] == 'enabled' and param == 3:
|
||||||
self.set_speed_to_amount(amount, layer) #layer_offset=layer-self.data.shader_layer)
|
self.set_speed_layer_to_amount(layer, amount) #layer_offset=layer-self.data.shader_layer)
|
||||||
else:
|
else:
|
||||||
self.selected_param_list[layer][param] = amount
|
self.selected_param_list[layer][param] = amount
|
||||||
self.update_param_layer(param,layer)
|
self.update_param_layer(param,layer)
|
||||||
|
|||||||
Reference in New Issue
Block a user