CRTty - Retro CRT shader for kitty (also a framework) #9501
Replies: 1 comment
-
|
How would animations work? kitty only redraws aka calls swapbuffers while the cursor is blinking or some internal animation is playing. Also the performance of this would be pretty ppor since it has to capture and then modify the framebuffer. Finally the user framebuffer wont have access to geometry information like the position of windows/scrollbars/cursors etc. You could remedy these issues by integrating this with kitty itself rather than using LD_PRELOAD. But note that in order to do that, I would require the user shaders to be in some kind of meta shading language that can compile down to the major shading languages of glsl, spir-v/vulkan and metal. This is because it is on my TODO list to add different GPU backends to kitty, so GLSL wont be enough. IIRC there are some projects that implement such a meta language, for example, IIRC CrossGL is a pure python one that would integrate well with kitty, though not sure if it supports all the necessary backend targets. It does have the advantage that it can at least theoretically go from GLSL to anything so users could still write shaders in GLSL rather than the meta language. You could then hook into the kitty rendering pipeline in start_os_window_rendering using the needs_layers branch, which anyway renders to an FBO that you can use as input to the custom shader alongwith uniforms specifying geometry information. However, this will all be a fair amount of work, not sure if you want to get that involved. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Built a post-processing shader framework that injects into kitty via
LD_PRELOAD.- just a single .so.
202602122049.mp4
Ships with a CRT effect (rolling scanlines, chromatic aberration, phosphor sub-pixels, vignette, barrel distortion) but you can also drop in any
.glslfile.Custom shaders get u_time and u_resolution uniforms for free, so animations work out of the box. Comes with example shaders including an animated retro CRT with per-line flicker and rolling interference bands.
Written in Rust. Zero dependencies at runtime.
GitHub: https://github.com/kosa12/CRTty
Feedback, PRs, Issues, stars are welcome!
Beta Was this translation helpful? Give feedback.
All reactions