From 3547424b8c5f3884f84d16fb3f08b47965d62428 Mon Sep 17 00:00:00 2001 From: skal Date: Tue, 10 Mar 2026 20:42:32 +0100 Subject: 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 --- src/effects/ntsc_effect.h | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'src/effects/ntsc_effect.h') diff --git a/src/effects/ntsc_effect.h b/src/effects/ntsc_effect.h index d8624ea..4737291 100644 --- a/src/effects/ntsc_effect.h +++ b/src/effects/ntsc_effect.h @@ -1,12 +1,22 @@ -// NTSC post-process effect with fisheye distortion +// NTSC post-process effects: RGB and YIQ input variants. #pragma once #include "effects/shaders.h" #include "gpu/wgsl_effect.h" +// RGB input: converts RGB → YIQ internally (standard post-process use). struct Ntsc : public WgslEffect { Ntsc(const GpuContext& ctx, const std::vector& inputs, const std::vector& outputs, float start_time, float end_time) : WgslEffect(ctx, inputs, outputs, start_time, end_time, - ntsc_shader_wgsl) {} + ntsc_rgb_shader_wgsl) {} +}; + +// YIQ input: input texture already stores luma/chroma/phase (e.g. RotatingCube output). +struct NtscYiq : public WgslEffect { + NtscYiq(const GpuContext& ctx, const std::vector& inputs, + const std::vector& outputs, float start_time, + float end_time) + : WgslEffect(ctx, inputs, outputs, start_time, end_time, + ntsc_yiq_shader_wgsl) {} }; -- cgit v1.2.3