From 58112b4fbc95d188ce2c001f84a810b2c57fe3c2 Mon Sep 17 00:00:00 2001 From: skal Date: Tue, 10 Mar 2026 21:47:56 +0100 Subject: change dither_c64() signature to take 'dimension' directly --- src/shaders/math/color_c64.wgsl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/shaders/math/color_c64.wgsl') diff --git a/src/shaders/math/color_c64.wgsl b/src/shaders/math/color_c64.wgsl index 60fde28..2a86919 100644 --- a/src/shaders/math/color_c64.wgsl +++ b/src/shaders/math/color_c64.wgsl @@ -44,10 +44,10 @@ fn colorDistance(color: vec4f, c1: vec4f, c2: vec4f, frac: f32) -> f32 { } // Quantize col to the nearest C64 color pair using 8x8 Bayer dithering. -// xsize/ysize: virtual pixel grid dimensions (e.g. 54.*8., 33.*8.). -fn dither_c64(col: vec4f, uv: vec2f, xsize: f32, ysize: f32) -> vec4f { - let ix = u32(floor(uv.x * xsize / 2.)) % 8; - let iy = u32(floor(uv.y * ysize / 2.)) % 8; +// dimension: virtual pixel grid dimensions (e.g. {54.*8., 33.*8.}). +fn dither_c64(col: vec4f, uv: vec2f, dimension: vec2f) -> vec4f { + let ix = u32(floor(uv.x * dimension.x)) % 8; + let iy = u32(floor(uv.y * dimension.y)) % 8; let thresh = f32(BAYER_8X8[ix + 8 * iy]) / 64.; var color = min(col, vec4f(1.)); -- cgit v1.2.3