I really don’t understand why you’re adding rainbows that way. Your NTSC implementation already has the rainbows, just at the wrong offsets. Here’s my way of doing it:
ntsc-pass1.slang:
diff --git a/../ntsc/ntsc-pass1.slang b/ntsc-pass1.slang
index f0fc3f4..55dc8a5 100644
--- a/../ntsc/ntsc-pass1.slang
+++ b/ntsc-pass1.slang
@@ -147,7 +147,7 @@ if (params.ntsc_phase == 4.0)
if (MERGE > 0.5)
{
- float chroma_phase2 = (phase < 2.5) ? PI * (mod(pix_no.y, mod1) + mod(params.FrameCount+1, 2.)) : 0.6667 * PI * (mod(pix_no.y, mod2) + mod(params.FrameCount+1, 2.));
+ float chroma_phase2 = (phase < 2.5) ? (params.ntsc_rainbow1 < 0.5 ? PI * (mod(pix_no.y, mod1) + mod(params.FrameCount+1, 2.)) : 0.0) : 0.6667 * PI * (mod(pix_no.y, mod2) + mod(params.FrameCount+1, 2.));
float mod_phase2 = chroma_phase2 + pix_no.x * CHROMA_MOD_FREQ;
float i_mod2 = cos(mod_phase2); i_mod2 = mix(i_mod2, i_mod2*abs(i_mod2), mit);
float q_mod2 = sin(mod_phase2); q_mod2 = mix(q_mod2, q_mod2*abs(q_mod2), mit);
@@ -165,7 +165,7 @@ if (MERGE > 0.5)
}
}
- float chroma_phase = (phase < 2.5) ? PI * (mod(pix_no.y, mod1) + mod(params.FrameCount, 2.)) : 0.6667 * PI * (mod(pix_no.y, mod2) + mod(params.FrameCount, 2.));
+ float chroma_phase = (phase < 2.5) ? (params.ntsc_rainbow1 < 0.5 ? PI * (mod(pix_no.y, mod1) + mod(params.FrameCount, 2.)) : 0) : 0.6667 * PI * (mod(pix_no.y, mod2) + mod(params.FrameCount, 2.));
float mod_phase = chroma_phase + pix_no.x * CHROMA_MOD_FREQ;
float i_mod = cos(mod_phase); i_mod = mix(i_mod, i_mod*abs(i_mod), mit);
@@ -189,7 +189,7 @@ if (params.ntsc_phase == 4.0)
yiq.x = lum; yiq2.x = lum;
}
- if (MERGE > 0.5) { if (params.ntsc_rainbow1 < 0.5 || phase > 2.5) yiq = 0.5*(yiq + yiq2); else yiq.x = 0.5*(yiq.x + yiq2.x); }
+ if (MERGE > 0.5) { if (phase > 2.5) yiq = 0.5*(yiq + yiq2); else yiq.x = 0.5*(yiq.x + yiq2.x); }
FragColor = vec4(yiq, lum);
}
ntsc-pass2.slang:
diff --git a/../ntsc/ntsc-pass2.slang b/ntsc-pass2.slang
index 17635ef..d6c434e 100644
--- a/../ntsc/ntsc-pass2.slang
+++ b/ntsc-pass2.slang
@@ -216,19 +216,6 @@ float luma_filter_3_phase[25] = float[25](
0.220176552);
float dy = 0.0;
-
- if (params.ntsc_rainbow1 > 0.5)
- {
- vec2 xx = vec2(params.OriginalSize.z, 0.0);
- float c0 = get_luma(texture(PrePass0, vTexCoord ).rgb);
- float c1 = get_luma(texture(PrePass0, vTexCoord - xx).rgb);
- float c2 = get_luma(texture(PrePass0, vTexCoord + xx).rgb);
- float ybool = 1.0; if (c1 == c0 || c2 == c0) ybool = 0.0;
- float line_no = floor(mod(params.OriginalSize.y*vTexCoord.y, 2.0));
- float frame_no = floor(mod(float(params.FrameCount),2.0));
- float ii = abs(line_no-frame_no);
- dy = ii * params.OriginalSize.w*ybool;
- }
float res = ntsc_scale;
float OriginalSize = params.OriginalSize.x * auto_rez;
And, with Artifacting=0.6 and Fringing=0.1, here are some screenshots.
Screenshots (spoiler)