kik shader: derive step from resolution so the full preview scales

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
April John 2026-10-16 14:52:49 +02:00
commit b158c36502
2 changed files with 5 additions and 1 deletions

View file

@ -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.

View file

@ -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);