Docs
Pixel Distorsion Shader
Pixel Distorsion Shader
An interactive and customizable shader effect that distorts pixels dynamically based on mouse interactions, perfect for creating engaging and immersive visual effects on images.
Loading...
Installation
Install dependencies
npm install
Add the shader file
components/shaders/pixel-distorsion-shader
Copy the pixel-distorsion component
pixel-distorsion.tsx
Copy the source code
pixel-distorsion-scene.tsx
Props
PixelDistorsion Props
Prop | Type | Description | Default |
---|---|---|---|
imagePath | String | The path to the image that will be used as the texture. | - |
cameraDistance | Number | The distance of the camera from the object. | 700 |
grid | Number | Defines the grid size used for pixel distortion. | 10 |
mouse | Number | Controls the influence of the mouse interaction on distortion. | 0.25 |
strength | Number | Defines the strength of the distortion effect. | 0.11 |
PixelDistorsionScene Props
Prop | Type | Description | Default |
---|---|---|---|
imagePath | String | The path to the image that will be passed to PixelDistorsion. | - |
cameraDistance | Number | The distance of the camera from the object. | - |