← ClaudeAtlas

ghostty-shaderslisted

Write, debug, and optimize custom GLSL shaders for the Ghostty terminal. Covers Ghostty's Shadertoy-compatible GLSL ES 3.0 dialect, its terminal-specific uniforms (cursor position and color, focus state, event timestamps), the unsupported Shadertoy uniforms, focus-gated performance patterns, and adapting shaders from shadertoy.com. Use when creating or editing a .glsl file for Ghostty, diagnosing a shader that renders black or fails to compile, or setting custom-shader config.
martinemde/dotfiles · ★ 9 · Code & Development · score 72
Install: claude install-skill martinemde/dotfiles
# Ghostty Shaders Ghostty compiles Shadertoy-compatible GLSL ES 3.0 (WebGL 2.0) with terminal-specific extensions. `iChannel0` is the live terminal screen rather than an uploaded image, and the shader runs continuously while the terminal is visible — which makes performance and failure behavior matter more than they do on shadertoy.com. ## A broken shader can lock you out An invalid shader renders Ghostty as a black screen, including the window you would use to fix it. Keep a known-good shader to fall back to, build up from a passthrough rather than pasting a finished effect, and keep a non-Ghostty terminal reachable while iterating. The compile failures that cause this are mostly a short list: - `1.0f` — no `f` suffix on float literals in GLSL ES - `saturate()` — doesn't exist here; use `clamp(x, 0.0, 1.0)` - Negative input to `sqrt()` or `pow()` — wrap with `abs()` or `max(0.0, x)` - `mod(x, 0.0)` — division by zero - Uninitialized variables — no implicit zero - A function and a variable sharing a name ## Configuration ``` # Single shader custom-shader = ~/.config/ghostty/shaders/crt.glsl # Multiple shaders chain: each one's output becomes the next one's iChannel0 custom-shader = ~/.config/ghostty/shaders/blur.glsl custom-shader = ~/.config/ghostty/shaders/vignette.glsl # Animation control custom-shader-animation = true # Default: animate when focused custom-shader-animation = false # Static: only render on terminal updates custom-shader-animation = always