Live site: skialabs.dev
A beautiful, fast, web-based playground for Skia's Shader Language (SKSL). Write, preview, and share shaders, all rendered with CanvasKit (Skia WebAssembly) and powered by Next.js, Monaco Editor, and Firebase.
Skia Labs makes shader experimentation feel creative, smooth, and joyful. ✨
|
|
|
|
|
- Powered by CanvasKit WASM for native Skia rendering.
- Instant hot-reload as you type.
- Supports animated uniforms (
iTime,iResolution).
- Social Features: Publish your shaders directly to the community gallery, powered by Cloud Firestore.
- Authentication: Seamless Google Sign-in to manage your creations.
- Interaction: Like your favorite shaders and leave comments for authors.
- Smart Performance: The community feed features infinite scrolling pagination and lazy-loaded WebGL contexts to keep mobile performance buttery smooth.
- Custom syntax highlighting
- Auto-closing brackets & pairs
- Dark theme
- Smooth typing performance
- Drag-resize editor & preview
- Fully responsive and touch-friendly
- Snap-safe (min widths enforced)
- Save your work to the cloud and generate an instant share link
- Copy shader code easily
- Dynamic OpenGraph Thumbnails: Automatically generated thumbnails for rich previews when sharing your links on Twitter, Discord, and iMessage.
- Next.js (App Router)
- CanvasKit (Skia)
- Monaco Editor
- Firebase (Auth & Firestore)
- PostHog (Analytics)
- TypeScript
- Tailwind CSS
| Layer | Technology |
|---|---|
| Frontend | Next.js, React, Tailwind CSS |
| Shader Rendering | CanvasKit / Skia WASM |
| Code Editing | Monaco Editor w/ custom SKSL language |
| Backend & DB | Firebase Authentication and Cloud Firestore |
| Analytics | PostHog |
| Optimization | IntersectionObserver WebGL Lazy Loading |
Clone the repo:
git clone https://github.com/ABHIGYAN-MOHANTA/skia-labs
cd skia-labsInstall dependencies:
npm install
# or
pnpm installConfigure Firebase:
- Create a Firebase project and add a Web App.
- Enable Firestore and Google Authentication.
- Create a
.env.localfile based on your Firebase configuration:
NEXT_PUBLIC_FIREBASE_API_KEY="..."
NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN="..."
NEXT_PUBLIC_FIREBASE_PROJECT_ID="..."
NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET="..."
NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID="..."
NEXT_PUBLIC_FIREBASE_APP_ID="..."Run the dev server:
npm run devVisit:
http://localhost:3000
/app
/editor -> The full shader editor page
/community -> Community gallery and social feed
/components -> Shared UI components and shader logic
/lib -> CanvasKit loaders and Firebase setup
/public -> Static assets (screenshots, icons)
Skia Labs automatically provides:
| Uniform | Type | Description |
|---|---|---|
iTime |
float |
Elapsed time in seconds |
iResolution |
float2 |
Canvas width & height |
iMouse |
float4 |
Mouse coordinates and click state (x, y, z, w) |
iKeyboard |
shader |
256x3 texture containing live keyboard state (held, pressed, toggled) |
Each shader is compiled using:
canvasKit.RuntimeEffect.Make(shaderCode)Then executed every frame:
effect.makeShader(uniforms)
skCanvas.drawPaint(paint)
surface.flush()A clean render loop ensures:
- smooth animation
- proper cleanup
- zero WASM memory leaks
- lazy initialization only when visible on screen
- Channels (iChannel0-3): Passing in images, noise textures, and cubemaps. This is used a lot for displacement effects, water ripples, and texturing 3D objects.
- Audio Reactive Inputs: Passing in microphone or Soundcloud data as a texture so shaders can bounce to music.
- Multi-Pass Rendering (Buffers): "Buffer A", "Buffer B", etc., where the output of one shader feeds into the input of another. This is required for fluid simulations and path tracing.
Contributions are welcome!
- Open
app/shaderExamples.ts - Add:
{
title: 'My Cool Shader',
code: `// kind=shader ...`
}- Submit a PR 🚀
Open an issue here:
👉 issues
Please include:
- browser & OS
- steps to reproduce
- shader code (if relevant)
MIT License, free to use, modify, and build upon.
If you like this project, consider starring the repo:
👉 skia-labs ⭐



