diff --git a/default/frag1.glsl b/default/frag1.glsl index ccc64c7..65fd73c 100644 --- a/default/frag1.glsl +++ b/default/frag1.glsl @@ -27,4 +27,4 @@ void main() { } else { fragColor = texture(iTex0, vUV); } -} \ No newline at end of file +} diff --git a/default/frag10.glsl b/default/frag10.glsl index 915b167..d60fc5f 100644 --- a/default/frag10.glsl +++ b/default/frag10.glsl @@ -22,7 +22,7 @@ uniform int iInputFPS2; float s(vec2 uv, float x0, float y0) { return step(x0, uv.x) * step(-x0 - 1, -uv.x) * step(y0, uv.y) * -step(-y0 - 1, -uv.y); + step(-y0 - 1, -uv.y); } const int texts[12][5] = { @@ -49,16 +49,16 @@ void main() { vec2 uv3 = uv1 * 60; vec4 c = vec4(0); - - c += s(uv2,1,2) * texture(iTex7, uv2); - c += s(uv2,2,2) * texture(iTex9, uv2); - c += s(uv2,1,0) * texture(iTex8, uv2); - c += s(uv2,2,0) * texture(iTex10, uv2); + c += s(uv2, 1, 2) * texture(iTex7, uv2); + c += s(uv2, 2, 2) * texture(iTex9, uv2); - c += s(uv2,0,1) * debug(mod(uv2, 1)); - c += s(uv2,1,1) * texture(iTex11, uv2); - c += s(uv2,2,1) * texture(iTex0, uv2); + c += s(uv2, 1, 0) * texture(iTex8, uv2); + c += s(uv2, 2, 0) * texture(iTex10, uv2); + + c += s(uv2, 0, 1) * debug(mod(uv2, 1)); + c += s(uv2, 1, 1) * texture(iTex11, uv2); + c += s(uv2, 2, 1) * texture(iTex0, uv2); float sel = 0; @@ -74,65 +74,65 @@ void main() { float t = 0; f += rect(uv3, vec2(-35, 28.5), vec2(2.1, 0.7)); - t += write_5(uv3, vec2(-37,28), texts[0]); - - if (iInputResolution1.x > 0) { - c += s(uv2,0,2) * texture(iTex5, uv2); + t += write_5(uv3, vec2(-37, 28), texts[0]); + + if (iInputFormat1 == YUYV_FOURCC) { + c += s(uv2, 0, 2) * texture(iTex5, uv2); f += rect(uv3, vec2(-35, 26.75), vec2(2.8, 0.7)); - t += write_int(uv3, vec2(-37.6,26.1), iInputFPS1, 2); - t += write_5(uv3, vec2(-35.1,26.1), texts[8]); + t += write_int(uv3, vec2(-37.6, 26.1), iInputFPS1, 2); + t += write_5(uv3, vec2(-35.1, 26.1), texts[8]); } else { f += rect(uv3, vec2(-35, 26.75), vec2(1.6, 0.7)); - t += write_5(uv3, vec2(-36.5,26.1), texts[9]); + t += write_5(uv3, vec2(-36.5, 26.1), texts[9]); } - - f += rect(uv3, vec2(-35, -11.5), vec2(2.1, 0.7)); - t += write_5(uv3, vec2(-37,-12), texts[1]); - if (iInputResolution2.x > 0) { - c += s(uv2,0,0) * texture(iTex6, uv2); + f += rect(uv3, vec2(-35, -11.5), vec2(2.1, 0.7)); + t += write_5(uv3, vec2(-37, -12), texts[1]); + + if (iInputFormat2 == YUYV_FOURCC) { + c += s(uv2, 0, 0) * texture(iTex6, uv2); f += rect(uv3, vec2(-35, -13.25), vec2(2.8, 0.7)); - t += write_int(uv3, vec2(-37.6,-13.9), iInputFPS2, 2); - t += write_5(uv3, vec2(-35.1,-13.9), texts[8]); + t += write_int(uv3, vec2(-37.6, -13.9), iInputFPS2, 2); + t += write_5(uv3, vec2(-35.1, -13.9), texts[8]); } else { f += rect(uv3, vec2(-35, -13.25), vec2(1.6, 0.7)); - t += write_5(uv3, vec2(-36.5,-13.9), texts[9]); + t += write_5(uv3, vec2(-36.5, -13.9), texts[9]); } f += rect(uv3, vec2(-35, 8.5), vec2(2.1, 0.7)); if (iDemo > 0) { - t += write_5(uv3, vec2(-37,8), texts[10]); + t += write_5(uv3, vec2(-37, 8), texts[10]); } else { - t += write_5(uv3, vec2(-37,8), texts[11]); + t += write_5(uv3, vec2(-37, 8), texts[11]); } f += rect(uv3, vec2(0, 28.5), vec2(2.6, 0.7)); f += iActive1 == 1 ? h_rect(uv3, vec2(0, 28.5), vec2(3, 1), 0.2) : 0; - t += write_5(uv3, vec2(-2.5,28), texts[2]); + t += write_5(uv3, vec2(-2.5, 28), texts[2]); f += rect(uv3, vec2(0, -11.5), vec2(2.6, 0.7)); f += iActive1 == 2 ? h_rect(uv3, vec2(0, -11.5), vec2(3, 1), 0.2) : 0; - t += write_5(uv3, vec2(-2.5,-12), texts[3]); + t += write_5(uv3, vec2(-2.5, -12), texts[3]); f += rect(uv3, vec2(35, 28.5), vec2(2.1, 0.7)); f += iActive2 == 1 ? h_rect(uv3, vec2(35, 28.5), vec2(2.5, 1), 0.2) : 0; - t += write_5(uv3, vec2(33,28), texts[4]); + t += write_5(uv3, vec2(33, 28), texts[4]); f += rect(uv3, vec2(35, -11.5), vec2(2.1, 0.7)); f += iActive2 == 2 ? h_rect(uv3, vec2(35, -11.5), vec2(2.5, 1), 0.2) : 0; - t += write_5(uv3, vec2(33,-12), texts[5]); + t += write_5(uv3, vec2(33, -12), texts[5]); f += rect(uv3, vec2(0, 8.5), vec2(1.6, 0.7)); - t += write_5(uv3, vec2(-1.5,8), texts[6]); + t += write_5(uv3, vec2(-1.5, 8), texts[6]); f += rect(uv3, vec2(35, 8.5), vec2(1.6, 0.7)); f += iActive2 == 3 ? h_rect(uv3, vec2(35, 8.5), vec2(2, 1), 0.2) : 0; - t += write_5(uv3, vec2(33.5,8), texts[7]); + t += write_5(uv3, vec2(33.5, 8), texts[7]); f += rect(uv3, vec2(35, 6.75), vec2(2.8, 0.7)); - t += write_int(uv3, vec2(32.4,6.1), iFPS, 2); - t += write_5(uv3, vec2(34.9,6.1), texts[8]); + t += write_int(uv3, vec2(32.4, 6.1), iFPS, 2); + t += write_5(uv3, vec2(34.9, 6.1), texts[8]); fragColor = mix(c, vec4(min(1, f) - t), min(1, f)); -} \ No newline at end of file +} diff --git a/default/frag2.glsl b/default/frag2.glsl index fae1b37..d0843c5 100644 --- a/default/frag2.glsl +++ b/default/frag2.glsl @@ -27,4 +27,4 @@ void main() { } else { fragColor = texture(iTex0, vUV); } -} \ No newline at end of file +} diff --git a/default/frag3.glsl b/default/frag3.glsl index a51ac72..75d7539 100644 --- a/default/frag3.glsl +++ b/default/frag3.glsl @@ -17,4 +17,4 @@ uniform vec3 iMidi1_1[6]; void main() { fragColor = src_stage(vUV, iSeed3, iMidi1_1[0], iMidi1_1[1].xy, iMidi1_1[2], iMidi1_1[3].xy, iMidi1_1[4], iMidi1_1[5].xy); -} \ No newline at end of file +} diff --git a/default/frag4.glsl b/default/frag4.glsl index 0ca4ef1..f8c7fce 100644 --- a/default/frag4.glsl +++ b/default/frag4.glsl @@ -16,4 +16,4 @@ uniform vec3 iMidi1_2[6]; void main() { fragColor = src_stage(vUV, iSeed4, iMidi1_2[0], iMidi1_2[1].xy, iMidi1_2[2], iMidi1_2[3].xy, iMidi1_2[4], iMidi1_2[5].xy); -} \ No newline at end of file +} diff --git a/default/frag5.glsl b/default/frag5.glsl index 379b6df..a010cd9 100644 --- a/default/frag5.glsl +++ b/default/frag5.glsl @@ -18,4 +18,4 @@ uniform vec3 iMidi2_1[7]; void main() { fragColor = fx_stage(vUV, iTex7, iTex9, iSeed5, iMidi2_1[0], iMidi2_1[1].xy, iMidi2_1[2], iMidi2_1[3].xy, iMidi2_1[4], iMidi2_1[5].xy, iMidi2_1[6]); -} \ No newline at end of file +} diff --git a/default/frag6.glsl b/default/frag6.glsl index df42534..c341848 100644 --- a/default/frag6.glsl +++ b/default/frag6.glsl @@ -18,4 +18,4 @@ uniform vec3 iMidi2_2[7]; void main() { fragColor = fx_stage(vUV, iTex8, iTex10, iSeed6, iMidi2_2[0], iMidi2_2[1].xy, iMidi2_2[2], iMidi2_2[3].xy, iMidi2_2[4], iMidi2_2[5].xy, iMidi2_2[6]); -} \ No newline at end of file +} diff --git a/default/frag7.glsl b/default/frag7.glsl index d891c09..5295ef0 100644 --- a/default/frag7.glsl +++ b/default/frag7.glsl @@ -30,8 +30,8 @@ void main() { mix_value = mix(mix_value, mix_value * 0.9 + 0.05, iDemo); if (mix_type) { - fragColor = mix(color_a, color_b, step(mix_value, k)); + fragColor = mix(color_a, color_b, step(mix_value, k)); } else { fragColor = mix(color_b, color_a, mix_value); } -} \ No newline at end of file +} diff --git a/default/frag9.glsl b/default/frag9.glsl index 39eb1b5..a7a1e61 100644 --- a/default/frag9.glsl +++ b/default/frag9.glsl @@ -10,4 +10,4 @@ uniform sampler2D iTex0; void main() { fragColor = texture(iTex0, vUV); -} \ No newline at end of file +} diff --git a/default/inc_cp437.glsl b/default/inc_cp437.glsl index a0b13bf..bb4cc76 100644 --- a/default/inc_cp437.glsl +++ b/default/inc_cp437.glsl @@ -94,7 +94,7 @@ const int cp437[] = { 0xE333, 0x1333, 0x0ECC, 0x0100, // 0x59, Y 0x813F, 0x1367, 0x0F6C, 0x0764, // 0x5A, Z 0x666E, 0x0001, 0x0E66, 0x0100, // 0x5B, [ - 0x8C63, 0x1000, 0x0000, 0x0463, // 0x5C, + 0x8C63, 0x1000, 0x0000, 0x0463, // 0x5C, 0x888E, 0x1111, 0x0E88, 0x0111, // 0x5D, ] 0x36C8, 0x6310, 0x0000, 0x0000, // 0x5E, ^ 0x0000, 0x0000, 0xF000, 0xF000, // 0x5F, _ @@ -392,7 +392,7 @@ int read(sampler2D tex, vec2 uv, float k, int d, float t) vec2 tex_uv = floor(uv * k) * inv_k; tex_uv += vec2(d % 2, floor(d * 0.5)) * 0.5 * inv_k; return - ((mean(reframe(tex, tex_uv + vec2(0, 3) * inv_k * 0.125)) > t) ? 1 : 0) + + ((mean(reframe(tex, tex_uv + vec2(0, 3) * inv_k * 0.125)) > t) ? 1 : 0) + ((mean(reframe(tex, tex_uv + vec2(0, 2) * inv_k * 0.125)) > t) ? 2 : 0) + ((mean(reframe(tex, tex_uv + vec2(0, 1) * inv_k * 0.125)) > t) ? 4 : 0) + ((mean(reframe(tex, tex_uv + vec2(0, 0) * inv_k * 0.125)) > t) ? 8 : 0) + @@ -411,7 +411,7 @@ int read(sampler2D tex, vec2 uv, float k, int d, float t) } // https://web.archive.org/web/20151229003112/http://blogs.msdn.com/b/jeuge/archive/2005/06/08/hakmem-bit-count.aspx -int bit_count(int u) +int bit_count(int u) { int c; c = u - ((u >> 1) & 033333333333) - ((u >> 2) & 011111111111); @@ -424,7 +424,7 @@ int guess_char(sampler2D tex, vec2 uv, float k, float t) int b1 = read(tex, uv, k, 1, t); int b2 = read(tex, uv, k, 2, t); int b3 = read(tex, uv, k, 3, t); - + int mc = 0; int mb = 100; int i; @@ -444,4 +444,4 @@ int guess_char(sampler2D tex, vec2 uv, float k, float t) return mc; } -#endif \ No newline at end of file +#endif diff --git a/default/inc_debug.glsl b/default/inc_debug.glsl index 743dd63..9258357 100644 --- a/default/inc_debug.glsl +++ b/default/inc_debug.glsl @@ -126,7 +126,7 @@ vec4 debug(vec2 vUV) vec2 uv3 = uv1 * 30; // base frame - float f = + float f = h_rect(uv2, vec2(-5, -2), vec2(1), 0.1) + h_rect(uv2, vec2(-2, -2), vec2(1), 0.1) + rect(uv2, vec2(-3.5, -2), vec2(0.5, 0.1)) + @@ -143,7 +143,7 @@ vec4 debug(vec2 vUV) rect(uv2, vec2(6.8, 0), vec2(0.75, 0.1)) + h_circle(uv2, vec2(7.8, 0), 0.3, 0.1) ; - + if (iDemo < 1 && iInputFormat1 == YUYV_FOURCC) { f += circle(uv2, vec2(-9, 2), 0.3); } @@ -258,4 +258,4 @@ vec4 debug(vec2 vUV) return vec4(f); } -#endif \ No newline at end of file +#endif diff --git a/default/inc_functions.glsl b/default/inc_functions.glsl index 73853c8..e252ad7 100644 --- a/default/inc_functions.glsl +++ b/default/inc_functions.glsl @@ -188,10 +188,10 @@ vec2 v_pos(float i) { float x0 = rand(i + 823 + iTimeId); float y0 = rand(i + 328 + iTimeId); - + float x1 = rand(i + 823 + iTimeId + 1); float y1 = rand(i + 328 + iTimeId + 1); - + return vec2( mix(x0, x1, ease(ease(iTimeV))), mix(y0, y1, ease(ease(iTimeV))) @@ -257,13 +257,13 @@ float line(vec2 uv, vec2 p1, vec2 p2, float thick) { vec2 p = p2 - p1; uv -= p1; vec2 k; - + if (abs(p.y) > abs(p.x)) { k = vec2( uv.x - p.x * uv.y / p.y, uv.y / p.y ); - + return step(k.x, thick * 0.5) * step(-k.x, thick * 0.5) * step(k.y, 1) @@ -273,7 +273,7 @@ float line(vec2 uv, vec2 p1, vec2 p2, float thick) { uv.x / p.x, uv.y - p.y * uv.x / p.x ); - + return step(k.y, thick * 0.5) * step(-k.y, thick * 0.5) * step(k.x, 1) diff --git a/default/inc_fx.glsl b/default/inc_fx.glsl index 92d316e..e8aa96a 100644 --- a/default/inc_fx.glsl +++ b/default/inc_fx.glsl @@ -60,9 +60,9 @@ vec4 fx_shift(vec2 vUV, sampler2D src0, sampler2D src1, int seed, vec3 b1, vec2 float y_shift = magic(f3, b3, seed + 30); // logic - + vec3 c0 = texture(src0, uv0).xyz; - + vec2 uv2 = uv1; uv2 = mix(uv2 * (1 + zoom * 2), uv2 * (zoom), step(0.5, zoom)); uv2 += vec2(x_shift * ratio, y_shift) * 2; @@ -127,7 +127,7 @@ subroutine(fx_stage_sub) vec4 fx_5(vec2 vUV, sampler2D previous, sampler2D feedb // logic vec3 c0 = texture(previous, uv0).xyz; - + vec2 uv2 = uv1; float pixel = (1 - pixel_size) * 250 + 25; uv2 = round(uv2 * pixel) / pixel; @@ -199,9 +199,9 @@ subroutine(fx_stage_sub) vec4 fx_7(vec2 vUV, sampler2D previous, sampler2D feedb float zoom = magic(f3, b3, seed + 30); // logic - + vec3 c0 = texture(previous, uv0).xyz; - + vec2 uv2 = uv1; float k1 = lens_v * 0.5; uv2 *= 1 + zoom * 2; @@ -235,9 +235,9 @@ subroutine(fx_stage_sub) vec4 fx_8(vec2 vUV, sampler2D previous, sampler2D feedb // logic vec3 c0 = texture(previous, uv0).xyz; - + vec2 uv2 = uv1; - uv2 = mix(uv2, kal2(uv2 * rot(0.25), floor(axes * 9 + 1)) * vec2(1, -2) + vec2(0, -0.5), axes_trigger); + uv2 = mix(uv2, kal2(uv2 * rot(0.25), floor(axes * 9 + 1)) * vec2(1, -2) + vec2(0, -0.5), axes_trigger); uv2 *= rot(rotation); uv2.x = (saw(uv2.x / ratio + 0.5 + h_scroll * 2) - 0.5) * ratio; vec3 c = reframe(previous, uv2).xyz; @@ -262,12 +262,12 @@ subroutine(fx_stage_sub) vec4 fx_9(vec2 vUV, sampler2D previous, sampler2D feedb vec2 charset = magic_f(f2, b2, seed + 20); vec3 charset_ctrl = magic_b(b2, seed + 20); float char_delta = magic(f3, b3, seed + 30); - float t = magic(seed + 40); + float t = magic(seed + 40); // logic vec3 c0 = texture(previous, uv0).xyz; - + vec2 uv2 = uv1; float k1 = 100 * (1 - zoom) + 10; float inv_k = 1 / k1; @@ -306,7 +306,7 @@ subroutine(fx_stage_sub) vec4 fx_10(vec2 vUV, sampler2D previous, sampler2D feed // logic vec3 c0 = texture(previous, uv0).xyz; - + vec2 uv2 = uv1; uv2 *= 1 + zoom * 2; uv2 = lens(uv2, -lens_v2 * 10, lens_v1 * 10); @@ -331,7 +331,7 @@ subroutine(fx_stage_sub) vec4 fx_11(vec2 vUV, sampler2D previous, sampler2D feed float angle = magic(f3, b3, seed + 30); // logic - + vec3 c0 = texture(previous, uv0).xyz; vec2 uv2 = uv1; @@ -363,7 +363,7 @@ subroutine(fx_stage_sub) vec4 fx_12(vec2 vUV, sampler2D previous, sampler2D feed float fb = magic(f3, b3, seed + 30); // logic - + vec3 c0 = texture(previous, uv0).xyz; vec2 uv2 = uv1; @@ -452,7 +452,7 @@ subroutine(fx_stage_sub) vec4 fx_12(vec2 vUV, sampler2D previous, sampler2D feed } else if (rule == 11) { // B4678/S35678 (Anneal) alive = n >= 6 || !alive && n == 4 || alive && (n == 3 || n == 5); } - + vec3 cout = vec3(alive ? 1 : 0); return fx_master(c0, cout, seed, m0); @@ -559,4 +559,4 @@ subroutine(fx_stage_sub) vec4 fx_15(vec2 vUV, sampler2D previous, sampler2D feed } } -#endif \ No newline at end of file +#endif diff --git a/default/inc_magic.glsl b/default/inc_magic.glsl index 7d6da9d..bf08bab 100644 --- a/default/inc_magic.glsl +++ b/default/inc_magic.glsl @@ -74,4 +74,4 @@ float magic_reverse(float i) return magic_reverse(vec2(0), vec3(0, 0, 1), i); } -#endif \ No newline at end of file +#endif diff --git a/default/inc_rand.glsl b/default/inc_rand.glsl index d6c6449..138b2f9 100644 --- a/default/inc_rand.glsl +++ b/default/inc_rand.glsl @@ -11,4 +11,4 @@ float rand(vec2 n){ return rand(n.x * 1234 + n.y * 9876); } -#endif \ No newline at end of file +#endif diff --git a/default/inc_res.glsl b/default/inc_res.glsl index 8e95ccf..843597d 100644 --- a/default/inc_res.glsl +++ b/default/inc_res.glsl @@ -4,4 +4,4 @@ uniform vec2 iResolution; uniform vec2 iTexResolution; -#endif \ No newline at end of file +#endif diff --git a/default/inc_sentences.glsl b/default/inc_sentences.glsl index 14b4f84..7fdb0eb 100644 --- a/default/inc_sentences.glsl +++ b/default/inc_sentences.glsl @@ -26,4 +26,4 @@ const int sentences[SENTENCE_COUNT][20] = { const int lengths[SENTENCE_COUNT] = { 5, 5, 10, 6, 2, 9, 10, 7, 18, 14, 4, 9, 10, 1, 6, 11, 11 }; -#endif \ No newline at end of file +#endif diff --git a/default/inc_src.glsl b/default/inc_src.glsl index de7da35..b770c17 100644 --- a/default/inc_src.glsl +++ b/default/inc_src.glsl @@ -8,8 +8,8 @@ uniform int iDemo; uniform sampler2D iTex0; -uniform sampler2D iTex3; -uniform sampler2D iTex4; +uniform sampler2D iTex5; +uniform sampler2D iTex6; subroutine vec4 src_stage_sub(vec2 vUV, int seed, vec3 b1, vec2 f1, vec3 b2, vec2 f2, vec3 b3, vec2 f3); @@ -17,7 +17,7 @@ vec4 src_thru(vec2 vUV, sampler2D tex, int seed, vec3 b1, vec2 f1, vec3 b2, vec2 { // start - vec2 uv0 = vUV.st; + vec2 uv0 = vUV.st; // controls @@ -36,21 +36,21 @@ vec4 src_thru(vec2 vUV, sampler2D tex, int seed, vec3 b1, vec2 f1, vec3 b2, vec2 // output - return vec4(c, 1.); + return vec4(c, 1.); } // SRC 1: feedback + thru -subroutine(src_stage_sub) vec4 src_1(vec2 vUV, int seed, vec3 b1, vec2 f1, vec3 b2, vec2 f2, vec3 b3, vec2 f3) +subroutine ( src_stage_sub ) vec4 src_1(vec2 vUV, int seed, vec3 b1, vec2 f1, vec3 b2, vec2 f2, vec3 b3, vec2 f3) { return src_thru(vUV, iTex0, seed, b1, f1, b2, f2, b3, f3); } // SRC 2 : lines -subroutine(src_stage_sub) vec4 src_2(vec2 vUV, int seed, vec3 b1, vec2 f1, vec3 b2, vec2 f2, vec3 b3, vec2 f3) +subroutine ( src_stage_sub ) vec4 src_2(vec2 vUV, int seed, vec3 b1, vec2 f1, vec3 b2, vec2 f2, vec3 b3, vec2 f3) { // start - vec2 uv0 = vUV.st; + vec2 uv0 = vUV.st; float ratio = iResolution.x / iResolution.y; vec2 uv1 = (uv0 - .5) * vec2(ratio, 1); @@ -68,16 +68,16 @@ subroutine(src_stage_sub) vec4 src_2(vec2 vUV, int seed, vec3 b1, vec2 f1, vec3 float k = thickness * 2; uv2.y = cmod(uv2.y, k * 2 + 0.1); float f = istep(k * 0.125 + 0.05, uv2.y) * istep(k * 0.125 + 0.01, -uv2.y); - + return vec4(f); } // SRC 3 : dots -subroutine(src_stage_sub) vec4 src_3(vec2 vUV, int seed, vec3 b1, vec2 f1, vec3 b2, vec2 f2, vec3 b3, vec2 f3) +subroutine ( src_stage_sub ) vec4 src_3(vec2 vUV, int seed, vec3 b1, vec2 f1, vec3 b2, vec2 f2, vec3 b3, vec2 f3) { // start - vec2 uv0 = vUV.st; + vec2 uv0 = vUV.st; float ratio = iResolution.x / iResolution.y; vec2 uv1 = (uv0 - .5) * vec2(ratio, 1); @@ -97,16 +97,16 @@ subroutine(src_stage_sub) vec4 src_3(vec2 vUV, int seed, vec3 b1, vec2 f1, vec3 float k = zoom * 0.1 + 0.05; uv2 = cmod(uv2, k * 2); float f = istep(k / (1 + length(uv1) * 2), length(uv2)); - + return vec4(f); } // SRC 4 : circuit -subroutine(src_stage_sub) vec4 src_4(vec2 vUV, int seed, vec3 b1, vec2 f1, vec3 b2, vec2 f2, vec3 b3, vec2 f3) +subroutine ( src_stage_sub ) vec4 src_4(vec2 vUV, int seed, vec3 b1, vec2 f1, vec3 b2, vec2 f2, vec3 b3, vec2 f3) { // start - vec2 uv0 = vUV.st; + vec2 uv0 = vUV.st; float ratio = iResolution.x / iResolution.y; vec2 uv1 = (uv0 - .5) * vec2(ratio, 1); @@ -199,12 +199,12 @@ subroutine(src_stage_sub) vec4 src_4(vec2 vUV, int seed, vec3 b1, vec2 f1, vec3 f += line(uv1, vec2(-t * 2), vec2(t * 2), t); f += line(uv1, vec2(-t * 2, t * 2), vec2(t * 2, -t * 2), t); } else if (k < 50) { // inductor - f += istep(t * 2, length(uv1 - vec2(t * 2.5,0))); - f += istep(t * 2, length(uv1 - vec2(0,0))); - f += istep(t * 2, length(uv1 - vec2(-t * 2.5,0))); - f -= 2 * istep(t, length(uv1 - vec2(t * 2.5,0))); - f -= 2 * istep(t, length(uv1 - vec2(0,0))); - f -= 2 * istep(t, length(uv1 - vec2(-t * 2.5,0))); + f += istep(t * 2, length(uv1 - vec2(t * 2.5, 0))); + f += istep(t * 2, length(uv1 - vec2(0, 0))); + f += istep(t * 2, length(uv1 - vec2(-t * 2.5, 0))); + f -= 2 * istep(t, length(uv1 - vec2(t * 2.5, 0))); + f -= 2 * istep(t, length(uv1 - vec2(0, 0))); + f -= 2 * istep(t, length(uv1 - vec2(-t * 2.5, 0))); f *= step(-t * 0.5, uv1.y); } else if (k < 60) { // switch f += istep(t, length(uv1 - vec2(t * 2.5, 0))); @@ -229,16 +229,16 @@ subroutine(src_stage_sub) vec4 src_4(vec2 vUV, int seed, vec3 b1, vec2 f1, vec3 f += line(uv1, vec2(t * 0.25, -t * 3.25), vec2(-t * 3, -t), t); } } - + return vec4(f); } // SRC 5 : noise -subroutine(src_stage_sub) vec4 src_5(vec2 vUV, int seed, vec3 b1, vec2 f1, vec3 b2, vec2 f2, vec3 b3, vec2 f3) +subroutine ( src_stage_sub ) vec4 src_5(vec2 vUV, int seed, vec3 b1, vec2 f1, vec3 b2, vec2 f2, vec3 b3, vec2 f3) { // start - vec2 uv0 = vUV.st; + vec2 uv0 = vUV.st; float ratio = iResolution.x / iResolution.y; vec2 uv1 = (uv0 - .5) * vec2(ratio, 1); @@ -259,28 +259,28 @@ subroutine(src_stage_sub) vec4 src_5(vec2 vUV, int seed, vec3 b1, vec2 f1, vec3 f = sin(f * PI * (details * 20)) * 0.5 + 1; int nf = int(noise_factor * 6); f *= mix(1, noise_f(uv2, nf - 1), step(0.0, float(nf))); - + return vec4(f); } // SRC 6 : video in 1 + thru -subroutine(src_stage_sub) vec4 src_6(vec2 vUV, int seed, vec3 b1, vec2 f1, vec3 b2, vec2 f2, vec3 b3, vec2 f3) +subroutine ( src_stage_sub ) vec4 src_6(vec2 vUV, int seed, vec3 b1, vec2 f1, vec3 b2, vec2 f2, vec3 b3, vec2 f3) { if (iDemo > 0) { return src_2(vUV, seed, b1, f1, b2, f2, b3, f3); } - return src_thru(vUV, iTex3, seed, b1, f1, b2, f2, b3, f3); + return src_thru(vUV, iTex5, seed, b1, f1, b2, f2, b3, f3); } #include inc_cp437.glsl // SRC 7 : cp437 -subroutine(src_stage_sub) vec4 src_7(vec2 vUV, int seed, vec3 b1, vec2 f1, vec3 b2, vec2 f2, vec3 b3, vec2 f3) +subroutine ( src_stage_sub ) vec4 src_7(vec2 vUV, int seed, vec3 b1, vec2 f1, vec3 b2, vec2 f2, vec3 b3, vec2 f3) { // start - vec2 uv0 = vUV.st; + vec2 uv0 = vUV.st; float ratio = iResolution.x / iResolution.y; vec2 uv1 = (uv0 - .5) * vec2(ratio, 1); @@ -304,7 +304,7 @@ subroutine(src_stage_sub) vec4 src_7(vec2 vUV, int seed, vec3 b1, vec2 f1, vec3 int code = ((charset_ctrl.y < 1 || (uv2i.x % 2 ^ uv2i.y % 2) > 0) ? 1 : 0) * (start_char + int((rand(uv2i) + char_delta) * char_span) % char_span); uv2 = mod(uv2, 1); float f = char(uv2, code) ? 1 : 0; - + return vec4(f); } @@ -312,11 +312,11 @@ subroutine(src_stage_sub) vec4 src_7(vec2 vUV, int seed, vec3 b1, vec2 f1, vec3 #include inc_sentences.glsl -subroutine(src_stage_sub) vec4 src_8(vec2 vUV, int seed, vec3 b1, vec2 f1, vec3 b2, vec2 f2, vec3 b3, vec2 f3) +subroutine ( src_stage_sub ) vec4 src_8(vec2 vUV, int seed, vec3 b1, vec2 f1, vec3 b2, vec2 f2, vec3 b3, vec2 f3) { // start - vec2 uv0 = vUV.st; + vec2 uv0 = vUV.st; float ratio = iResolution.x / iResolution.y; vec2 uv1 = (uv0 - .5) * vec2(ratio, 1); @@ -336,16 +336,16 @@ subroutine(src_stage_sub) vec4 src_8(vec2 vUV, int seed, vec3 b1, vec2 f1, vec3 uv2.x += floor(uv2.y) * (h_delta - 0.5) * 2; uv2.y = mix(uv2.y, mod(uv2.y, 1), h_delta_b.x); float f = write_20(uv2, vec2(-float(lengths[s]) * 0.5, 0), sentences[s]); - + return vec4(f); } // SRC 9 : sentences repeat -subroutine(src_stage_sub) vec4 src_9(vec2 vUV, int seed, vec3 b1, vec2 f1, vec3 b2, vec2 f2, vec3 b3, vec2 f3) +subroutine ( src_stage_sub ) vec4 src_9(vec2 vUV, int seed, vec3 b1, vec2 f1, vec3 b2, vec2 f2, vec3 b3, vec2 f3) { - // start + // start - vec2 uv0 = vUV.st; + vec2 uv0 = vUV.st; float ratio = iResolution.x / iResolution.y; vec2 uv1 = (uv0 - .5) * vec2(ratio, 1); @@ -376,11 +376,11 @@ subroutine(src_stage_sub) vec4 src_9(vec2 vUV, int seed, vec3 b1, vec2 f1, vec3 } // SRC 10 : isometric grid -subroutine(src_stage_sub) vec4 src_10(vec2 vUV, int seed, vec3 b1, vec2 f1, vec3 b2, vec2 f2, vec3 b3, vec2 f3) +subroutine ( src_stage_sub ) vec4 src_10(vec2 vUV, int seed, vec3 b1, vec2 f1, vec3 b2, vec2 f2, vec3 b3, vec2 f3) { // start - vec2 uv0 = vUV.st; + vec2 uv0 = vUV.st; float ratio = iResolution.x / iResolution.y; vec2 uv1 = (uv0 - .5) * vec2(ratio, 1); @@ -408,7 +408,7 @@ subroutine(src_stage_sub) vec4 src_10(vec2 vUV, int seed, vec3 b1, vec2 f1, vec3 vec2 u2 = mod(floor(uv3 + vec2(0, 1)), umax); vec2 u3 = mod(floor(uv3 + vec2(-1, 0)), umax); vec2 u4 = mod(floor(uv3 + vec2(0, -1)), umax); - + float e0 = (rand(floor(u0)) * 2 - 1) * max_elevation; float e1 = (rand(floor(u1)) * 2 - 1) * max_elevation; float e2 = (rand(floor(u2)) * 2 - 1) * max_elevation; @@ -420,29 +420,29 @@ subroutine(src_stage_sub) vec4 src_10(vec2 vUV, int seed, vec3 b1, vec2 f1, vec3 float f = 0; f = line(uv3, vec2(0, 0) - iso_z(e0), vec2(1, 0) - iso_z(e1), thick) - + line(uv3, vec2(0, 0) - iso_z(e0), vec2(0, 1) - iso_z(e2), thick) - + line(uv3, vec2(0, 0) - iso_z(e0), vec2(-1, 0) - iso_z(e3), thick) - + line(uv3, vec2(0, 0) - iso_z(e0), vec2(0, -1) - iso_z(e4), thick); - + + line(uv3, vec2(0, 0) - iso_z(e0), vec2(0, 1) - iso_z(e2), thick) + + line(uv3, vec2(0, 0) - iso_z(e0), vec2(-1, 0) - iso_z(e3), thick) + + line(uv3, vec2(0, 0) - iso_z(e0), vec2(0, -1) - iso_z(e4), thick); + return vec4(f); } // SRC 11 : video in 2 + thru -subroutine(src_stage_sub) vec4 src_11(vec2 vUV, int seed, vec3 b1, vec2 f1, vec3 b2, vec2 f2, vec3 b3, vec2 f3) +subroutine ( src_stage_sub ) vec4 src_11(vec2 vUV, int seed, vec3 b1, vec2 f1, vec3 b2, vec2 f2, vec3 b3, vec2 f3) { if (iDemo > 0) { return src_3(vUV, seed, b1, f1, b2, f2, b3, f3); } - return src_thru(vUV, iTex4, seed, b1, f1, b2, f2, b3, f3); + return src_thru(vUV, iTex6, seed, b1, f1, b2, f2, b3, f3); } // SRC 12 : Scales -subroutine(src_stage_sub) vec4 src_12(vec2 vUV, int seed, vec3 b1, vec2 f1, vec3 b2, vec2 f2, vec3 b3, vec2 f3) +subroutine ( src_stage_sub ) vec4 src_12(vec2 vUV, int seed, vec3 b1, vec2 f1, vec3 b2, vec2 f2, vec3 b3, vec2 f3) { // start - vec2 uv0 = vUV.st; + vec2 uv0 = vUV.st; float ratio = iResolution.x / iResolution.y; vec2 uv1 = (uv0 - .5) * vec2(ratio, 1); @@ -481,11 +481,11 @@ subroutine(src_stage_sub) vec4 src_12(vec2 vUV, int seed, vec3 b1, vec2 f1, vec3 } // SRC 13 : Credenza -subroutine(src_stage_sub) vec4 src_13(vec2 vUV, int seed, vec3 b1, vec2 f1, vec3 b2, vec2 f2, vec3 b3, vec2 f3) +subroutine ( src_stage_sub ) vec4 src_13(vec2 vUV, int seed, vec3 b1, vec2 f1, vec3 b2, vec2 f2, vec3 b3, vec2 f3) { // start - vec2 uv0 = vUV.st; + vec2 uv0 = vUV.st; float ratio = iResolution.x / iResolution.y; vec2 uv1 = (uv0 - .5) * vec2(ratio, 1); @@ -500,7 +500,7 @@ subroutine(src_stage_sub) vec4 src_13(vec2 vUV, int seed, vec3 b1, vec2 f1, vec3 vec2 uv2 = uv1; uv2 *= zoom; - + uv2 = mod(uv2, 2); uv2 = abs(uv2 - 1); @@ -508,16 +508,16 @@ subroutine(src_stage_sub) vec4 src_13(vec2 vUV, int seed, vec3 b1, vec2 f1, vec3 float f = istep(1, length(uv2)) * istep(1, length(1 - uv2)); f *= istep(0.5, saw((length(uv2) + shape + 0.5) * repeat)) * istep(0.5, saw((length(1 - uv2) + shape + 0.5) * repeat)); - + return vec4(f); } // SRC 14 : Cursor -subroutine(src_stage_sub) vec4 src_14(vec2 vUV, int seed, vec3 b1, vec2 f1, vec3 b2, vec2 f2, vec3 b3, vec2 f3) +subroutine ( src_stage_sub ) vec4 src_14(vec2 vUV, int seed, vec3 b1, vec2 f1, vec3 b2, vec2 f2, vec3 b3, vec2 f3) { // start - vec2 uv0 = vUV.st; + vec2 uv0 = vUV.st; float ratio = iResolution.x / iResolution.y; vec2 uv1 = (uv0 - .5) * vec2(ratio, 1); @@ -551,15 +551,15 @@ subroutine(src_stage_sub) vec4 src_14(vec2 vUV, int seed, vec3 b1, vec2 f1, vec3 uv2.y += 0.1; - f -= istep(0, (uv2.x + uv2.y * 3) * (uv2.x - uv2.y * 3)) * istep(0, uv2.y); + f -= istep(0, (uv2.x + uv2.y * 3) * (uv2.x - uv2.y * 3)) * istep(0, uv2.y); f += rect(uv2, vec2(0, -0.04), vec2(0.01, 0.04)); - + return vec4(f); } // SRC 15 : Random -subroutine(src_stage_sub) vec4 src_15(vec2 vUV, int seed, vec3 b1, vec2 f1, vec3 b2, vec2 f2, vec3 b3, vec2 f3) +subroutine ( src_stage_sub ) vec4 src_15(vec2 vUV, int seed, vec3 b1, vec2 f1, vec3 b2, vec2 f2, vec3 b3, vec2 f3) { int src = int(randTime(seed + 100) * 14); @@ -594,4 +594,4 @@ subroutine(src_stage_sub) vec4 src_15(vec2 vUV, int seed, vec3 b1, vec2 f1, vec3 } } -#endif \ No newline at end of file +#endif diff --git a/default/inc_template.glsl b/default/inc_template.glsl index 6490e0f..5da0946 100644 --- a/default/inc_template.glsl +++ b/default/inc_template.glsl @@ -1,4 +1,4 @@ #ifndef INC_TEMPLATE #define INC_TEMPLATE -#endif \ No newline at end of file +#endif diff --git a/default/inc_time.glsl b/default/inc_time.glsl index dedfe71..0546a03 100644 --- a/default/inc_time.glsl +++ b/default/inc_time.glsl @@ -50,4 +50,4 @@ float cosTime(float k) return cos(modTime(k, 0.5) * 2 * PI); } -#endif \ No newline at end of file +#endif diff --git a/default/inc_yuyv.glsl b/default/inc_yuyv.glsl index a586dca..f953112 100644 --- a/default/inc_yuyv.glsl +++ b/default/inc_yuyv.glsl @@ -7,7 +7,7 @@ const mat3x3 yuyv_to_rgb = {{1,1,1},{0,-0.39465,2.03211},{1.13983,-0.5806,0}}; vec4 yuyvTex(sampler2D tex, vec2 vUV, int base_width) { float w = base_width - 1; - + int x = int(vUV.x * w); int xU = x - x % 2; @@ -25,4 +25,4 @@ vec4 yuyvTex(sampler2D tex, vec2 vUV, int base_width) { return vec4(yuyv_to_rgb * yuv, 1.0); } -#endif \ No newline at end of file +#endif