Repository navigation
Shaders
tron can run WGSL post-processing shaders on the rendered terminal: CRT screens, bloom, animated backgrounds, cursor trails and more. Shaders run on the GPU after the terminal is drawn, in the order you list them.
List shader files under [shader] in ~/.config/tron/config.toml:
[shader]
files = ["crt.wgsl", "cursor-trail.wgsl"]- Built-in shaders need no file. Just name them.
- Your own shaders go in
~/.config/tron/shaders/<name>.wgsl. A file with the same name as a built-in shader replaces it. - Shaders run in the listed order; each one sees the output of the one before.
-
files = []turns shaders off.
The Shaders tab of the startup screen (tron --startup) previews every
shader live and saves your selection.
Saving a shader file reloads it right away. Shaders compile in the background, so the terminal keeps drawing while a new shader loads. A shader that fails to compile is reported with its error message and line number; the line numbers count the prelude lines that tron puts in front of every shader.
[shader]
animation = "auto" # auto, always or never
fps = 0 # cap for continuous animations; 0 (default) follows the display-
auto(default): shaders that readtron.timeortron.frameanimate continuously. Cursor shaders that readtron.cursor_change_timeortron.previous_cursoranimate for one second after each cursor move, then stop. All other shaders redraw only when the terminal changes. -
always: animate continuously. -
never: redraw only when the terminal changes, even for animated shaders.
Continuous animations, like backgrounds, run at the display's refresh rate by
default. To save power, cap them with fps, for example fps = 30, or pick
Animation frame rate in the startup screen's Settings tab. Output, typing and
cursor shaders are never held back: they always draw at the display's rate.
tron saves power around animations:
- With a cap, animations run at 10 frames per second at most while the window has no focus.
- While the window is hidden, minimized or covered, animations stop.
- When only the animation changes, tron reuses the rendered terminal and runs just the shaders, instead of drawing every glyph again.
| File | Effect |
|---|---|
crt.wgsl |
Barrel distortion, scanlines and vignette |
bloom.wgsl |
Neon glow around bright text |
cursor-glow.wgsl |
Pulsing glow around the cursor |
cursor-trail.wgsl |
A smear from the previous cursor position that fades over 150 ms |
afterglow.wgsl |
Phosphor afterglow: disappearing text fades out over a few frames |
| File | Effect |
|---|---|
bettercrt.wgsl |
Curved CRT screen with dark scanlines |
retro-terminal.wgsl |
Curved teal CRT monitor with dark scanlines |
crt-lottes.wgsl |
Timothy Lottes CRT: warped tube, scanlines and shadow mask |
in-game-crt.wgsl |
Stylized video game CRT: curve, fringing, grille, flicker, bloom |
tft.wgsl |
TFT LCD look: a dark pixel grid |
dither.wgsl |
Ordered 4x4 Bayer dithering |
drunkard.wgsl |
Wobbly distortion with color fringing |
glitchy.wgsl |
Analog glitch: jitter, RGB split and scanlines every 10 s |
glow-rgbsplit-twitchy.wgsl |
Twitchy RGB split with a glow around text |
bloom-spiral.wgsl |
Soft bloom from 24 golden spiral samples |
negative.wgsl |
Inverted colors |
spotlight.wgsl |
A soft spotlight wandering over a dimmed terminal |
water.wgsl |
Rippling water caustics |
These draw behind dark parts of the terminal, so text stays readable.
| File | Effect |
|---|---|
animated-gradient-shader.wgsl |
Slowly shifting three color gradient |
gradient-background.wgsl |
Static blue to red diagonal gradient |
starfield.wgsl |
White stars flying toward you |
starfield-colors.wgsl |
Colorful stars flying toward you |
starfield-dark.wgsl |
A dim, sparse, slow starfield |
galaxy.wgsl |
Drifting starfield and nebula |
cubes.wgsl |
Faint field of tumbling cubes |
cineshader-lava.wgsl |
Lava lamp blobs |
fireworks.wgsl |
Rainbow firework bursts |
fireworks-rockets.wgsl |
Rockets that rise and burst into sparks |
sparks-from-fire.wgsl |
Glowing sparks and smoke |
just-snow.wgsl |
Parallax snowfall |
underwater.wgsl |
Underwater sun rays |
gears-and-belts.wgsl |
Scrolling gears and conveyor belts |
sin-interference.wgsl |
Colorful interference rings |
matrix-hallway.wgsl |
Green matrix rain hallway |
inside-the-matrix.wgsl |
Walk through a 3D hallway of matrix rain |
smoke-and-ghost.wgsl |
Smoke rising from black pixels, with ghosts in thick smoke |
| File | Effect |
|---|---|
cursor-glow.wgsl |
Pulsing glow |
cursor-trail.wgsl |
Fading smear |
cursor-sweep.wgsl |
Trail that shrinks from the old position into the new one |
cursor-tail.wgsl |
Comet-like tail, similar to kitty's cursor trail |
cursor-warp.wgsl |
Neovide-like trail whose corners stretch and catch up |
rectangle-boom-cursor.wgsl |
Rectangle that bursts out of the cursor |
ripple-cursor.wgsl |
Circular ripple |
ripple-rectangle-cursor.wgsl |
Rectangular ripple |
sonic-boom-cursor.wgsl |
Expanding filled circle |
party-sparks.wgsl |
Colorful plasma sparks |
Combine a screen effect, a background and a cursor effect:
[shader]
files = ["starfield-dark.wgsl", "cursor-tail.wgsl", "bloom.wgsl"]Many built-in shaders are WGSL ports of Shadertoy and Ghostty shaders by other
authors. Each keeps its original license, and several are CC BY-NC-SA
(non-commercial). The Credits tab of the startup screen and
examples/shaders/README.md
list every author and license.
To write your own, see Writing Shaders.
Using tron
Looks
Features
Reference