fluted glass

An image filter that streaks the source image into ribbed, prismatic distortions — somewhere between a privacy panel and a beam splitter.

Preview

live
Click the preview to load a random sample image.

Install

npm
npm i @devmischief/shaders-svelte

Code

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

<FlutedGlass
  width={1280}
  height={720}
  image="/assets/flowers.webp"
  colorBack="#00000000"
  colorShadow="#000000"
  colorHighlight="#ffffff"
  shadows={0.25}
  highlights={0.1}
  size={0.5}
  shape="lines"
  angle={0}
  distortionShape="prism"
  distortion={0.5}
  shift={0}
  stretch={0}
  blur={0}
  edges={0.25}
  margin={0}
  grainMixer={0}
  grainOverlay={0}
  scale={1}
  rotation={0}
  offsetX={0}
  offsetY={0}
  fit="cover"
/>
			
			

Shader Props

19
namedescriptiontypevalues
imageSource image filtered by the fluted-glass effect.stringurl
colorBackBackground color visible through transparent regions.stringhex / rgba
colorShadowShadow color blended along the distortion shape.stringhex / rgb
colorHighlightHighlight color picked out along grid edges.stringhex / rgb
shadowsStrength of the shadow gradient over the image.number0 → 1
highlightsStrength of the bright strokes along grid edges.number0 → 1
sizeSize of the distortion grid cells.number0 → 1
shapeGrid pattern that drives the distortion.stringlines · linesIrregular · wave · zigzag · pattern
angleDirection of the grid relative to the image.number0 → 180°
distortionShapeShape of the distortion within each grid cell.stringprism · lens · contour · cascade · flat
distortionPower of the distortion applied within each stripe.number0 → 1
shiftTexture shift opposite to the grid direction.number−1 → 1
stretchExtra distortion along the grid lines.number0 → 1
blurOne-directional blur over the image and edges.number0 → 1
edgesGlass distortion and softness on the image edges.number0 → 1
marginDistance from each canvas edge to the effect.number0 → 1
grainMixerGrain distortion applied to shape edges.number0 → 1
grainOverlayPost-process black/white grain overlay.number0 → 1
fitHow the source image is fit into the canvas.stringcover · contain

Common Props

9
namedescriptiontypevalues
scaleOverall zoom level of the graphics.number0.01 → 4
rotationOverall rotation angle of the graphics.number0 → 360
offsetXHorizontal offset of the graphics.number−1 → 1
offsetYVertical offset of the graphics.number−1 → 1
originXReference point for positioning width in the canvas.number0 → 1
originYReference point for positioning height in the canvas.number0 → 1
speedAnimation speed for time-based motion.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