React Tunnel Shaders
React tunnel with GPU psychedelic effects. Hypnotic tunnel animations for Next.js with TypeScript and shadcn/ui—free code.
Powered by
Building tunnel effects?
Join our Discord community for help from other developers working with GPU tunnel effects and psychedelic animations.
Need hypnotic tunnel effects for creative projects? Most developers struggle with complex 3D tunnel geometry or heavy video files. This React tunnel component uses the legendary Danilo Guanabara shader technique to create mesmerizing psychedelic tunnels with mathematical precision and minimal code.
Copy-paste TypeScript component that creates infinite tunnel effects with RGB color separation and organic distortion. Classic demoscene algorithm adapted for modern React applications. Built for Next.js applications with shadcn/ui design system. GPU-accelerated—pure mathematical beauty.
React tunnel with classic demoscene technique
Hypnotic infinite tunnel with RGB separation and psychedelic distortion:
Original shader by Danilo Guanabara
Perfect for React 19, Next.js 15, and modern TypeScript projects. Tunnel effects rendered entirely on GPU using legendary GLSL technique with mathematical distortion. Customizable speed, intensity, zoom, distortion, and color shifting. Full shadcn/ui compatibility with Tailwind CSS styling.
Installation
npx shadcn@latest add https://www.shadcn.io/registry/tunnel-shaders.json
npx shadcn@latest add https://www.shadcn.io/registry/tunnel-shaders.json
pnpm dlx shadcn@latest add https://www.shadcn.io/registry/tunnel-shaders.json
bunx shadcn@latest add https://www.shadcn.io/registry/tunnel-shaders.json
Usage
import { TunnelShaders } from "@/components/ui/tunnel-shaders";
export default function PsychedelicBackground() {
return (
<TunnelShaders
speed={1.0}
intensity={1.0}
zoom={1.0}
distortion={1.0}
colorShift={0.5}
>
<div className="relative z-10">
<h1>Content over tunnel</h1>
</div>
</TunnelShaders>
);
}
Why tunnel animations struggle with performance
3D mesh tunnels require complex geometry and heavy rendering. Video backgrounds lack interactivity and real-time control. Most libraries use expensive ray marching that doesn't capture the elegant mathematical beauty of classic demoscene techniques.
Classic shader mathematics solve this with pure algorithmic beauty. No 3D geometry needed—just mathematical distortion and RGB channel separation. Legendary demoscene optimization creates infinite tunnel depth with minimal GPU cost.
This React tunnel component uses the famous Danilo Guanabara technique for authentic demoscene aesthetics. Mathematical distortion creates organic tunnel movement. RGB channel processing generates classic color separation effects. Pure algorithmic art with modern React integration.
React tunnel shader features
- Classic demoscene algorithm - Legendary Danilo Guanabara technique adapted for React
- Mathematical tunnel generation - Pure algorithm creates infinite tunnel without 3D geometry
- RGB channel separation - Classic color processing for authentic retro aesthetics
- Organic distortion patterns - Mathematical functions create fluid tunnel movement
- Hypnotic animation loops - Seamless infinite tunnel with mesmerizing flow
- Psychedelic color effects - Dynamic color shifting and intensity modulation
- Minimal GPU cost - Elegant algorithm optimized for maximum visual impact
- Customizable parameters - Control speed, intensity, zoom, distortion, and colors
- Demoscene authenticity - Faithful adaptation of classic shader art techniques
- Infinite tunnel depth - Mathematical precision creates endless tunnel illusion
- TypeScript React component - Full IDE support with prop definitions
- Next.js compatible - Works with App Router and modern React patterns
- shadcn/ui integration - Consistent with Tailwind CSS design systems
- Copy-paste installation - No vendor lock-in, you own the shader code
- Creative project perfect - Ideal for artistic, experimental, or psychedelic themes
API Reference
TunnelShaders
Main container component for the hypnotic tunnel effect.
Prop | Type | Default | Description |
---|---|---|---|
speed | number | 1.0 | Tunnel movement and animation speed (0.1 to 3.0) |
intensity | number | 1.0 | Tunnel brightness and contrast (0.5 to 2.0) |
zoom | number | 1.0 | Tunnel depth progression rate (0.5 to 2.0) |
distortion | number | 1.0 | Organic movement distortion (0.5 to 3.0) |
colorShift | number | 1.0 | Color cycling and modulation (0.1 to 3.0) |
className | string | - | Additional Tailwind CSS classes |
...props | HTMLAttributes<HTMLDivElement> | - | All standard div props |
GPU tunnel troubleshooting
Tunnel too dim: Increase intensity
to 1.5+ for brighter, more vivid tunnel effects. Classic algorithm creates authentic brightness that may appear subtle.
Movement too slow/fast: Adjust speed
for comfortable tunnel flow. 0.5 creates meditative, slow movement. 2.0+ creates intense, rapid tunnel rushing.
Not enough distortion: Increase distortion
to 2.0+ for more organic, fluid tunnel movement. Higher values create more psychedelic, flowing effects.
Colors too static: Boost colorShift
to 1.5+ for more dynamic color cycling. RGB separation and color modulation create classic demoscene aesthetics.
Tunnel too shallow: Increase zoom
to 1.5+ for faster depth progression. Creates more dramatic tunnel depth and rushing sensation.
Mobile performance issues: GPU tunnel calculation is optimized but intensive. Consider lowering intensity
to 0.8 on mobile devices for smoother performance.
GPU compatibility: Tunnel effects require GPU for real-time mathematical calculation. Provide CSS gradient fallbacks for older devices without sufficient processing power.
More React shader components
Explore other GPU-accelerated shader components for Next.js applications:
Smoke Shaders
Volumetric smoke with upward flow, turbulence, and natural dissipation
Sea Shaders
3D ocean vista with ray marching, rolling waves, and atmospheric perspective
Fire Shaders
Realistic fire effects with organic flame movement and heat distortion
Gradient Mesh Shaders
Dynamic multi-point gradients with organic movement and smooth color transitions
Hologram Shaders
Sci-fi holographic effects with interference patterns and chromatic aberration
Plasma Shaders
Organic energy effects with flowing plasma patterns and smooth color cycling