frame -> tex

This commit is contained in:
2025-09-18 20:36:21 +02:00
parent 998c2cb222
commit 876bebd2c8
10 changed files with 163 additions and 161 deletions
+20 -20
View File
@@ -18,23 +18,23 @@ static char *vertex_shader_text =
static char *output_shader_text = "#version 460\n"
"in vec2 vUV;\n"
"out vec4 fragColor;\n"
"uniform sampler2D frame0;\n"
"uniform sampler2D tex0;\n"
"void main()\n"
"{\n"
" fragColor = texture(frame0, vUV);\n"
" fragColor = texture(tex0, 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"
"uniform sampler2D tex0;\n"
"uniform sampler2D tex1;\n"
"uniform sampler2D tex2;\n"
"uniform sampler2D tex3;\n"
"uniform sampler2D tex4;\n"
"uniform sampler2D tex5;\n"
"uniform sampler2D tex6;\n"
"uniform sampler2D tex7;\n"
"uniform sampler2D tex8;\n"
"in vec2 vUV;\n"
"out vec4 fragColor;\n"
"float s(vec2 uv, float x0, float y0) {\n"
@@ -44,15 +44,15 @@ static char *monitor_shader_text =
"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"
" fragColor += s(uv,0,2) * texture(tex1, uv);\n"
" fragColor += s(uv,1,2) * texture(tex2, uv);\n"
" fragColor += s(uv,2,2) * texture(tex3, uv);\n"
" fragColor += s(uv,0,1) * texture(tex4, uv);\n"
" fragColor += s(uv,1,1) * texture(tex5, uv);\n"
" fragColor += s(uv,2,1) * texture(tex6, uv);\n"
" fragColor += s(uv,0,0) * texture(tex7, uv);\n"
" fragColor += s(uv,1,0) * texture(tex8, uv);\n"
" fragColor += s(uv,2,0) * texture(tex0, uv);\n"
"}";
static const Vertex vertices[6] = {{{0.0f, 0.0f}}, {{0.0f, 1.0f}},