ShadertoyMetal

Native macOS Shadertoy renderer using Metal. Translates GLSL shaders to MSL via SPIRV-Cross.

Requirements

  • macOS 13.0+
  • Apple Silicon (arm64)
  • Xcode Command Line Tools
  • CMake

Build

git clone --recursive https://github.com/user/ShadertoyMetal.git
cd ShadertoyMetal
make

The app is built to build/app/Build/Products/Release/ShadertoyMetal.app.

Usage

GUI

make run
# or
open build/app/Build/Products/Release/ShadertoyMetal.app

CLI

./build/app/Build/Products/Release/ShadertoyMetal.app/Contents/MacOS/ShadertoyMetal [options] <shader.glsl>

Options:
    --texture [0-3][flags]:<path>   Load texture (flags: r=repeat, n=nearest)
    --geometry WxH+X+Y              Window geometry

Keyboard

  • q / Escape - Quit
  • f - Toggle fullscreen

Shadertoy Compatibility

Supported uniforms: iResolution, iTime, iMouse, iChannel0-3, iFrame, iTimeDelta, iDate, iSampleRate

void mainImage(out vec4 fragColor, in vec2 fragCoord)

License

AGPL-3.0