35 lines
1.7 KiB
Markdown
35 lines
1.7 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.
|
|
|
|
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.
|
|
|
|
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"`.
|