warp

Animated colours warped by noise and swirls over a base pattern. The marbled-paper / liquid / smoky look — pick a base, dial in the distortion.

Preview

live

Install

npm
npm i @devmischief/shaders-svelte

Code

import { Warp } from '@devmischief/shaders-svelte';

<Warp
  width={1280}
  height={720}
  colors={['#3a86ff', '#06d6a0', '#ffd166', '#ef476f']}
  shape="checks"
  shapeScale={0.1}
  proportion={0.45}
  softness={1}
  distortion={0.25}
  swirl={0.8}
  swirlIterations={10}
  scale={1}
  rotation={0}
  offsetX={0}
  offsetY={0}
  speed={1}
  fit="none"
/>
			
			

Shader Props

10
namedescriptiontypevalues
colorsWarp gradient colors (up to 10).string[]hex / rgb
shapeBase pattern that the colors warp over.stringchecks · stripes · edge
shapeScaleZoom level of the base pattern.number0 → 1
proportionBlend midpoint between colors. 0.5 = equal distribution; tilt toward 0 or 1 to weight one end.number0 → 1
softnessColor transition sharpness. 0 = hard edge, 1 = smooth gradient.number0 → 1
distortionStrength of noise-based distortion.number0 → 1
swirlStrength of the swirl distortion.number0 → 1
swirlIterationsLayered swirl passes. More iterations = deeper marbling, but higher GPU cost. Effective with swirl > 0.number0 → 20
speedAnimation speed of the warping motion.number0 → 3
fitHow the gradient world is fit into the canvas.stringnone · cover · contain

Common Props

6
namedescriptiontypevalues
originXReference point for positioning width in the canvas.number0 → 1
originYReference point for positioning height in the canvas.number0 → 1
worldWidthVirtual width of the graphic before it's scaled to fit the canvas.number
worldHeightVirtual height of the graphic before it's scaled to fit the canvas.number
minPixelRatioMinimum pixel ratio used when rendering the shader (default 2).number
maxPixelCountMaximum pixel count the shader may process.number

built with mischief by devmischief

@devmischief/shaders-svelte