Join our Discord Community

React Cellular Tiled Tunnel

Raymarched 2nd-order Voronoi tunnel with 3D cellular tiling. Pure WebGL tunnel effects for React with TypeScript and shadcn/ui—smooth GPU cellular structures.

Powered by

Building cellular tunnel effects?

Join our Discord community for help from other developers working with WebGL shaders.


Look, we've all tried to build realistic Voronoi tunnel effects. You either end up with basic tube geometries that look nothing like proper cellular structures or expensive 2nd-order Voronoi that destroys performance. This React component uses clever 3D cellular tiling to emulate 2nd-order Voronoi surfaces that actually run at 60fps without melting your CPU.

Smooth cellular tunnel flythrough

Immersive raymarched tunnel with authentic 2nd-order Voronoi cellular patterns that won't destroy your performance metrics:

Loading component...

Created by Shane in 2016-05-12

Built for React applications with TypeScript and Next.js in mind. The animation runs entirely on the GPU using WebGL raymarching with 3D cellular tiling, 2nd-order distance calculations, and realistic tunnel navigation. Works seamlessly with shadcn/ui design systems.

Installation

npx shadcn@latest add https://www.shadcn.io/registry/cellular-tiled-tunnel-shaders.json
npx shadcn@latest add https://www.shadcn.io/registry/cellular-tiled-tunnel-shaders.json
pnpm dlx shadcn@latest add https://www.shadcn.io/registry/cellular-tiled-tunnel-shaders.json
bunx shadcn@latest add https://www.shadcn.io/registry/cellular-tiled-tunnel-shaders.json

Usage

import { CellularTiledTunnelShaders } from "@/components/ui/cellular-tiled-tunnel-shaders";

export default function Hero() {
  return (
    <CellularTiledTunnelShaders>
      <div className="relative z-10">
        <h1>Your content here</h1>
      </div>
    </CellularTiledTunnelShaders>
  );
}

Why most tunnel implementations suck

Most developers try to create cellular tunnels with basic geometries or expensive Voronoi calculations. Bad idea. You're dealing with unrealistic flat surfaces, performance-crushing algorithms, and wondering why your React app crawls. Some use Three.js with complex 3D Voronoi, which sounds smart until you realize you're computing 27+ cell checks per pixel.

This React component uses 3D cellular tiling to cleverly emulate 2nd-order Voronoi with only 4 sphere calculations. The GPU handles everything using optimized raymarching with authentic cellular patterns and realistic tunnel physics. No JavaScript calculations, no performance overhead, just smooth 60fps mathematical tunnel rendering.

Features

  • Zero JavaScript tunnel overhead - Pure WebGL raymarching runs on GPU
  • 3D cellular tiling with efficient sphere-based distance calculations for authentic Voronoi look
  • 2nd-order distance checks emulating expensive Voronoi algorithms with minimal computation
  • Raymarched tunnel navigation with smooth path following and camera dynamics
  • TypeScript definitions for proper IDE support in React projects
  • Customizable parameters with 4 props for complete tunnel control
  • Performance optimization through clever tiling algorithms
  • shadcn/ui compatible for consistent design systems
  • Responsive design with automatic canvas resizing

API Reference

CellularTiledTunnelShaders

Main container component for the cellular tiled tunnel effect.

PropTypeDefaultDescription
speednumber1.0Tunnel movement speed (0.1 to 3.0)
tunnelRadiusnumber1.0Tunnel width multiplier (0.5 to 2.0)
cellScalenumber1.0Cellular pattern scale (0.5 to 3.0)
bumpIntensitynumber1.0Surface bump mapping intensity (0.1 to 3.0)
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 raymarching and cellular calculations. Consider reducing speed and cellScale props for better performance.

Tunnel too narrow/wide: Adjust the tunnelRadius prop to control tunnel width. Lower values create tighter spaces, higher values create spacious tunnels.

Cells too large/small: Use the cellScale prop to control cellular pattern size. Lower values create finer details, higher values create larger cellular structures.

Surface too flat/bumpy: Lower the bumpIntensity prop for smoother surfaces. Values around 0.3-0.7 create subtle surface variation without visual noise.

You might also like

Explore other shader-based background components for React applications:

Questions developers actually ask