Join our Discord Community

Simplex Truchet Weave Shaders

Complex toroidal weave patterns using simplex grid tessellation with random rendering order. Advanced mathematical pattern generation for sophisticated geometric visualizations.

Powered by

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:

Loading component...

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.

PropTypeDefaultDescription
speednumber1.0Animation speed multiplier (0.1 to 3.0)
scalenumber5.0Pattern scale and density (1.0 to 10.0)
shapenumber0Toroidal shape (0: circle, 1: hexagon, 2: dodecahedron)
showWeavebooleantrueEnable weave pattern vs stacked rings
showGridbooleanfalseShow simplex grid construction lines
classNamestring-Additional Tailwind CSS classes
...propsHTMLAttributes<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:

Questions developers actually ask