Features
- Realistic water caustic patterns
- Animated wave distortion
- Configurable highlight intensity
- Multi-layer caustic effects
- Edge distortion control
- Works as filter or standalone texture
Basic Usage
Parameters
Visual Parameters
string | HTMLImageElement
default:"''"
Optional source image to apply the water effect to
string
default:"'#909090'"
Background color in hex, rgb, or rgba format
string
default:"'#ffffff'"
Highlight color for caustic patterns in hex, rgb, or rgba format
number
default:"0.07"
Coloring added over image/background following caustic shape
number
default:"0.5"
Power of 2nd layer of caustic distortion for more complex patterns
number
default:"0.8"
Caustic distortion power on the image edges
number
default:"0.3"
Additional distortion based on simplex noise, independent from caustic
number
default:"0.1"
Overall power of caustic distortion effect
number
default:"1"
Pattern scale relative to the image
Sizing Parameters
'none' | 'contain' | 'cover'
default:"'contain'"
How to fit the shader into the canvas dimensions
number
default:"0.8"
Overall zoom level of the graphics
number
default:"0"
Overall rotation angle in degrees
number
default:"0"
Horizontal offset of the graphics center
number
default:"0"
Vertical offset of the graphics center
number
default:"0.5"
Horizontal reference point for positioning
number
default:"0.5"
Vertical reference point for positioning
Animation Parameters
number
default:"1"
Animation speed multiplier
number
default:"0"
Manual frame control for animation
Presets
The Water shader comes with several built-in presets:- Default: Balanced water effect with caustics and waves
- Slow-mo: Slow animation with strong highlights
- Abstract: High-scale pattern for abstract effects
- Streaming: Fast flowing water without caustics
Examples
Slow Motion Water
Abstract Water Pattern
Streaming Effect
Technical Details
Shader Uniforms (Vanilla JS)
When using the vanilla JavaScript API, colors are passed as RGBA arrays with values from 0 to 1:Animation
The Water shader is animated by default. The animation shows:- Moving caustic patterns
- Wave distortion
- Flowing highlights
speed parameter or frame for manual control.
Performance Notes
- Animated shader with continuous rendering
- Uses simplex noise for wave distortion
- Multiple layers can be disabled for better performance
- Best with moderate
sizevalues for visible caustics
