A high-performance, hybrid CPU/GPU shader engine and video generator.
Deep Sea![]() |
Fractal![]() |
Polar![]() |
Raymarch![]() |
Ripple![]() |
Starfield![]() |
Tzozen![]() |
Voronoi![]() |
Bubbles![]() |
Eshi (Japanese for "painter" or "artist") is a minimal C++ framework that turns mathematical formulas into video. It allows you to write GLSL-style logic directly in C++, rendering procedural art to high-quality video files (.mp4) or a live window preview.
"Painting pixels with math." 🥴🍹💫 -me
This project is heavily inspired by and builds upon the foundational concepts of Tzozen's checker.c.
Eshi evolves this concept by embedding the encoding pipeline directly into the application, supporting multi-threaded CPU rendering (OpenMP), GPU acceleration (CUDA & OpenGL), and live previews (SDL2).
- Hybrid Rendering: Seamlessly switch between CPU (OpenMP), GPU (CUDA), and GPU (OpenGL) rendering engines.
- Live Preview: Tweak your shaders in real-time with an SDL2 window (
--live). - Zero-IO Video: Renders directly to H.264 (
.mp4) in memory using linked FFmpeg libraries. - Modern CLI: Beautiful terminal UI powered by Gum.
- C++ Shaders: A robust math library (
glsl_core.h) that emulates GLSL types (vec2,vec4) and intrinsics in standard C++. - Arm64 Support: Native compilation and hardware acceleration on Windows on Arm (Snapdragon) devices.
1. System Libraries:
# Core Dependencies
sudo apt install pkg-config libavcodec-dev libavformat-dev libavutil-dev libswscale-dev libomp-dev libsdl2-dev
# Install Gum (for the CLI dashboard)
sudo mkdir -p /etc/apt/keyrings
curl -fsSL [https://repo.charm.sh/apt/gpg.key](https://repo.charm.sh/apt/gpg.key) | sudo gpg --dearmor -o /etc/apt/keyrings/charm.gpg
echo "deb [signed-by=/etc/apt/keyrings/charm.gpg] [https://repo.charm.sh/apt/](https://repo.charm.sh/apt/) * *" | sudo tee /etc/apt/sources.list.d/charm.list
sudo apt update && sudo apt install gum2. Compile:
make -j$(nproc)(Note: If nvcc is found in your PATH, Eshi automatically compiles with CUDA support.)
Troubleshooting CUDA Paths:
If the build fails with /usr/bin/ld: cannot find -lcudart, your CUDA installation may be in a non-standard location (common on Arch/CachyOS).
You can fix this by editing the CUDA_PATH_LINUX variable at the top of the Makefile, or by passing it directly to make:
# Example for Arch Linux / CachyOS
make CUDA_PATH_LINUX=/opt/cuda -j$(nproc)1. Prerequisites:
- Visual Studio (MSVC C++ Compiler)
- CUDA Toolkit (Must be installed and
nvccreachable) - vcpkg package manager
2. Install Dependencies: Open a terminal in the project root and run:
vcpkg install --triplet x64-windows3. Configure & Compile:
- Open
build_all.batin a text editor. - Update
VCPKG_ROOTandCUDA_PATHvariables. - Run
build_all.bat.
1. Prerequisites:
- Visual Studio 2022 (Ensure "ARM64 build tools" are installed)
- vcpkg package manager
- OpenCL™ and OpenGL® Compatibility Pack (Install from Microsoft Store to enable Adreno GPU support)
2. Install Dependencies: Open a terminal in the project root and run:
vcpkg install --triplet arm64-windows3. Configure & Compile:
- Open the ARM64 Native Tools Command Prompt for VS 2022.
- Open
build.arm64.batand updateVCPKG_ROOT. - Run the build script:
build.arm64.bat
- Executables will be generated in
build/.
The easiest way to run demos is with the beautified shell script (Linux/WSL only currently):
./run_demos.shThis launches a GUI-like menu in your terminal to select CPU/GPU modes and shows progress bars for renders.
You can also run the built binaries directly from the build/ folder:
Render to Video:
# Linux
./build/deepsea
# Windows
.\build\deepsea.exe
# Output: deepsea.mp4 (in build/)Live Preview:
./build/deepsea --live
# Opens a window. Press ESC to close.Options:
--gpu: Use hardware acceleration (CUDA on x64, OpenGL on Arm64).--live: Render to window instead of file.--res WxH: Set resolution (e.g.,--res 1920x1080). Default is 960x540.
Define your art in shader.cpp using the mainImage function (Shadertoy style):
void mainImage(vec4 &fragColor, vec2 fragCoord, vec2 iResolution, float iTime) {
vec2 uv = fragCoord / iResolution.y;
// ... your GLSL logic here ...
fragColor = vec4(uv.x, uv.y, 0.5f + 0.5f*sinf(iTime), 1.0f);
}Rebuild to update the binary.
This project retains the MIT License of the original code.
З.Ы. Если вы дочитали до этого места, буду благодарен за звезду!
🥂 За здоровье!









