React 3-Tap Voronoi Shaders
Ultra-fast 3-tap Voronoi with simplex grid and cheap highlights. Pure WebGL cellular patterns for React with TypeScript and shadcn/ui—optimized GPU Voronoi cells.
Building fast Voronoi effects?
Join our Discord community for help from other developers working with WebGL shaders.
Look, we've all tried to build efficient Voronoi patterns. You either end up with expensive 9-tap algorithms that destroy performance or basic square grids that look artificial. This React component uses ultra-fast 3-tap Voronoi with simplex grid setup and directional-derivative highlighting that actually runs at 60fps without melting your CPU.
Ultra-fast Voronoi patterns
Beautiful 3-tap Voronoi cells with sophisticated simplex grids and cheap directional highlights that won't destroy your performance metrics:
Created by Shane in 2015-09-10
Built for React applications with TypeScript and Next.js in mind. The animation runs entirely on the GPU using WebGL 3-tap sampling with simplex grid calculations and directional-derivative lighting. Works seamlessly with shadcn/ui design systems.
Installation
npx shadcn@latest add https://www.shadcn.io/registry/three-tap-voronoi-shaders.json
npx shadcn@latest add https://www.shadcn.io/registry/three-tap-voronoi-shaders.json
pnpm dlx shadcn@latest add https://www.shadcn.io/registry/three-tap-voronoi-shaders.json
bunx shadcn@latest add https://www.shadcn.io/registry/three-tap-voronoi-shaders.json
Usage
import { ThreeTapVoronoiShaders } from "@/components/ui/three-tap-voronoi-shaders";
export default function Hero() {
return (
<ThreeTapVoronoiShaders>
<div className="relative z-10">
<h1>Your content here</h1>
</div>
</ThreeTapVoronoiShaders>
);
}
Why most Voronoi implementations suck
Most developers try to create Voronoi patterns with expensive 9-tap algorithms or basic square grids. Bad idea. You're dealing with performance-crushing calculations, artificial-looking patterns, and wondering why your React app crawls. Some use complex distance field operations, which sounds smart until you realize you're computing dozens of samples per pixel.
This React component uses ultra-efficient 3-tap Voronoi with simplex grid setup and directional-derivative highlights. The GPU handles everything using optimized triangle sampling with authentic cellular patterns and cheap lighting effects. No JavaScript calculations, no performance overhead, just smooth 60fps mathematical Voronoi rendering.
Features
- Zero JavaScript Voronoi overhead - Pure WebGL 3-tap sampling runs on GPU
- Simplex grid calculations with efficient triangle-based cell determination
- Directional-derivative highlighting for cheap but effective lighting without bump mapping
- Multiple color schemes with animated transitions and geometric patterns
- TypeScript definitions for proper IDE support in React projects
- Customizable parameters with 4 props for complete Voronoi control
- Performance optimization through minimal sampling algorithms
- shadcn/ui compatible for consistent design systems
- Responsive design with automatic canvas resizing
API Reference
ThreeTapVoronoiShaders
Main container component for the 3-tap Voronoi effect.
Prop | Type | Default | Description |
---|---|---|---|
speed | number | 1.0 | Animation speed multiplier (0.1 to 3.0) |
scale | number | 1.0 | Voronoi cell scale factor (0.5 to 3.0) |
highlightIntensity | number | 1.0 | Directional highlight intensity (0.1 to 3.0) |
colorScheme | number | 0 | Color palette (0: Fire/Bio, 1: Neon, 2: Cool) |
className | string | - | Additional Tailwind CSS classes |
...props | HTMLAttributes<HTMLDivElement> | - | All standard div props |
Common gotchas
Animation not working: WebGL might not be supported in the browser. The component logs warnings when WebGL initialization fails. Check browser compatibility.
Performance issues on mobile: Some older phones struggle with complex hash calculations and color mixing. Consider reducing speed and scale props for better performance.
Cells too large/small: Adjust the scale
prop to control Voronoi cell size. Lower values create larger cells, higher values create finer cellular detail.
Highlights too harsh/subtle: Use the highlightIntensity
prop to control directional lighting. Values around 0.3-0.7 create subtle depth without overexposure.
Colors not changing: The colorScheme
prop switches between different palette combinations. Try values 0, 1, or 2 for different aesthetic styles.
You might also like
Explore other shader-based background components for React applications:
Perspex Web Lattice
Raymarched Voronoi lattice with perspex-like materials
Smooth Voronoi Contours
Anti-aliased Voronoi contour lines with numerical gradients
Cellular Tiled Tunnel
Raymarched 2nd-order Voronoi tunnel with 3D cellular tiling
Oldschool Tube Shaders
Classic cylindrical tunnel effect with Voronoi patterns
Soap Bubbles 2D Shaders
Realistic soap bubble simulation with procedural noise
Abstract Mod Shaders
3D abstract raymarching with mathematical patterns
Questions developers actually ask
Synthwave Canyon Shaders
Retro synthwave landscape with neon colors and procedural terrain. Plane marching algorithm creating nostalgic 80s canyon flythrough with dynamic sun effects.
Triangle Mesh Incircles Shaders
Advanced Delaunay triangulation with inscribed circles and layered mesh geometry. GPU-accelerated mathematical tessellation for complex geometric visualizations.