# Plasma Tunnel Background

**Group:** 3D and WebGL scenes  
**Recording:** [https://s4xw77gvirailb62.public.blob.vercel-storage.com/lab/plasma-tunnel-background.mp4](https://s4xw77gvirailb62.public.blob.vercel-storage.com/lab/plasma-tunnel-background.mp4)  
**Source:** [https://ui.aryank.space/components/plasma-tunnel-background](https://ui.aryank.space/components/plasma-tunnel-background)  
**Human:** https://blankinterfaces.com/lab/plasma-tunnel-background

---

## What it is

A full-bleed WebGL2 background that ports a compact GLSL raymarch into a copy-ready React component. A single oversized triangle drives ninety-nine accumulation steps through a sine-folded tunnel, with resolution, time, speed, intensity, and pixel-ratio controls exposed as uniforms. Pure WebGL2, no dependencies.

## Behaviour

### One triangle feeds the whole field

The canvas draws a single oversized triangle and lets the fragment shader decide every pixel. That keeps the component useful as a background because no mesh, texture, or scene graph has to be kept in sync with the page.

### The tunnel advances by accumulated distance

Each frame runs ninety-nine ray steps. The inner five-fold sine warp perturbs the sample point, then the distance estimate advances z, so the brighter plasma forms from repeated near misses instead of a flat noise layer.

### Resolution is a uniform, not a CSS guess

A ResizeObserver writes the real drawing-buffer size into u_resolution. The shader sees device pixels, while the React component still fills any CSS-sized container.

### Pixel ratio is capped for background use

The default pixelRatio is 1.5 because ninety-nine fragment iterations are expensive at full retina size. Consumers can raise it for hero stills or lower it behind dense content.

---

[View all content](https://blankinterfaces.com/sitemap.md)
