Join our Discord Community

React Smooth Noise Contours

Anti-aliased Simplex noise contours with smooth fract functions. Pure WebGL abstract patterns for React with TypeScript and shadcn/ui—smooth GPU noise visualization.

Powered by

Building noise contour effects?

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


Look, we've all tried to build smooth noise contours. You either end up with aliased fract patterns that look jagged at any zoom level or expensive supersampling that destroys performance. This React component uses clever smooth fract functions with fwidth calculations to create perfectly anti-aliased contour lines that actually run at 60fps without melting your CPU.

Smooth anti-aliased noise patterns

Beautiful Simplex noise contours with sophisticated anti-aliasing that won't destroy your performance metrics:

Loading component...

Created by Shane in 2017-02-28

Built for React applications with TypeScript and Next.js in mind. The animation runs entirely on the GPU using WebGL smooth fract functions with Simplex noise and fwidth-based anti-aliasing. Works seamlessly with shadcn/ui design systems.

Installation

npx shadcn@latest add https://www.shadcn.io/registry/smooth-noise-contours-shaders.json
npx shadcn@latest add https://www.shadcn.io/registry/smooth-noise-contours-shaders.json
pnpm dlx shadcn@latest add https://www.shadcn.io/registry/smooth-noise-contours-shaders.json
bunx shadcn@latest add https://www.shadcn.io/registry/smooth-noise-contours-shaders.json

Usage

import { SmoothNoiseContoursShaders } from "@/components/ui/smooth-noise-contours-shaders";

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

Why most contour implementations suck

Most developers try to create noise contours with basic fract functions or CSS gradients. Bad idea. You're dealing with aliased edges, pixelated patterns, and wondering why your React app looks unprofessional. Some use expensive supersampling or multi-pass rendering, which sounds smart until you realize you're quadrupling GPU load for simple effects.

This React component uses smooth fract functions with fwidth calculations and Simplex noise algorithms. The GPU handles everything using optimized anti-aliasing with authentic contour generation and edge detection. No JavaScript calculations, no aliasing artifacts, just smooth 60fps mathematical noise rendering.

Features

  • Zero JavaScript noise overhead - Pure WebGL smooth functions run on GPU
  • Smooth fract algorithms with sophisticated fwidth calculations for perfect anti-aliasing
  • Simplex noise generation for organic pattern creation with tetrahedral sampling
  • Edge detection systems with highlighting and depth enhancement
  • TypeScript definitions for proper IDE support in React projects
  • Customizable parameters with 4 props for complete contour control
  • Performance optimization through efficient anti-aliasing algorithms
  • shadcn/ui compatible for consistent design systems
  • Responsive design with automatic canvas resizing

API Reference

SmoothNoiseContoursShaders

Main container component for the smooth noise contour effect.

PropTypeDefaultDescription
speednumber1.0Animation speed multiplier (0.1 to 3.0)
noiseScalenumber1.0Noise pattern scale factor (0.5 to 3.0)
contourLevelsnumber9.0Number of contour bands (3.0 to 20.0)
edgeIntensitynumber1.0Edge detection 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 noise calculations and fwidth operations. Consider reducing noiseScale and contourLevels props for better performance.

Contours too dense/sparse: Adjust the contourLevels prop to control contour band density. Lower values create fewer, broader bands, higher values create detailed striped patterns.

Noise too fine/coarse: Use the noiseScale prop to control pattern size. Lower values create larger organic shapes, higher values create fine detailed textures.

Edges too harsh/soft: Lower the edgeIntensity prop for softer edge detection. Values around 0.3-0.7 create subtle definition without visual noise.

You might also like

Explore other shader-based background components for React applications:

Questions developers actually ask