Skip to content
This repository was archived by the owner on Dec 4, 2025. It is now read-only.

Implementing CPU Shaders using stdlib and ffmpeg (No Graphics API)

Notifications You must be signed in to change notification settings

JuaniRaggio/stdlib...shaders

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

stdlib...shaders

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

Output

Dependencies

  • ffmpeg
  • any cpp compiler for C++20 or above

How to generate the .mp4

  1. Compile the source file with any C++ compiler

    c++ -O3 -std=c++20 main.cpp
    # or
    ./build.sh
  2. Run output file

    ./a.out
  3. 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

Credits

This project is inspired by a tsoding video, Graphics API is irrelevant

About

Implementing CPU Shaders using stdlib and ffmpeg (No Graphics API)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published