wip config

This commit is contained in:
2025-09-18 20:27:00 +02:00
parent e811d404a1
commit 998c2cb222
14 changed files with 93 additions and 37 deletions
+36 -6
View File
@@ -15,15 +15,45 @@ static char *vertex_shader_text =
" vUV = vPos;\n"
"}\n";
static char *output_fragment_shader_text =
static char *output_shader_text = "#version 460\n"
"in vec2 vUV;\n"
"out vec4 fragColor;\n"
"uniform sampler2D frame0;\n"
"void main()\n"
"{\n"
" fragColor = texture(frame0, vUV);\n"
"}";
static char *monitor_shader_text =
"#version 460\n"
"uniform sampler2D frame0;\n"
"uniform sampler2D frame1;\n"
"uniform sampler2D frame2;\n"
"uniform sampler2D frame3;\n"
"uniform sampler2D frame4;\n"
"uniform sampler2D frame5;\n"
"uniform sampler2D frame6;\n"
"uniform sampler2D frame7;\n"
"uniform sampler2D frame8;\n"
"in vec2 vUV;\n"
"out vec4 fragColor;\n"
"uniform sampler2D frame0;\n"
"void main()\n"
"{\n"
" fragColor = texture(frame0, vUV);\n"
"}\n";
"float s(vec2 uv, float x0, float y0) {\n"
" return step(x0, uv.x) * step(-x0 - 1, -uv.x) * step(y0, uv.y) * "
"step(-y0 - 1, -uv.y);\n"
"}\n"
"void main() {\n"
" vec2 uv = vUV * 3;\n"
" fragColor = vec4(0);\n"
" fragColor += s(uv,0,2) * texture(frame1, uv);\n"
" fragColor += s(uv,1,2) * texture(frame2, uv);\n"
" fragColor += s(uv,2,2) * texture(frame3, uv);\n"
" fragColor += s(uv,0,1) * texture(frame4, uv);\n"
" fragColor += s(uv,1,1) * texture(frame5, uv);\n"
" fragColor += s(uv,2,1) * texture(frame6, uv);\n"
" fragColor += s(uv,0,0) * texture(frame7, uv);\n"
" fragColor += s(uv,1,0) * texture(frame8, uv);\n"
" fragColor += s(uv,2,0) * texture(frame0, uv);\n"
"}";
static const Vertex vertices[6] = {{{0.0f, 0.0f}}, {{0.0f, 1.0f}},
{{1.0f, 1.0f}}, {{0.0f, 0.0f}},