shayders
Quick website for doing shaders tests.
Shayders
A modern, web-based GLSL shader editor for creating and experimenting with fragment shaders in real-time. Built with SvelteKit, featuring multipass rendering, texture channels, and community shader sharing.
Check out the live demo: shayders.ayfri.com


Features
🎨 Shader Editing
- Real-time GLSL editing with Monaco Editor (same as VS Code)
- GLSL tooling - syntax highlighting, autocompletion, hover docs, inline errors and color pickers
- Multipass rendering - up to 8 offscreen buffers (
uBufferAtouBufferH) plus a sharedCommontab - Live preview with WebGL canvas, screenshots and video recording
🎯 Built-in Uniforms
Access these uniforms in your shaders:
uAspect(float) - Canvas aspect ratiouDate(vec4) - Current date (year, month, day, timeOfDay)uDeltaTime(float) - Time since last frameuFrameCount(int) - Total frames rendereduFrameRate(float) - Current FPSuMouse(vec3) - Mouse position (x, y) and button stateuResolution(vec2) - Canvas resolutionuTime(float) - Current time in secondsuBufferAtouBufferH(sampler2D) - Output of each offscreen buffer
🖼️ Texture Channels
- 4 texture channels (
uChannel0touChannel3) for images, videos, webcam or another buffer - Uploads to Cloudflare R2 for authenticated users, with worker-based image optimization and client-side validation
- Support for PNG, JPG, GIF, WebP, AVIF, MP4, and WebM files
- Automatic texture binding and sampling
🌐 Community Features
- Shader sharing - Publish, fork and discover community shaders
- Search - Find shaders and creators
- User profiles - View shaders by author
- Live previews on shader cards
- Authentication with email verification
📱 Installable App
- PWA - Install Shayders from the browser, with shortcuts to a new shader and to search
- Offline editor - The home page and
/newopen offline once visited, app files are cached by a service worker
🚀 Performance
- WebGL optimized rendering
- Thumbnail generation for quick previews
- Efficient multi-pass rendering pipeline
- Cloudflare Workers deployment with edge-cached assets
Technologies Used
- Built with SvelteKit and Svelte 5
- Uses Monaco Editor for code editing
- PocketBase for database/backend services
- Tailwind CSS for styling
- Lucide for icons
- Inspired by Shadertoy
Key Components
- ShaderCanvas: Handles WebGL rendering, uniform binding, and multi-buffer pipeline
- GlslEditor: Monaco-based editor with GLSL language support
- ChannelsPanel: Texture channel management
- BuiltinsPanel: Uniform documentation and controls
- ShaderPreview: Live thumbnail generation for shader cards
Development
bun run checktype-checks the app, the service worker insrc/service-workerhas its owntsconfig.jsonbun run og-imageregeneratesstatic/og-image.png- The service worker only runs on production builds (
bun run buildthenbun run preview)
Environment Setup
PUBLIC_POCKETBASE_URL- Your PocketBase instance URL, declared insrc/env.ts
Shader assets live in the R2 bucket bound as ASSETS_STORAGE in wrangler.toml. Uploads go through /api/upload-url and files are served from the same origin by /api/assets/*, so the bucket needs neither public access nor CORS rules.
R2 Asset Limits
The editor enforces these defaults for authenticated uploads:
- Images:
2 MBmax,2048x2048max, optimized/compressed in a worker before upload - Videos:
10 MBmax,1920x1080max,30 secondsmax - Per-user storage quota:
50 MB
License
This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details.
Pierre Roy