feat: src 9

This commit is contained in:
2025-11-09 11:03:34 +01:00
parent c441bc5729
commit e3d6fc0680
4 changed files with 36 additions and 16 deletions
+8 -6
View File
@@ -86,14 +86,16 @@ make -f Makefile.dev release-arch
- [x] Share openGL state between monitor and screen
- [ ] Default project
- [x] split with includes
- [ ] src 9: game of life
- [ ] src 10 : ?
- [ ] src 11 : ?
- [ ] src 12 : ?
- [x] src 9 : sentences repeat h
- [ ] src 11 : isometric grid
- [ ] src 12 : pattern in my kitchen
- [ ] src 13 : ?
- [x] src 15 : debug -> calibration screen
- [ ] fx 10 : colorize range (pretty color ranges)
- [ ] src 15 : ?
- [x] fx 11 : spill
- [ ] fx 12 : colorize range (pretty color ranges)
- [ ] fx 13 : game of life
- [ ] fx 14 : ?
- [ ] fx 15 : ?
- [x] frag 10 : move debug screen here
- [ ] debug : add src/fx/A/B indicators
- [ ] Other
+1 -1
View File
@@ -149,7 +149,7 @@ options:
| **2** | **5** | Video In 1 + Thru | _Hue_ | _Saturation_ | _Light_ | Dithering | _Pixel Size_ | _Bit Depth_ | _Blur_ |
| | **6** | CP437 | _Zoom_ | _Charset_ | _Char. Delta_ | TV | _Lens_ | _Horz. Noise_ | _Dezoom_ |
| | **7** | Sentences | _Zoom_ | _Sentence_ | _Vertical repeat_ | Kaleidoscope | _Axes_ | _Rotation_ | _Horz. Scroll_ |
| | **8** | | | | | CP437 | _Zoom_ | _Charset_ | _Char. Delta_ |
| | **8** | Sentences repeat | _X Shift_ | _Sentence_ | _Vertical repeat_ | CP437 | _Zoom_ | _Charset_ | _Char. Delta_ |
| | **9** | | | | | Lens | _Lens limit_ | _Lens power_ | _Pre Zoom_ |
| **3** | **A** | Video In 2 + Thru | _Hue_ | _Saturation_ | _Light_ | Spill | _Bottom limit_ | _Top Limit_ | _Rotation_ |
| | **B** | | | | | | | | |
+2 -2
View File
@@ -17,8 +17,8 @@ const int sentences[SENTENCE_COUNT][20] = {
{0x4C, 0x69, 0x76, 0x65, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
{0x47, 0x65, 0x6E, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
{0x43, 0x6F, 0x6E, 0x74, 0x72, 0x6F, 0x6C, 0x6C, 0x65, 0x64, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
{0x3C0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
{0x4B, 0x6C, 0x65, 0x3C0, 0x65, 0x6B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
{0xE3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
{0x4B, 0x6C, 0x65, 0xE3, 0x65, 0x6B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
{0x43, 0x6F, 0x64, 0x65, 0x20, 0x61, 0x73, 0x20, 0x61, 0x72, 0x74, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
{0x41, 0x72, 0x74, 0x20, 0x61, 0x73, 0x20, 0x63, 0x6F, 0x64, 0x65, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
};
+22 -4
View File
@@ -236,6 +236,7 @@ subroutine(src_stage_sub) vec4 src_8(vec2 vUV, int seed, vec3 b1, vec2 f1, vec3
vec2 uv2 = uv1;
uv2 *= (1 + zoom) * 12;
uv2.y += 0.5;
int s = int(sentence * (SENTENCE_COUNT - 1));
uv2.x += floor(uv2.y) * (h_delta - 0.5) * 2;
uv2.y = mix(uv2.y, mod(uv2.y, 1), h_delta_b.x);
@@ -244,11 +245,9 @@ subroutine(src_stage_sub) vec4 src_8(vec2 vUV, int seed, vec3 b1, vec2 f1, vec3
return vec4(f);
}
// TODO SRC 9
// 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)
{
return src_2(vUV, seed, b1, f1, b2, f2, b3, f3);
// start
vec2 uv0 = vUV.st;
@@ -257,9 +256,28 @@ subroutine(src_stage_sub) vec4 src_9(vec2 vUV, int seed, vec3 b1, vec2 f1, vec3
// controls
float h_shift = magic(f1, b1, seed + 10);
float sentence = magic_reverse(f2, b2, seed + 20);
float h_delta = magic(f3, b3, seed + 30);
vec3 h_delta_b = magic_b(b3, seed + 30);
// logic
return texture(iTex0, vUV);
vec2 uv2 = uv1;
uv2.x += h_shift;
uv2 *= 15;
uv2.y += 0.5;
int s = int(sentence * (SENTENCE_COUNT - 1));
float slen = float(lengths[s]);
uv2.x += floor(uv2.y) * (h_delta - 0.5) * 2;
uv2.x = cmod(uv2.x, slen + 1);
vec2 uv3 = uv2;
uv3.y = mix(uv3.y, mod(uv3.y, 1), h_delta_b.x);
float f = write_20(uv3, vec2(-slen * 0.5, 0), sentences[s]);
f *= (1 - abs(floor(uv2.y) * 0.125)) * (1 - abs(floor(uv2.y) * 0.125));
return vec4(f);
}
// TODO SRC 10