Dual-pass WebGL fluid simulation with chromatic wave refraction and Bayer 4x4 matrix ordered dither crossfading.
pnpm dlx shadcn@latest add @spaceui/components-spaceui-fluid-crossfadeimport { FluidCrossfade } from '@/components/spaceui/fluid-crossfade'
export default function Example() {
return (
<FluidCrossfade
imageA="https://cdn.spaceui.one/atom/samples/image-1.png"
imageB="https://cdn.spaceui.one/atom/samples/image-2.png"
aspectRatio={16 / 9}
ditherGrid={3.0}
/>
)
}| Prop | Type | Default | Description |
|---|---|---|---|
imageA | string | — | Initial default texture URL |
imageB | string | — | Hover/transition texture URL |
ditherGrid | number | 3.0 | Scale of the Bayer 4x4 dithering pattern |
pixelGridSize | number | 240 | Resolution of pixel quantization |
refractionStrength | number | 0.85 | Power of fluid wave refraction on the image |
aspectRatio | number | 16 / 9 | Aspect ratio of the canvas |
pnpm dlx shadcn@latest add @spaceui/components-spaceui-ui