A high-performance, commercial-grade visual shader compositor, real-time development environment & Agentic AI visual sandbox.
Compose, inspect, and iterate on 3D shaders, compute simulations, and PBR materials across WebGPU, WebGL2, and Three.js with zero engine overhead.
Shader Studio transforms graphics programming into an agile, visual, and AI-collaborative creative workflow. Built from the ground up for technical artists, game developers, creative coders, and autonomous AI agents, Shader Studio provides live shader recompilation as you type, WebGPU compute shaders, and turnkey production pipelines.
Whether you are designing procedural materials for Unity, Godot, or Three.js, testing audio-reactive visualizers, or pairing with Claude, Gemini, OpenAI, or local Ollama models via the Model Context Protocol (MCP), Shader Studio gives you real-time visual feedback without the heavyweight bloat of traditional game engines.
Shader Studio features a complete closed-loop AI runtime that empowers language models to see, inspect, and iterate on shader code in real time:
- Universal Model Context Protocol (MCP) Server (
scripts/mcp-server.js): Connect Cursor, Claude Desktop, or Antigravity directly to your running canvas via stdio JSON-RPC. External agents can callrender_shader,get_viewport_snapshot,get_bridge_status,list_templates,load_template, andtranspile_shader. - Integrated In-App Copilot (
src/components/sidebars/AICopilotSidebar.tsx): Multi-provider AI assistant supporting cloud models (Anthropic Claude, Google Gemini, OpenAI) and local zero-cost models (Ollama onlocalhost:11434, LM Studio onlocalhost:1234). - Autonomous Vision Loop & Auto-Fix: The AI compiles shader code, captures high-resolution viewport frames (
POST /api/agent/capture), inspects GPU error diagnostics, and self-corrects broken shaders automatically.
Export your procedural shaders directly into production-ready game engine formats with one click in the Export Modal:
- Unity URP HLSL (
.shader): ShaderLab syntax with auto-generatedProperties {}blocks,CBUFFER_START(UnityPerMaterial), vertex programs, and HLSL fragment functions. - Godot 4 Spatial (
.gdshader): Godot 4.x shading language with typed uniforms (uniform vec3 u_color : source_color;,uniform float u_speed;) andfragment() { ALBEDO = ... }outputs. - Shadertoy GLSL (
.glsl): PortablemainImage(out vec4 fragColor, in vec2 fragCoord)entry point mapped toiTimeandiResolution. - React Three Fiber Component (
.tsx): Typed React Three Fiber material wrapper with reactive uniform hooks. - Webflow / HTML Canvas Embed (
.html): Single paste-in HTML embed (canvas plus script) that renders your GLSL through three.js r128, which it loads from the cdnjs CDN, so the page needs network access.
- Drag and drop any
.glb,.gltf, or.obj3D model directly onto the MeshNode. - Automatic mesh normalization: centers asset origin at
(0, 0, 0), scales dimensions to fit the unit bounding sphere, and synthesizes smooth vertex normals if missing. - Seamless multi-backend synchronization across WebGPU, WebGL2, and Three.js with live triangle counters and wireframe overlays.
- Generate production-quality PBR texture suites directly from your procedural shaders:
- Albedo / Base Color Map
- Tangent-Space Normal Map (computed via 3x3 Sobel gradient filtering with DirectX / OpenGL Y-flip toggle)
- Roughness Map
- Height / Displacement Map
- Metallic Map
- Ambient Occlusion (AO) Map
- Choose resolutions from 512x512 up to 4096x4096 (4K).
- Built-in zero-dependency PKZIP 2.0 archiver (
src/utils/zipBuilder.ts) bundles maps andmaterial_manifest.jsoninto a single downloadable ZIP archive.
- High-bitrate (up to 25 Mbps) canvas
MediaRecordervideo capture engine. - Configurable duration (2s to 8s loop intervals) and framerate (30fps or 60fps).
- Real-time recording progress bar with live pulsating indicator and instant WebM preview & download.
- Web Audio API DSP pipeline with 512-bin real-time FFT spectrum analysis and spectral flux beat detection.
- Interactive Audio Binding: Link any numeric slider to BASS, MID, TREBLE, BEAT, or LEVEL with customizable modulation intensity (0.1x to 5.0x).
- Non-Destructive GPU Streaming: Modulated values stream into GPU uniform buffers on every frame without modifying base values in the project store.
- Built-in Electronic Synthesizer: Procedural 4-bar drum & bass loop generated in-memory with zero network or audio file dependencies, plus microphone input and audio file import.
Seven shader templates ready to load with one click. Every template runs on WebGPU, WebGL2, and Three.js:
- Iridescent Torus Knot Hero: Thin-film iridescent chrome torus knot with Fresnel rim glow, audio pulsation, and Blinn-Phong highlights.
- Holographic Energy Shield: Hexagonal energy barrier with animated scanlines, edge Fresnel emission, and chromatic aberration.
- Boiling Solar Plasma Orb: Turbulent multi-octave FBM convective plasma cells with coronal flares and high-temperature radiation.
- Cyberpunk Synthwave Grid: Retro 80s endless perspective neon grid with glowing horizon sun and atmospheric fog.
- Liquid Chrome & Thin-Film Iridescence: Specular liquid mercury with angle-dependent chromatic thin-film wave interference.
- Tropical Ocean & Voronoi Caustics: Deep oceanic sunlight transmission with animated Voronoi water refraction ripples.
- Cosmic Nebula & Twinkling Stars: Deep space volumetric gas clouds with parallax star dust and stellar nurseries.
The three SDF templates (Organic Metaball Fusion, Morphing Twisted Torus, Infinite Procedural Columns) are node graphs and are listed in section 9.
- 100% In-Memory Procedural HDR Synthesis: 5 mathematical studio environments generated on-the-fly (
studio_warm,cyberpunk_neon,sunset,nebula,clean_neutral) with zero external asset downloads or CORS blocks. - Full Lighting Controls: Interactive ParameterPanel controls for Exposure (0.1x to 4.0x), 360Β° Rotation (0Β° to 360Β°), Background Blur (0.0 to 1.0), and a toggleable panoramic Skybox.
- Universal Multi-Adapter Support: Native ACESFilmic tone mapping and PMREM reflections in Three.js, dedicated uniform/texture unit bindings in WebGL2, and direct GPU texture allocation in WebGPU.
- Modular Node Architecture:
SdfPrimitiveNode: Sphere, Box, Torus, Cylinder, Capsule, Plane with interactive real-time dimensions and offsets.SdfOperatorNode: Smooth Union (smin), Union, Subtraction, Intersection, Repetition, and Twist deformation.RaymarchNode: Real-time volumetric raymarching engine with customizable max steps, soft shadow penumbras, and ambient occlusion (AO).
- Turnkey Shader Generation: Graph compiler translates the visual SDF node tree directly into optimized GLSL 300 es and WGSL fragment shaders.
- Pre-Built Curated Templates: Instant 1-click loading for Organic Metaball Fusion, Morphing Twisted Torus, and Infinite Procedural Columns.
- Press Spacebar anywhere on the visual canvas to open the fuzzy-searchable Node Palette.
- Fast category filtering across Geometry, Shading, Post-Processing, Dynamics & Audio, SDF & Raymarching, and Output.
- Full keyboard navigation (
β/βto highlight,Enterto place,Escto close).
- Save multiple aesthetic iterations of your shader parameters as named snapshots.
- Switch between variations with 1 click to preview different color schemes, speeds, and textures.
- Full snapshot preservation in
.shaderstudioproject bundles.
- Save, load, import, and export entire projects as
.shaderstudiobundles. - Preserves node graph topology, custom shader source code, parameter states, audio bindings, environment lighting, and variation snapshots.
- Robust schema validation and automatic Dexie.js IndexedDB local caching.
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Shader Studio β
βββββββββββββββββββ¬ββββββββββββββββββββββββββββ¬ββββββββββββββββ€
β Left Panel β Center Workspace β Right Panel β
β β β β
β Node Graph β βββββββββββββββββββββ β Parameters β
β (React Flow) β β Viewport Canvas β β (Reflected UI)β
β β β (WebGPU/GL2/3JS) β β + Audio Sync β
β MeshNode β βββββββββββββββββββββ€ βββββββββββββββββ€
β MaterialNode β β Shader Editor β β Asset Drop β
β TextureNode β β (Monaco Fallback) β β & Variations β
β PostProcessNodeβ βββββββββββββββββββββ β & Project DB β
β AudioNode β βββββββββββββββββββββ β (Dexie.js) β
β ComputeNode β β AI Copilot Drawer β β β
βββββββββββββββββββ΄ββββ΄ββββββββββββββββββββ΄ββββ΄ββββββββββββββββ€
β Collapsible Error Diagnostics & Perf Overlay β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
- Independent Graphics Adapters: WebGPU, WebGL2, and Three.js implement an identical contract (
mount,render,updateUniform,recompileShader,dispose) without forced inheritance hierarchies or leaky abstractions. - Native Language Sources: Full native WGSL and GLSL ES 3.00 pipelines without forced cross-compilers, unlocking raw hardware performance.
- Decoupled Visual State: React Flow retains graph geometry, pan, and zoom, while Zustand synchronizes application state, active backends, and uniform buffers.
- Compiled Render Queue: Visual graphs compile into an optimized
RenderQueuebefore reaching the active GPU adapter.
- Node.js: v22.18.0 or higher (the MCP server relies on Node's built-in TypeScript type stripping)
- Browser: Modern Chromium browser with WebGPU enabled (Chrome 113+, Edge 113+) or modern Firefox / Safari with WebGL2 support.
-
Clone the repository:
git clone https://github.com/Binitpyro/ShaderStudio.git cd ShaderStudio -
Install dependencies:
npm install
-
Start the development server:
npm run dev
Open http://localhost:5173 in your browser.
ShaderStudio uses npm scripts (defined in package.json, implemented in scripts/) to build the web distribution and package standalone Windows binaries:
Compiles the Rust WebAssembly engine (wasm-pack must be on your PATH), runs typechecking, and generates optimized assets in dist/:
npm run build:all
# or: node scripts/build-all.js
# flags: --skip-wasm (skip the WebAssembly step), --test (also run cargo and vitest tests)npm run build runs only the TypeScript check and the Vite bundle (tsc -b && vite build). It does not rebuild the WebAssembly package.
npm run build:exe compiles crates/shaderstudio_desktop into a single, portable, zero-dependency ShaderStudio.exe that embeds all HTML, CSS, JavaScript, and WebAssembly assets in-memory. The executable is written to the repository root as ShaderStudio.exe:
npm run build:exe
# or: node scripts/build-exe.js
# flag: --full (rebuild dist/ first; dist/ is built automatically if it is missing)Running ShaderStudio.exe:
- Desktop Mode: Simply double-click
ShaderStudio.exe. It automatically starts an in-memory HTTP server and launches your default browser. - Command Line Options:
ShaderStudio.exe # Default port: 8650 (next free port if busy) ShaderStudio.exe --port 9000 # Custom port ShaderStudio.exe --headless # Run server without launching browser window
The Tauri shell runs the same Vite frontend in a native window:
npm run tauri:dev: runsnpm run dev(http://localhost:5173) and opens the app window (tauri dev).npm run tauri:build: runstauri build, which first runsnpm run build(beforeBuildCommand). The bundled frontend is read fromdist/.
Project save and open go through native file dialogs. Project paths must end in .shaderstudio or .json, and double extensions such as evil.exe.json are rejected. A file is read or written only if it was picked in a dialog during that session, plus the app's default Documents/ShaderStudio/untitled.shaderstudio path (src-tauri/src/commands/fs_dialog.rs).
To connect external AI coding tools (Cursor, Claude Desktop, or Antigravity) directly to Shader Studio, two processes are involved:
- Dev bridge (
scripts/bridge.js,npm run bridge): an HTTP and WebSocket server on port8642. The browser app connects to it. - MCP server (
scripts/mcp-server.js,npm run mcp): a stdio JSON-RPC server. Your AI client launches it and it talks to the bridge.
ws is a devDependency, so npm run bridge needs a normal npm install (not --omit=dev).
The bridge accepts browser origins localhost/127.0.0.1 on ports 5173 and 4173 plus the Tauri origins; add others with SHADER_STUDIO_ALLOWED_ORIGINS (comma-separated). Its AI proxy reaches local models only on Ollama's port 11434, LM Studio's 1234 and the default custom endpoint's 8080; add ports with SHADER_STUDIO_PROXY_LOCAL_PORTS (comma-separated). /api/file serves only .wgsl, .glsl, .frag and .vert files.
-
Start the bridge:
npm run bridge
It prints an
Open Studio: http://localhost:5173/?token=...link. Open that link in your browser so the page receives the token. The bridge also writes the token to~/.shader-studio/bridge-token, which the MCP server reads. The file is deleted when the bridge exits. To supply the token yourself, setSHADER_STUDIO_BRIDGE_TOKEN. To use a different token file, setSHADER_STUDIO_TOKEN_FILE. -
Add the MCP server to your AI client's configuration. For example, in Claude Desktop (
claude_desktop_config.json):{ "mcpServers": { "shader-studio": { "command": "node", "args": ["<path>/scripts/mcp-server.js"] } } }Replace
<path>with the absolute path to your clone of this repository. -
Your external AI can now render shaders, inspect live frame captures, query shader templates, and transpile code into Unity and Godot formats in real time!
To edit shader files directly in VS Code or Cursor with live hot-reloading:
-
Launch the bridge companion script:
npm run bridge -- ./src/shaders
-
Open the
Open Studiolink the bridge prints (it includes the token). The connection indicator will turn green (Synced via local bridge). -
Any changes saved to
.wgsl,.glsl,.frag, or.vertfiles in that folder will instantly push to Shader Studio and recompile in the viewport.
| Command | Description |
|---|---|
npm run dev |
Starts the Vite development server with hot module reloading. |
npm run build |
Runs TypeScript compilation (tsc -b) and builds production assets with Vite. |
npm run preview |
Previews the production build locally. |
npm run typecheck |
Validates TypeScript types across the entire project without emitting code. |
npm run test |
Executes the complete Vitest test suite (2,237 tests across 95 test files). |
npm run bridge |
Starts the WebSocket local IDE file synchronizer & agent bridge (scripts/bridge.js). |
npm run mcp |
Starts the stdio MCP server (scripts/mcp-server.js) for an AI client. |
npm run build:all |
Full production build: WebAssembly (wasm-pack), typecheck, and Vite bundle (scripts/build-all.js). |
npm run build:exe |
Builds the standalone ShaderStudio.exe in the repository root (scripts/build-exe.js). |
npm run tauri:dev |
Runs the Tauri desktop app in development mode (tauri dev). |
npm run tauri:build |
Builds the Tauri desktop app (tauri build). |
Shader Studio maintains an exhaustive automated test suite with 2,237 unit, integration, and end-to-end tests across 95 test files:
- Tier 1 (Feature Integrations): GPU uniform buffer alignment (16-byte WGSL rules), topological graph compiler sorting, multi-pass post-processing chains, texture sampler bindings, real-time FFT audio pipeline, compute simulation pipelines, and closed-loop agent RPC execution.
- Tier 2 (Boundary & Corner Cases): Context/device loss recovery, empty graph states, malformed uniform declarations, invalid texture paths, network 404 fallbacks, and rapid backend switching.
- Tier 3 (Cross-Feature Combinations): Simultaneous backend switching with active post-processing chains, animated audio uniforms, and custom 3D mesh buffers.
- Tier 4 (Application Scenarios): Complex multi-node graphs, project serialization round-trips, and project state hydration.
- Tier 5 (Adversarial Stress Testing): Deep uniform nesting, oversized arrays, high-frequency parameter mutations, and concurrent recompile triggers.
Run all tests via:
npm run testDistributed under the MIT License. See LICENSE for full details.
Copyright (c) 2026 Binit Varghese.