Metal Shader Explorer
Native macOS Real-Time Procedural Shader Playground (Metal + C++20).

Metal Shader Explorer
Native macOS Real-Time Procedural Shader Playground (Metal + C++20)
Metal Shader Explorer is a native macOS application for exploring procedural 2D fragment shaders in real time. Built for performance and immediacy, it uses Apple Metal with a CVDisplayLink-driven render loop to deliver smooth, vsync-synchronized animation while keeping the CPU lightweight and the GPU fully utilized.
The app ships as a self-contained, dependency-free macOS build—leveraging only Apple frameworks—making it fast to build, easy to run, and highly portable across Metal-capable Macs.
What It Enables
• 122 curated shaders across 32 categories, ranging from classic demoscene staples to cosmic, organic, geometric, psychedelic, and retro CRT/VHS aesthetics
• 27 real-time parameters exposed through a UI overlay and keyboard controls
• Presets + blending, enabling seamless transitions between looks and styles
• Seed-based mutation, allowing deterministic variations for exploration and performance repeatability
• An optional evolution mode that automates parameter motion for hands-free discovery
The result is a “visual instrument”: a fast feedback loop for iterating on shader ideas, discovering new looks, and building repeatable visual palettes.
Architecture & Rendering Pipeline
The rendering model is intentionally simple and GPU-forward: 1. CVDisplayLink triggers the frame callback at the display refresh rate 2. A lightweight time system updates time / deltaTime (respecting pause and speed) 3. The app updates a uniform buffer each frame with the active shader’s parameters, seed, resolution, and input state 4. A fragment shader executes per-pixel on the GPU 5. The UI overlay is rendered to a texture and composited over the shader output 6. The final frame is presented through a Metal-backed view/layer
This approach achieves high frame rates by keeping the hot path tight: uniform updates + a single GPU pass, with clean separation between visual generation and UI.
Native UX & Interaction Design
The interface is optimized for quick iteration: • Overlay sliders for continuous parameter control • Keyboard shortcuts for show/hide UI, shader browsing, pause, fullscreen, seed randomize/mutate, preset load/save • Fast “scan through looks” workflow using next/previous shader navigation • Preset slots that support rapid A/B testing and live exploration
Quality, Testing & Reliability
A standout aspect of the project is its engineering rigor for a creative tool. The repository includes a substantial automated test suite covering: • UI layout and hit testing • Core timing and input systems • Preset storage and serialization • State management and utilities • Metal/GPU functionality (shader compilation, pipeline creation, dispatch)
Coverage is reported at ~98% line coverage, with gating scripts and Make targets to enforce thresholds and prevent regressions.
Build & Tooling
Build and run are intentionally streamlined: • Makefile-first workflow, Metal as the default target • Optional legacy OpenGL path for older compatibility needs • Separate test targets, coverage generation, and gated build scripts
This keeps iteration fast for shader development while still supporting disciplined CI-style validation.
Technology Stack
• Core: C++20, Objective-C++
• Rendering: Metal / MetalKit, Metal Shading Language (MSL)
• macOS Frameworks: Cocoa, CoreVideo, CoreGraphics, QuartzCore
• Build: Makefile
• Testing: GoogleTest, XCTest