perlin noise

Classic animated 3D Perlin noise with all the canonical controls — octave count, persistence, and lacunarity. From single-layer drift to multi-octave clouds.

Preview

live

Install

npm
npm i @devmischief/shaders-svelte

Code

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

<PerlinNoise
  width={1280}
  height={720}
  colorBack="#632ad5"
  colorFront="#fccff7"
  proportion={0.35}
  softness={0.1}
  octaveCount={1}
  persistence={1}
  lacunarity={1.5}
  scale={1}
  rotation={0}
  offsetX={0}
  offsetY={0}
  speed={0.5}
  fit="none"
/>
			
			

Shader Props

9
namedescriptiontypevalues
colorBackBackground color of the noise field.stringhex / rgba
colorFrontForeground color of the noise field.stringhex / rgb
proportionBlend point between front and back colors. 0.5 = equal distribution.number0 → 1
softnessColor transition sharpness. 0 = hard edge, 1 = smooth gradient.number0 → 1
octaveCountNumber of noise octaves stacked. More octaves = more detail.number1 → 8
persistenceRoughness — how much each octave contributes.number0.3 → 1
lacunarityFrequency step between octaves — how compressed each octave is.number1.5 → 10
speedAnimation speed of the drifting noise.number0 → 3
fitHow the noise field 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