paper texture

A static texture built from multiple noise layers — usable as a realistic paper or cardboard surface, or as an image filter.

Preview

live
Click the preview to load a random sample image.

Install

npm
npm i @devmischief/shaders-svelte

Code

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

<PaperTexture
  width={1280}
  height={720}
  colorBack="#ffffff"
  colorFront="#9fadbc"
  contrast={0.3}
  roughness={0.4}
  fiber={0.3}
  fiberSize={0.2}
  crumples={0.3}
  crumpleSize={0.35}
  folds={0.65}
  foldCount={5}
  drops={0.2}
  fade={0}
  seed={6}
  scale={0.6}
  fit="cover"
/>
			
			

Shader Props

14
namedescriptiontypevalues
imageSource image used as the underlying texture.stringurl
colorBackBackground paper color.stringhex / rgb
colorFrontForeground / fiber color.stringhex / rgb
contrastContrast between the paper layers.number0 → 1
roughnessSurface roughness applied to the noise field.number0 → 1
fiberStrength of the fiber pattern.number0 → 1
fiberSizeSize of individual paper fibers.number0 → 1
crumplesAmount of crumple deformation in the surface.number0 → 1
crumpleSizeSize of crumple folds in the texture.number0 → 1
foldsStrength of the larger paper folds.number0 → 1
foldCountNumber of fold creases across the surface.numberinteger
dropsAdds water droplet artifacts to the paper.number0 → 1
fadeFades the texture toward the edges.number0 → 1
fitHow the source image is fit into the canvas.stringcover · contain

Common Props

8
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
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