o
odinpkg.dev
packages / library / sans-graphics-api

sans-graphics-api

cdc9cb3library

I saw Tsoding do this on YouTube in C++ and wanted to try it in Odin. Odin comes with a GLSL math library which makes it easier!

ISC · updated 7 months ago

Sans Graphics API

Generates a shader animation on the CPU and writes the raw bytes for each frame directly to disk. Pure math + code. SANS GRAPHICS API. Finally, a little ffmpeg magic is used to bring it all together. Cowboy style. 🤠 Just like mother nature intended.

I saw Tsoding do this on YouTube.

shader output

If you watch the video, Tsoding has to write all of the GLSL code by hand. The joy of using Odin for this is that Odin comes with GLSL math in the core library! Odin is underappreciated.

Build

No binaries. You will need to build Sans Graphics API from source if you want to try it.

  1. Install Odin if you haven't done so already

  2. Clone this repository

git clone https://github.com/chris-braun/sans-graphics-api.git
  1. Run it with Odin
cd sans-graphics-api
odin run .

Notes

  • PPM spec - see the section Minimal Subset
  • ffmpeg -i output-%02d.ppm -r 60 output.mp4