Join our Discord Community

React Mobius Spiral Shaders

Raymarched 3D extruded Mobius spiral patterns with complex transformations. Pure WebGL spiral geometry for React with TypeScript and shadcn/ui—mathematical art meets performance.

Powered by

Building complex spiral effects?

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


Creating beautiful 3D Mobius spirals is mathematically complex and computationally expensive. This React component uses advanced complex transformations and raymarching to render extruded Mobius spiral patterns that would be impossible with traditional 3D libraries, all while maintaining smooth 60fps performance.

Mathematical spiral geometry

Beautiful raymarched 3D Mobius spiral patterns with complex transformations and customizable extrusion shapes:

Loading component...

Created by Shane in 2022-01-08

Built for React applications with TypeScript and Next.js in mind. The animation runs entirely on the GPU using WebGL raymarching with complex mathematical transformations, inverse hyperbolic tangent operations, and realistic lighting. Works seamlessly with shadcn/ui design systems.

Installation

npx shadcn@latest add https://www.shadcn.io/registry/extruded-mobius-spiral-shaders.json
npx shadcn@latest add https://www.shadcn.io/registry/extruded-mobius-spiral-shaders.json
pnpm dlx shadcn@latest add https://www.shadcn.io/registry/extruded-mobius-spiral-shaders.json
bunx shadcn@latest add https://www.shadcn.io/registry/extruded-mobius-spiral-shaders.json

Usage

import { ExtrudedMobiusSpiralShaders } from "@/components/ui/extruded-mobius-spiral-shaders";

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

Why most spiral implementations fail

Most developers try to create Mobius spirals with simple 3D meshes or particle systems. Wrong approach. You're dealing with complex mathematical transformations that require precise control over every pixel. Traditional 3D libraries can't handle the inverse hyperbolic tangent operations and polar coordinate transformations needed for authentic Mobius geometry.

This React component uses advanced complex plane mathematics with raymarched distance fields and proper Lipschitz surface constraints. The GPU handles everything using optimized complex number operations with realistic lighting and ambient occlusion. No JavaScript calculations, no mesh generation overhead, just pure mathematical spiral rendering at 60fps.

Features

  • Zero JavaScript spiral overhead - Pure WebGL raymarching runs on GPU
  • Complex plane transformations using inverse hyperbolic tangent operations for authentic Mobius geometry
  • Multiple spiral modes with single or double spiral configurations and customizable extrusion shapes
  • Advanced surface details including hexagonal patterns, face decorations, and ridge effects
  • TypeScript definitions for proper IDE support in React projects
  • Customizable parameters with 9 props for complete spiral control
  • Performance optimization through efficient raymarching algorithms and distance field operations
  • shadcn/ui compatible for consistent design systems
  • Responsive design with automatic canvas resizing

API Reference

ExtrudedMobiusSpiralShaders

Main container component for the extruded Mobius spiral effect.

PropTypeDefaultDescription
speednumber1.0Animation speed multiplier (0.1 to 3.0)
shapenumber2Cross section shape (0: Square, 1: Circle, 2: Hexagon)
rowOffsetnumber1Row offset for brickwork pattern (0: Off, 1: On)
faceDecorationnumber1Colorful face decorations (0: Off, 1: On)
doubleSpiralnumber1Double spiral mode (0: Single, 1: Double)
holesnumber0Bore holes in blocks (0: Off, 1: On)
raisednumber0Raised pylon faces (0: Off, 1: On)
ridgesnumber0Ridge decorations on tops (0: Off, 1: On)
vertLinesnumber0Vertical lines from center (0: Off, 1: On)
classNamestring-Additional Tailwind CSS classes
...propsHTMLAttributes<HTMLDivElement>-All standard div props

Common gotchas

Spiral not appearing: Complex transformations require WebGL2 support. The component logs warnings when advanced WebGL features aren't available. Check browser compatibility.

Performance issues on mobile: Complex raymarching and mathematical operations are GPU-intensive. Consider reducing speed and disabling decorative features like ridges and holes for better mobile performance.

Blocky appearance: Ensure the shape parameter is set correctly. Hexagonal shapes (2) provide the smoothest appearance but require more processing power.

Animation stuttering: The complex plane transformations use intensive mathematical operations. Try reducing the number of enabled features or adjusting the speed parameter.

Colors too vibrant/dull: The face decoration system uses procedural coloring based on spiral mathematics. The appearance will vary based on the spiral configuration and shape settings.

You might also like

Explore other shader-based background components for React applications:

Questions developers actually ask