Skip to content

Introduction

shadekit is a small, composable shader engine: one framework-agnostic core, one file per effect, thin wrappers for React and a <sk-shader> custom element that runs anywhere — including this page.

Package What it is
@shadekit/core Device pool, ticker, ShaderInstance, uniform schema
@shadekit/shaders 20 effect engines (WGSL + GLSL), 179 named presets — tree-shakable
@shadekit/element <sk-shader> custom element for Astro, plain HTML, any framework
@shadekit/react <Shader> component
  • One GPUDevice and one requestAnimationFrame loop per page.
  • Absolute performance.now() seconds to the shader; clamped dt for pointer damping — identical speed at 60/120/144Hz.
  • DPR capped (default 2) with automatic step-down when frames miss budget.
  • A shared IntersectionObserver pauses off-screen canvases; prefers-reduced-motion renders one static frame.
  • Interaction builtins beyond mouse: pointer (velocity, hover, pressed), pulse (press position + decaying ring), and scroll (viewport progress + velocity).
  • Uniforms are one vec4 slot per field — identical packing on WebGPU and WebGL2, a single upload per frame.