This is a single-file implementation of shaders using only the stdlib. Shaders where initially writen in GLSL Check it out, but as you can see, you don't need GLSL
- ffmpeg
- any cpp compiler for C++20 or above
-
Compile the source file with any C++ compiler
c++ -O3 -std=c++20 main.cpp # or ./build.sh -
Run output file
./a.out
-
Generate the video There are multiple ways to generate the video, explore ffmpeg, its a great tool
cd frames ffmpeg -framerate 30 -i out%03d.ppm -c:v libx264 -pix_fmt yuv420p temp.mp4 ffmpeg -i temp.mp4 -vf reverse reversed.mp4 ffmpeg -i temp.mp4 -i reversed.mp4 -filter_complex "[0:v][1:v]concat=n=2:v=1[out]" -map "[out]" seamless_loop.mp4
This project is inspired by a tsoding video, Graphics API is irrelevant
