wip yuyv
This commit is contained in:
+23
-18
@@ -21,12 +21,12 @@ uniform int seed6;
|
||||
uniform int seed7;
|
||||
uniform int seed8;
|
||||
|
||||
uniform int state1_1;
|
||||
uniform int state2_1;
|
||||
uniform int state3_2;
|
||||
uniform int state4_2;
|
||||
uniform int state5_3;
|
||||
uniform int state3_1;
|
||||
uniform int state4_1;
|
||||
uniform int state5_2;
|
||||
uniform int state6_2;
|
||||
uniform int state7_3;
|
||||
uniform int state8_2;
|
||||
|
||||
// 2. textures
|
||||
// ---------------
|
||||
@@ -40,6 +40,7 @@ uniform sampler2D tex5;
|
||||
uniform sampler2D tex6;
|
||||
uniform sampler2D tex7;
|
||||
uniform sampler2D tex8;
|
||||
uniform sampler2D tex9;
|
||||
|
||||
// 3. definitions
|
||||
// --------------
|
||||
@@ -1039,7 +1040,7 @@ subroutine(src_stage_sub) vec4 src_5(vec2 vUV, int seed)
|
||||
// SRC 6 : video in 1 + thru
|
||||
subroutine(src_stage_sub) vec4 src_6(vec2 vUV, int seed)
|
||||
{
|
||||
return src_thru(vUV, tex1, seed);
|
||||
return src_thru(vUV, tex3, seed);
|
||||
}
|
||||
|
||||
// SRC 7 : cp437
|
||||
@@ -1157,7 +1158,7 @@ subroutine(src_stage_sub) vec4 src_10(vec2 vUV, int seed)
|
||||
// SRC 11 : video in 2 + thru
|
||||
subroutine(src_stage_sub) vec4 src_11(vec2 vUV, int seed)
|
||||
{
|
||||
return src_thru(vUV, tex2, seed);
|
||||
return src_thru(vUV, tex4, seed);
|
||||
}
|
||||
|
||||
// TODO SRC 12
|
||||
@@ -1239,16 +1240,16 @@ subroutine(src_stage_sub) vec4 src_16(vec2 vUV, int seed)
|
||||
int page = 0; // TODO debug page
|
||||
int selected_src = 0; // TODO debug selected
|
||||
int selected_fx = 0; // TODO debug selected
|
||||
int selected_srca = state1_1;
|
||||
int selected_srcb = state2_1;
|
||||
int selected_fxa = state3_2;
|
||||
int selected_fxb = state4_2;
|
||||
int selected_mfx = state6_2;
|
||||
float fxa_value = magic(seed3);
|
||||
float fxb_value = magic(seed4);
|
||||
float mfx_value = magic(seed6);
|
||||
float mix_value = magic(seed5);
|
||||
int mix_type = state5_3 % 2;
|
||||
int selected_srca = state3_1;
|
||||
int selected_srcb = state4_1;
|
||||
int selected_fxa = state5_2;
|
||||
int selected_fxb = state6_2;
|
||||
int selected_mfx = state8_2;
|
||||
float fxa_value = magic(seed5);
|
||||
float fxb_value = magic(seed6);
|
||||
float mfx_value = magic(seed8);
|
||||
float mix_value = magic(seed7);
|
||||
int mix_type = state7_3 % 2;
|
||||
|
||||
// logic
|
||||
|
||||
@@ -1918,4 +1919,8 @@ subroutine(mix_stage_sub) vec4 mix_15(vec2 vUV, sampler2D ta, sampler2D tb, int
|
||||
subroutine(mix_stage_sub) vec4 mix_16(vec2 vUV, sampler2D ta, sampler2D tb, int seed)
|
||||
{
|
||||
return mix_2(vUV, ta, tb, seed);
|
||||
}
|
||||
}
|
||||
|
||||
// TODO temp
|
||||
|
||||
const mat4x4 yuv_to_rgb = {{1,0,1.13983,0},{1,-0.39465,-0.5806,0},{1,2.03211,0,0},{0,0,0,1}};
|
||||
+12
-5
@@ -1,12 +1,19 @@
|
||||
// SRC A
|
||||
// VIDEO 1
|
||||
// -----------
|
||||
// IN: 0 (OUT)
|
||||
// IN: 1 (IN A)
|
||||
// OUT: 2 (FX A)
|
||||
// IN: 1 (RAW IN A)
|
||||
// OUT: 3 (IN A)
|
||||
|
||||
in vec2 vUV;
|
||||
out vec4 fragColor;
|
||||
|
||||
void main() {
|
||||
fragColor = src_stage(vUV, seed1);
|
||||
float r, g, b, y, u, v;
|
||||
vec4 src = texture(tex1, vec2(vUV.x, 1 - vUV.y));
|
||||
y = src.r;
|
||||
u = src.g - 0.5;
|
||||
v = src.a - 0.5;
|
||||
r = y + 1.13983 * v;
|
||||
g = y - 0.39465 * u - 0.58060 * v;
|
||||
b = y + 2.03211 * u;
|
||||
fragColor = vec4(r, g, b, 1.0);
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
// MONITOR
|
||||
// ---
|
||||
|
||||
in vec2 vUV;
|
||||
out vec4 fragColor;
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
const int texts[8][5] = {
|
||||
{0x49, 0x4E, 0x20, 0x41, 0x00}, // IN A
|
||||
{0x49, 0x4E, 0x20, 0x42, 0x00}, // IN B
|
||||
{0x53, 0x52, 0x43, 0x20, 0x41}, // SRC A
|
||||
{0x53, 0x52, 0x43, 0x20, 0x42}, // SRC B
|
||||
{0x46, 0x58, 0x20, 0x41, 0x00}, // FX A
|
||||
{0x46, 0x58, 0x20, 0x42, 0x00}, // FX B
|
||||
{0x41, 0x2B, 0x42, 0x00, 0x00}, // A+B
|
||||
{0x4D, 0x46, 0x58, 0x00, 0x00}, // MFX
|
||||
};
|
||||
|
||||
void main() {
|
||||
vec2 uv0 = vUV.st;
|
||||
float ratio = iResolution.x / iResolution.y;
|
||||
vec2 uv1 = (uv0 - .5) * vec2(ratio, 1);
|
||||
|
||||
vec2 uv2 = uv0 * 3;
|
||||
vec2 uv3 = uv1 * 60;
|
||||
|
||||
vec4 c = vec4(0);
|
||||
|
||||
c += s(uv2,0,2) * texture(tex3, uv2);
|
||||
c += s(uv2,1,2) * texture(tex5, uv2);
|
||||
c += s(uv2,2,2) * texture(tex7, uv2);
|
||||
|
||||
c += s(uv2,0,1) * texture(tex4, uv2);
|
||||
c += s(uv2,1,1) * texture(tex6, uv2);
|
||||
c += s(uv2,2,1) * texture(tex8, uv2);
|
||||
|
||||
c += s(uv2,0,0) * src_16(mod(uv2, 1), 0);
|
||||
c += s(uv2,1,0) * texture(tex9, uv2);
|
||||
c += s(uv2,2,0) * texture(tex0, uv2);
|
||||
|
||||
float f = 0;
|
||||
float t = 0;
|
||||
|
||||
f += rect(uv3, vec2(-51, 28.5), vec2(2.1, 0.7));
|
||||
t += write_5(uv3, vec2(-53,28), texts[0]);
|
||||
f += rect(uv3, vec2(-51, 8.5), vec2(2.1, 0.7));
|
||||
t += write_5(uv3, vec2(-53,8), texts[1]);
|
||||
f += rect(uv3, vec2(-14.5, 28.5), vec2(2.6, 0.7));
|
||||
t += write_5(uv3, vec2(-17,28), texts[2]);
|
||||
f += rect(uv3, vec2(-14.5, 8.5), vec2(2.6, 0.7));
|
||||
t += write_5(uv3, vec2(-17,8), texts[3]);
|
||||
f += rect(uv3, vec2(21, 28.5), vec2(2.1, 0.7));
|
||||
t += write_5(uv3, vec2(19,28), texts[4]);
|
||||
f += rect(uv3, vec2(21, 8.5), vec2(2.1, 0.7));
|
||||
t += write_5(uv3, vec2(19,8), texts[5]);
|
||||
f += rect(uv3, vec2(-15.5, -11.5), vec2(1.6, 0.7));
|
||||
t += write_5(uv3, vec2(-17,-12), texts[6]);
|
||||
f += rect(uv3, vec2(20.5, -11.5), vec2(1.6, 0.7));
|
||||
t += write_5(uv3, vec2(19,-12), texts[7]);
|
||||
|
||||
fragColor = mix(c, vec4(f - t), f);
|
||||
}
|
||||
+12
-5
@@ -1,12 +1,19 @@
|
||||
// SRC B
|
||||
// VIDEO 2
|
||||
// -----------
|
||||
// IN: 0 (OUT)
|
||||
// IN: 4 (IN B)
|
||||
// OUT: 5 (FX B)
|
||||
// IN: 2 (RAW IN B)
|
||||
// OUT: 4 (IN B)
|
||||
|
||||
in vec2 vUV;
|
||||
out vec4 fragColor;
|
||||
|
||||
void main() {
|
||||
fragColor = src_stage(vUV, seed2);
|
||||
float r, g, b, y, u, v;
|
||||
vec4 src = texture(tex2, vec2(vUV.x, 1 - vUV.y));
|
||||
y = src.r;
|
||||
u = src.g - 0.5;
|
||||
v = src.a - 0.5;
|
||||
r = y + 1.13983 * v;
|
||||
g = y - 0.39465 * u - 0.58060 * v;
|
||||
b = y + 2.03211 * u;
|
||||
fragColor = vec4(r, g, b, 1.0);
|
||||
}
|
||||
+4
-6
@@ -1,12 +1,10 @@
|
||||
// FX A
|
||||
// -------------
|
||||
// IN: 2 (SRC A)
|
||||
// IN: 3 (FX A)
|
||||
// OUT: 3 (A+B)
|
||||
// SRC A
|
||||
// -----------
|
||||
// OUT: 5 (FX A)
|
||||
|
||||
in vec2 vUV;
|
||||
out vec4 fragColor;
|
||||
|
||||
void main() {
|
||||
fragColor = fx_stage(vUV, tex2, tex3, seed3);
|
||||
fragColor = src_stage(vUV, seed3);
|
||||
}
|
||||
+4
-6
@@ -1,12 +1,10 @@
|
||||
// FX B
|
||||
// -------------
|
||||
// IN: 5 (SRC B)
|
||||
// IN: 6 (FX B)
|
||||
// OUT: 6 (A+B)
|
||||
// SRC B
|
||||
// -----------
|
||||
// OUT: 6 (FX B)
|
||||
|
||||
in vec2 vUV;
|
||||
out vec4 fragColor;
|
||||
|
||||
void main() {
|
||||
fragColor = fx_stage(vUV, tex5, tex6, seed4);
|
||||
fragColor = src_stage(vUV, seed4);
|
||||
}
|
||||
+6
-6
@@ -1,12 +1,12 @@
|
||||
// A+B
|
||||
// ------------
|
||||
// IN: 3 (FX A)
|
||||
// IN: 6 (FX B)
|
||||
// OUT: 7 (MFX)
|
||||
// FX A
|
||||
// -------------
|
||||
// IN: 5 (SRC A)
|
||||
// IN: 7 (FX A)
|
||||
// OUT: 7 (A+B)
|
||||
|
||||
in vec2 vUV;
|
||||
out vec4 fragColor;
|
||||
|
||||
void main() {
|
||||
fragColor = mix_stage(vUV, tex3, tex6, seed5);
|
||||
fragColor = fx_stage(vUV, tex5, tex7, seed5);
|
||||
}
|
||||
+6
-6
@@ -1,12 +1,12 @@
|
||||
// MFX
|
||||
// ------------
|
||||
// IN: 7 (A+B)
|
||||
// IN: 0 (OUT)
|
||||
// OUT: 0 (OUT)
|
||||
// FX B
|
||||
// -------------
|
||||
// IN: 6 (SRC B)
|
||||
// IN: 8 (FX B)
|
||||
// OUT: 8 (A+B)
|
||||
|
||||
in vec2 vUV;
|
||||
out vec4 fragColor;
|
||||
|
||||
void main() {
|
||||
fragColor = fx_stage(vUV, tex7, tex0, seed6);
|
||||
fragColor = fx_stage(vUV, tex6, tex8, seed6);
|
||||
}
|
||||
+6
-3
@@ -1,9 +1,12 @@
|
||||
// OUT
|
||||
// ---
|
||||
// A+B
|
||||
// ------------
|
||||
// IN: 7 (FX A)
|
||||
// IN: 8 (FX B)
|
||||
// OUT: 9 (MFX)
|
||||
|
||||
in vec2 vUV;
|
||||
out vec4 fragColor;
|
||||
|
||||
void main() {
|
||||
fragColor = texture(tex0, vUV);
|
||||
fragColor = mix_stage(vUV, tex7, tex8, seed7);
|
||||
}
|
||||
+6
-58
@@ -1,64 +1,12 @@
|
||||
// MONITOR
|
||||
// ---
|
||||
// MFX
|
||||
// ------------
|
||||
// IN: 9 (A+B)
|
||||
// IN: 0 (OUT)
|
||||
// OUT: 0 (OUT)
|
||||
|
||||
in vec2 vUV;
|
||||
out vec4 fragColor;
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
const int texts[8][5] = {
|
||||
{0x49, 0x4E, 0x20, 0x41, 0x00}, // IN A
|
||||
{0x49, 0x4E, 0x20, 0x42, 0x00}, // IN B
|
||||
{0x53, 0x52, 0x43, 0x20, 0x41}, // SRC A
|
||||
{0x53, 0x52, 0x43, 0x20, 0x42}, // SRC B
|
||||
{0x46, 0x58, 0x20, 0x41, 0x00}, // FX A
|
||||
{0x46, 0x58, 0x20, 0x42, 0x00}, // FX B
|
||||
{0x41, 0x2B, 0x42, 0x00, 0x00}, // A+B
|
||||
{0x4D, 0x46, 0x58, 0x00, 0x00}, // MFX
|
||||
};
|
||||
|
||||
void main() {
|
||||
vec2 uv0 = vUV.st;
|
||||
float ratio = iResolution.x / iResolution.y;
|
||||
vec2 uv1 = (uv0 - .5) * vec2(ratio, 1);
|
||||
|
||||
vec2 uv2 = uv0 * 3;
|
||||
vec2 uv3 = uv1 * 60;
|
||||
|
||||
vec4 c = vec4(0);
|
||||
|
||||
c += s(uv2,0,2) * texture(tex1, uv2);
|
||||
c += s(uv2,1,2) * texture(tex2, uv2);
|
||||
c += s(uv2,2,2) * texture(tex3, uv2);
|
||||
c += s(uv2,0,1) * texture(tex4, uv2);
|
||||
c += s(uv2,1,1) * texture(tex5, uv2);
|
||||
c += s(uv2,2,1) * texture(tex6, uv2);
|
||||
c += s(uv2,0,0) * src_16(mod(uv2, 1), 0);
|
||||
c += s(uv2,1,0) * texture(tex7, uv2);
|
||||
c += s(uv2,2,0) * texture(tex0, uv2);
|
||||
|
||||
float f = 0;
|
||||
float t = 0;
|
||||
|
||||
f += rect(uv3, vec2(-51, 28.5), vec2(2.1, 0.7));
|
||||
t += write_5(uv3, vec2(-53,28), texts[0]);
|
||||
f += rect(uv3, vec2(-51, 8.5), vec2(2.1, 0.7));
|
||||
t += write_5(uv3, vec2(-53,8), texts[1]);
|
||||
f += rect(uv3, vec2(-14.5, 28.5), vec2(2.6, 0.7));
|
||||
t += write_5(uv3, vec2(-17,28), texts[2]);
|
||||
f += rect(uv3, vec2(-14.5, 8.5), vec2(2.6, 0.7));
|
||||
t += write_5(uv3, vec2(-17,8), texts[3]);
|
||||
f += rect(uv3, vec2(21, 28.5), vec2(2.1, 0.7));
|
||||
t += write_5(uv3, vec2(19,28), texts[4]);
|
||||
f += rect(uv3, vec2(21, 8.5), vec2(2.1, 0.7));
|
||||
t += write_5(uv3, vec2(19,8), texts[5]);
|
||||
f += rect(uv3, vec2(-15.5, -11.5), vec2(1.6, 0.7));
|
||||
t += write_5(uv3, vec2(-17,-12), texts[6]);
|
||||
f += rect(uv3, vec2(20.5, -11.5), vec2(1.6, 0.7));
|
||||
t += write_5(uv3, vec2(19,-12), texts[7]);
|
||||
|
||||
fragColor = mix(c, vec4(f - t), f);
|
||||
fragColor = fx_stage(vUV, tex9, tex0, seed8);
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
// OUT
|
||||
// ---
|
||||
|
||||
in vec2 vUV;
|
||||
out vec4 fragColor;
|
||||
|
||||
void main() {
|
||||
fragColor = texture(tex0, vUV);
|
||||
}
|
||||
Reference in New Issue
Block a user