$ show sahaj-b/ghostty-cursor-shaders
This repository provides a collection of GLSL shaders for enhancing cursor effects in the Ghostty terminal. It implements various visual effects including trail effects (cursor_sweep, cursor_tail, cursor_warp) that animate cursor movement, and pulse/boom effects (sonic_boom_cursor, ripple_cursor, etc.) that trigger on cursor shape changes. Each shader is self-contained and follows Ghostty's custom shader interface, using uniforms like iCurrentCursor, iPreviousCursor, and iTime to create animated effects. The trail shaders demonstrate particular sophistication with custom signed distance function implementations for rectangles and parallelograms, easing functions, and anti-aliasing.
The LLM identified 3 files worth highlighting for reuse:
Implements a Neovide-like cursor warp effect with sophisticated corner-based animation where each corner of the cursor trails at different speeds based on movement direction. Features custom SDF for convex quadrilaterals, per-corner duration calculation using dot products, optional fade gradient along the trail, and anti-aliasing. Highly self-contained with all math implemented from scratch.
Creates an animated trail that shrinks from previous to current cursor position. Combines parallelogram SDF (for diagonal moves) and rectangle SDF (for straight moves) with intelligent selection based on movement direction. Includes multiple easing function options and proper anti-aliasing. Demonstrates advanced 2D distance function implementation.
Implements a comet-like cursor tail effect similar to Kitty terminal's cursor_trail. Uses parallelogram and rectangle SDFs with easing functions to create a trailing effect that follows cursor movement. Features head/tail easing differentiation and straight/diagonal move detection.