Tgpu
Experimenting with rendering 3D graphics in the terminal
Install / Use
/learn @zackradisic/TgpuREADME
tgpu
A stupid experiment in rendering 3D graphics to the terminal using the kitty graphics protocol
I've only tested it with Ghostty.
Trying it out
View the demo with different scenes:
cargo run --release
Run shadertty, shadertoy but it runs in your terminal:
cargo run --release -- --shadertoy shader.glsl --ichannel0=perlin_noise.png
How it works
- Uses wgpu to render graphics on the GPU.
- Blits the output texture to 2 double-buffered mmap'ed files using copy_texture_to_buffer
- Emits kitty graphics protocol escape code to instruct terminal to render one file as an image
- Uses spin_sleep to cap the render loop to 60 FPS
Things to note
- I've only tested this on macOS and ghostty
- This only works for terminals which support the kitty graphics protocol
- There is no way to do vsync (that I know of)
- This was vibecoded in a weekend for fun
