Installation
npx kinetic-ui-cli@latest add liquid-fluid-shaderArchitecture
This component is a native WebGL primitive built with Three.js and React Three Fiber. It maps a 2D image texture onto a plane geometry and uses a custom GLSL fragment shader to calculate the Euclidean distance from the user's cursor (uMouse).
As the cursor moves, it generates a sine-wave ripple effect dampened by the exponential distance from the pointer, creating a viscous fluid effect that executes on the GPU for maximum performance.
Usage Guide
1. Import the Component
Import the component into your React or Next.js page:
import { LiquidFluidShader } from "@/components/creative/liquid-fluid-shader";
2. Implementation Example
Render the component and customize its behavior by passing props:
import { LiquidFluidShader } from "@/components/creative/liquid-fluid-shader";
export default function Example() {
return (
<div className="w-full flex items-center justify-center p-8">
<LiquidFluidShader
imageUrl="example"
intensity{10}
/>
</div>
);
}