summaryrefslogtreecommitdiff
path: root/src/effects/ntsc_yiq.wgsl
diff options
context:
space:
mode:
authorskal <pascal.massimino@gmail.com>2026-03-10 20:42:32 +0100
committerskal <pascal.massimino@gmail.com>2026-03-10 20:42:32 +0100
commit3547424b8c5f3884f84d16fb3f08b47965d62428 (patch)
tree18cfcc23fad133a9cf2e84ba4fb77b1d5826ff8a /src/effects/ntsc_yiq.wgsl
parent7ca40818e3d0401f97efae6fe876038df4f5bd00 (diff)
ntsc: factor common code into snippet; add RGB and YIQ input variants
- Extract shared NTSC logic into render/ntsc_common.wgsl snippet - sample_ntsc_signal() hook decouples input format from processing - ntsc_rgb.wgsl: RGB input (converts via rgba_to_luma_chroma_phase) - ntsc_yiq.wgsl: YIQ passthrough for RotatingCube output - Add NtscYiq WgslEffect thin wrapper; register both in tests handoff(Claude): NTSC refactor complete; NtscYiq ready for timeline use with RotatingCube. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'src/effects/ntsc_yiq.wgsl')
-rw-r--r--src/effects/ntsc_yiq.wgsl19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/effects/ntsc_yiq.wgsl b/src/effects/ntsc_yiq.wgsl
new file mode 100644
index 0000000..8ab36d3
--- /dev/null
+++ b/src/effects/ntsc_yiq.wgsl
@@ -0,0 +1,19 @@
+// NTSC post-process effect (YIQ input): fisheye distortion, scanlines, color bleeding.
+// Input texture already stores luma/chroma/phase (e.g. from RotatingCube output).
+#include "sequence_uniforms"
+#include "render/fullscreen_uv_vs"
+#include "math/noise"
+#include "math/color"
+#include "math/color_c64"
+#include "debug/debug_print"
+
+@group(0) @binding(0) var input_sampler: sampler;
+@group(0) @binding(1) var input_texture: texture_2d<f32>;
+@group(0) @binding(2) var<uniform> uniforms: UniformsSequenceParams;
+
+// YIQ input: texture already stores luma/chroma/phase — pass through directly
+fn sample_ntsc_signal(uv: vec2f) -> vec4f {
+ return textureSample(input_texture, input_sampler, uv);
+}
+
+#include "render/ntsc_common"