Water

Click to change the sample image

Installation

npm i @paper-design/shaders-react

Code

import { Water } from '@paper-design/shaders-react';

<Water
  style={{ height: 500 }}
  colorBack="#8f8f8f"
  colorHighlight="#ffffff"
  highlights={0.07}
  layering={0.5}
  edges={0.8}
  waves={0.3}
  caustic={0.1}
  effectScale={1}
  scale={0.8}
  fit="contain"
  speed={1}
/>

Props

NameDescriptionTypeValues
colorBackBackground colorstringHex, RGB, or HSL color
colorHighlightHighlight colorstringHex, RGB, or HSL color
highlightsA coloring added over the image/background, following the caustic shapenumber0 to 1
layeringThe power of 2nd layer of caustic distortionnumber0 to 1
edgesCaustic distortion power on the image edgesnumber0 to 1
wavesAdditional distortion based in simplex noise, independent from causticnumber0 to 1
causticPower of caustic distortionnumber0 to 1
effectScalePattern scale relative to the imagenumber0.01 to 7
scaleOverall zoom level of the graphicsnumber0.1 to 10
fitHow the image fits the canvasenum
| "contain" | "cover"
speedAnimation speednumber0 to 3

Description

Water-like surface distortion with natural caustic realism. Works as an image filter or animated texture without image