treppe-gl/README.md
April John 0ff391bfa1 Add brightness option and run/dry wrapper scripts
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-16 14:38:55 +02:00

31 lines
1.5 KiB
Markdown

# treppe-gl
Render Shadertoy style GLSL shaders onto the treppe2000.
The shader is rendered into a 16x1 float framebuffer (x = stair step) and
sent as RGBW16 UDP frames to the priority port (3124) of `trepped` on
`treppe.club.berlin.ccc.de`. While it runs it overrides whatever else the
stairs show. On exit it sends a black frame. The stairs power must be on
(Bluescreen > Stairs).
nix-shell --run "python treppe_gl.py shaders/flow.glsl"
nix-shell --run "python treppe_gl.py shaders/pulse.glsl --dry-run"
Wrappers: `./treppe-run.sh <shader> [brightness]` and `./treppe-dry.sh <shader> [brightness]` (dry run, nothing is sent).
Options: `--brightness 0-100` (scales output, default 100), `--host`, `--port`, `--fps`, `--dry-run` (send nothing),
`--no-window` (headless), `--white {extract,alpha,off}`.
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.
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.
Debug window: top is the shader at full resolution, bottom are the 16 steps
as sent (step numbers, colour, white bar). Steps 13-15 are greyed out,
`trepped` only drives 13 channels. The step to channel mapping is done by
`trepped`, frames are sent in step order.
Tests: `nix-shell --run "python -m pytest tests"`.