An interactive 3D blob animation built with React Three Fiber and custom GLSL shaders. The blob morphs organically using Perlin noise displacement, creating a mesmerizing, ever-changing organic shape that responds to user interaction.
This project renders a real-time animated blob sphere in the browser using WebGL. The blob's surface is deformed by Classic Perlin 3D Noise running in a custom vertex shader, creating smooth, organic undulations that evolve over time. When the user hovers over the blob, the distortion intensity increases — making it feel alive and responsive.
- 🎨 Custom GLSL Shaders — Vertex and fragment shaders with Perlin noise for procedural surface displacement
- 🖱️ Hover Interaction — Blob distortion intensity reacts to mouse hover
- 🔄 Auto-Rotation — Continuous orbit rotation for a dynamic viewing experience
- ⚡ High Performance — Icosahedron geometry with 20 subdivisions for smooth surface detail
- 🎭 Dynamic Coloring — Fragment shader generates colors based on UV coordinates and displacement
| Technology | Purpose |
|---|---|
| React | UI framework |
| Three.js | 3D rendering engine |
| React Three Fiber | React renderer for Three.js |
| React Three Drei | Useful helpers (OrbitControls) |
| GLSL Shaders | Custom vertex & fragment shaders |
| Vite | Build tool & dev server |
BlobWithR3F/
├── public/ # Static assets
├── dist/ # Production build output
├── src/
│ ├── main.jsx # React entry point
│ ├── App.jsx # Main app — Canvas setup, OrbitControls, camera
│ ├── App.css # App-specific styles
│ ├── index.css # Global styles (fullscreen canvas layout)
│ ├── blobs/
│ │ └── BlobSphere.jsx # Blob mesh component with shader material & hover interaction
│ └── shaders/
│ ├── vertexSphereShader.glsl # Vertex shader — Perlin noise displacement
│ └── fragmentSphereShader.glsl # Fragment shader — Dynamic color from UV + displacement
├── index.html # HTML entry point
├── vite.config.js # Vite config (base path for GitHub Pages)
├── eslint.config.js # ESLint configuration
├── package.json # Dependencies & scripts
├── package-lock.json # Dependency lock file
└── .gitignore # Git ignore rules
-
Clone the repository
git clone https://github.com/Mukesh-Web-Dev/BlobWithR3F.git cd BlobWithR3F -
Install dependencies
npm install
-
Start the development server
npm run dev
-
Open in browser
Navigate to the local URL shown in the terminal (typically
http://localhost:5173/BlobWithR3F/).
npm run buildThis generates optimized files in the dist/ directory.
npm run previewThis project is pre-configured for GitHub Pages deployment using the gh-pages package.
npm run deployThis command will:
- Run
npm run buildautomatically (via thepredeployscript) - Push the
dist/folder to thegh-pagesbranch - Make the project live at
https://Mukesh-Web-Dev.github.io/BlobWithR3F
| Script | Command | Description |
|---|---|---|
dev |
npm run dev |
Start Vite dev server with HMR |
build |
npm run build |
Build for production |
preview |
npm run preview |
Preview production build locally |
lint |
npm run lint |
Run ESLint |
deploy |
npm run deploy |
Deploy to GitHub Pages |
This project is open source and available for learning and experimentation.