diff options
Diffstat (limited to 'src/shaders/math')
| -rw-r--r-- | src/shaders/math/color.wgsl | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/shaders/math/color.wgsl b/src/shaders/math/color.wgsl index 0639bf7..f5f06f8 100644 --- a/src/shaders/math/color.wgsl +++ b/src/shaders/math/color.wgsl @@ -27,13 +27,13 @@ fn yiqa_to_rgba(yiq: vec4f) -> vec4f { // Convert RGBA to packed luma/chroma/phase signal for NTSC processing. // Returns vec4f(luma, chroma_level, phase/TAU, alpha). -// ysize: virtual scanline count (e.g. 33.*8.); drives 22.5-degree inter-line phase shift. +// ysize: virtual scanline count (e.g. 264 lines); drives 22.5-degree inter-line phase shift. fn rgba_to_luma_chroma_phase(rgba: vec4f, uv_y: f32, ysize: f32) -> vec4f { let yiq = rgba_to_yiqa(rgba); let chroma_level = length(yiq.yz); let mscanl = (uv_y * ysize) % 2.0; - let phase = atan2(yiq.y, yiq.z) - 0.3926991 + mscanl * 0.19634954; - return vec4f(yiq.x, chroma_level, phase / TAU_COLOR, yiq.a); + let phase = atan2(yiq.y, yiq.z) / TAU_COLOR - (1. - mscanl * 0.5) / 16.; + return vec4f(yiq.x, chroma_level, phase, yiq.a); } // sRGB to Linear approximation |
