Simplex Truchet Weave Shaders
Complex toroidal weave patterns using simplex grid tessellation with random rendering order. Advanced mathematical pattern generation for sophisticated geometric visualizations.
Building complex weave patterns?
Join our Discord community for help from other developers working with advanced simplex grid algorithms.
Look, we've all tried to build weave patterns. You either end up with basic grid overlays that look nothing like proper mathematical weaving or JavaScript calculations that can't handle complex toroidal segments smoothly. This React component uses advanced simplex grid tessellation with random toroidal rendering that actually runs at 60fps without melting your CPU.
Sophisticated simplex weave animation
Complex toroidal segments with mathematical simplex grid tessellation and random rendering order:
Created by Shane in 2018-07-12
Built for React applications with TypeScript and Next.js in mind. The animation runs entirely on the GPU using WebGL simplex grid mathematics with toroidal segment rendering and sophisticated weave algorithms. Works seamlessly with shadcn/ui design systems.
Installation
npx shadcn@latest add https://www.shadcn.io/registry/simplex-truchet-weave-shaders.json
npx shadcn@latest add https://www.shadcn.io/registry/simplex-truchet-weave-shaders.json
pnpm dlx shadcn@latest add https://www.shadcn.io/registry/simplex-truchet-weave-shaders.json
bunx shadcn@latest add https://www.shadcn.io/registry/simplex-truchet-weave-shaders.json
Usage
import { SimplexTruchetWeaveShaders } from "@/components/ui/simplex-truchet-weave-shaders";
export default function Hero() {
return (
<SimplexTruchetWeaveShaders>
<div className="relative z-10">
<h1>Your content here</h1>
</div>
</SimplexTruchetWeaveShaders>
);
}
Why most weave implementations suck
Most developers try to create weave patterns with Canvas overlays or SVG path intersections. Bad idea. You're dealing with expensive DOM manipulations, complex layering calculations, and wondering why your React app feels sluggish. Some use CSS transforms with pseudo-elements, which sounds smart until you realize you're computing intersection logic for every pattern element on every frame.
This React component uses mathematical simplex grid tessellation with GPU-accelerated toroidal segment rendering. The GPU handles everything using optimized geometric algorithms with authentic weave mathematics. No JavaScript calculations, no DOM rendering, just smooth 60fps weave art.
Features
- Zero JavaScript animation overhead - Pure WebGL simplex grid runs on GPU
- Toroidal segment rendering with mathematical distance field calculations
- Random rendering order creating authentic weave intersection patterns
- Multiple shape options (circle, hexagon, dodecahedron) for varied aesthetics
- TypeScript definitions for proper IDE support in React projects
- Customizable parameters with 5 props for complete control
- Performance optimization through efficient GPU geometric algorithms
- shadcn/ui compatible for consistent design systems
- Responsive design with automatic canvas resizing
API Reference
SimplexTruchetWeaveShaders
Main container component for the simplex weave effect.
Prop | Type | Default | Description |
---|---|---|---|
speed | number | 1.0 | Animation speed multiplier (0.1 to 3.0) |
scale | number | 5.0 | Pattern scale and density (1.0 to 10.0) |
shape | number | 0 | Toroidal shape (0: circle, 1: hexagon, 2: dodecahedron) |
showWeave | boolean | true | Enable weave pattern vs stacked rings |
showGrid | boolean | false | Show simplex grid construction lines |
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 simplex calculations. Consider reducing scale and disabling showGrid for better performance.
Pattern too dense: Lower the scale
prop for larger pattern elements with clearer weave structure. Values around 3.0-4.0 work well for prominent weave patterns.
Missing weave effect: Ensure showWeave={true}
to enable random rendering order. Setting to false creates stacked rings instead of woven patterns.
Animation too fast: Lower the speed
prop for more controlled pattern movement. Values around 0.3-0.5 work well for subtle weave flow.
You might also like
Explore other shader-based background components for React applications:
Triangle Mesh Incircles
Advanced Delaunay triangulation with inscribed circles
Hexagon Grid Pattern
Beautiful hexagonal tessellation with overlapping geometry
Smooth Voronoi Contours
Mathematical Voronoi patterns with smooth interpolation
Cellular Tiled Tunnel
Organic cellular patterns with tunnel effects
Perspex Web Lattice
3D lattice structures with web-like connectivity
Abstract Mod Shaders
3D abstract raymarching with procedural geometry
Questions developers actually ask
React Sigmoids Sines Shaders
Psychedelic 2001 space odyssey effects with sigmoid functions and sine waves. Pure WebGL shaders for React with TypeScript and shadcn/ui—smooth GPU animations.
React Singularity Shaders
React blackhole singularity with whirling effects. Cosmic vortex patterns for Next.js with TypeScript and shadcn/ui—free code.