Shader effects

The 200 WebGPU components of the Shaders library on the video's clock, from the @intentface-launch/shaders add-on.

pnpm launch add shaders, then import { Shaders } from "@intentface-launch/shaders". Gradients, noise, light, glass, metal, distortions, blurs, wipes, particles and fluids from the Shaders library (MIT), for backdrops, transitions and texture around the product. Read their code too when writing your own Shader from the kit.

The layer

tsx
<Shaders
  components={(f) => [
    { type: "SolidColor", props: { color: "#05060f" } },
    { type: "Aurora", props: { colorA: "#3df5b0", colorB: "#4f6bff", colorC: "#c04bff" } },
    { type: "Glass", props: { shape: { type: "circleSDF", radius: 0.3 }, center: { x: 0.3 + 0.4 * (f / 180), y: 0.5 } } },
  ]}
/>
PropWhat it does
componentsThe layer tree as the library's vanilla API takes it: { type, props, children, id }, first at the bottom. A function of the frame animates props.
width, heightThe layer's size in CSS pixels. Default: the video's.
resolutionDrawing-buffer pixels per CSS pixel. 0.5 for soft fields.

The catalogue and every prop are in the library's own skill (skills/shaders/components.md in its repo) and at https://shaders.com/docs/components/<Name>. Its JSX maps one to one: <Aurora colorA="#…" /> is { type: "Aurora", props: { colorA: "#…" } }.

On the video's clock

The library's own components run on the wall clock. Shaders drives its renderer frame by frame instead, so any frame renders alone, in any order, the same every time. That was measured over the whole catalogue by rendering each component's frame both directly and after the frames before it.

KindHow it renders
Most componentsAt the frame's exact time, fractional frames and motion blur included.
Simulations: Boids, DataMosh, FloatingParticles, InkFlow, KeyFrames, Liquify, MagneticFilings, ParticleField, ParticleFlow, Particles, PixelSort, ReactionDiffusion, Smoke, SmokeFill, SmokeFlow, Surface3D, TimeTrailOne whole frame at a time from the start of the shot. A late frame replays the ones before it, so keep these shots short. No motion blur.
ImageTextureWaits for its image before the frame is let go. Not under a simulation.
auto-animate, mouse, mouse-position driversRefused: animate with a function of the frame.
CursorTrail, CursorRipples, WebcamTexture, ObjectTracker, VideoTexture, Text, HTMLInCanvas, DOMTexture, FogRefused, with what to use instead. Fog renders differently on every run, so render chunks would not join.

Rendering needs WebGPU, which the renderer's Chromium has. In the studio, use a browser with WebGPU.