Features
- Animated metallic stripe patterns
- Chromatic aberration (RGB shift)
- Edge-aware distortion
- Multiple predefined shapes (when no image)
- Customizable color tinting
- Softness and blur controls
- Image preprocessing for optimal results
Basic Usage
Parameters
Visual Parameters
Source image/logo to apply the liquid metal effect to. Leave empty to use predefined shapes. The image will be preprocessed automatically in React.
Background color in hex, rgb, or rgba format
Overlay color tint in hex, rgb, or rgba format (uses color burn blending)
Density of pattern stripes
Red channel chromatic aberration/dispersion
Blue channel chromatic aberration/dispersion
Strength of distortion on the shape edges
Color transition sharpness (0 = hard edge, 1 = smooth gradient)
Noise distortion over the stripe pattern
Direction of pattern animation in degrees
Predefined shape when no image is provided:
none: Fill entire canvascircle: Simple circledaisy: Flower-like shapediamond: Diamond/rhombus shapemetaballs: Animated organic blobs
(React only) Suspends the component when the image is being processed. Useful with React Suspense.
Sizing Parameters
How to fit the shader into the canvas dimensions
Overall zoom level of the graphics
Overall rotation angle in degrees
Horizontal offset of the graphics center
Vertical offset of the graphics center
Animation Parameters
Animation speed multiplier
Manual frame control for animation
Presets
The LiquidMetal shader comes with several built-in presets:- Default: Classic liquid metal with chromatic aberration
- Noir: Black and white with high softness
- Backdrop: Full-screen canvas fill effect
- Stripes: High repetition with strong color shifts
Examples
Classic Metal
Black and White
Rainbow Stripes
Full Screen Background
Image Preprocessing
React (Automatic)
In React, image preprocessing happens automatically:suspendWhenProcessingImage to true to use React Suspense during processing.
Vanilla JavaScript (Manual)
For vanilla JavaScript, you must preprocess images manually:What Preprocessing Does
The preprocessing function:- Detects shape edges using Poisson equation
- Creates distance gradient from edges
- Optimizes for performance (512×512 working size)
- Stores gradient in red channel, alpha in green channel
Technical Details
Shader Uniforms (Vanilla JS)
When using the vanilla JavaScript API:Shape Types
none(0): Fill entire canvascircle(1): Simple circledaisy(2): Flower pattern (animated)diamond(3): Rotated diamondmetaballs(4): Animated organic blobs
Animation
The shader animates:- Flowing stripe patterns
- Metaballs movement (when using metaballs shape)
- Daisy rotation (when using daisy shape)
- Edge distortions
Chromatic Aberration
TheshiftRed and shiftBlue parameters create:
- RGB channel separation
- Rainbow edge effects
- Prism-like color dispersion
- More visible at shape edges and with higher
contour
Performance Notes
- Animated shader with continuous rendering
- Image preprocessing uses Poisson solver (~100-500ms)
- Preprocessing optimized to 512×512 working resolution
- Runtime performance is excellent after preprocessing
- Predefined shapes have no preprocessing overhead
- Best with logo/icon images rather than photos
