From b158c36502f0795b6dd8e2d7717985ba46fff603 Mon Sep 17 00:00:00 2001 From: April John Date: Fri, 16 Oct 2026 14:52:49 +0200 Subject: [PATCH] kik shader: derive step from resolution so the full preview scales Co-Authored-By: Claude Sonnet 5.5 --- README.md | 4 ++++ shaders/kik.glsl | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 3f77e45..f11f053 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,10 @@ Shaders define `mainImage(out vec4 fragColor, in vec2 fragCoord)` and may use `iResolution`, `iTime`, `iTimeDelta` and `iFrame`. The file is reloaded when it changes; on a compile error the last working shader keeps running. +The same shader also runs at full size in the debug window, so derive the +step from the resolution (`floor(fragCoord.x / iResolution.x * 16.0)`) or use +`fragCoord.x / iResolution.x`, never raw `fragCoord.x`. + White channel: `extract` (default) sets `w = min(r,g,b)` and subtracts it from rgb, `alpha` uses the shader's alpha, `off` sends w = 0. diff --git a/shaders/kik.glsl b/shaders/kik.glsl index 28ad80f..f764552 100644 --- a/shaders/kik.glsl +++ b/shaders/kik.glsl @@ -150,7 +150,7 @@ vec3 events(vec3 col, float i, float t) { } void mainImage(out vec4 fragColor, in vec2 fragCoord) { - float i = floor(fragCoord.x); + float i = floor(fragCoord.x / iResolution.x * 16.0); // step, also in the big preview float t = iTime; float k = floor(t / SCENE_LEN);