Nebulore
forgeui/nebuloreFreeComponent
A WebGL-powered animated nebula background featuring flowing aurora ribbons, domain-warped simplex noise, and customizable color glow with film grain.
Live preview
live · rendered by the registry
Rendered by ForgeUI on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://forgeui.in/r/nebulore.jsonSource
1"use client";23import { useEffect, useMemo, useRef } from "react";4import { cn } from "@/lib/utils";56const vertexShaderGLSL = `7attribute vec2 position;8varying vec2 vUv;910void main() {11 vUv = position * 0.5 + 0.5;12 gl_Position = vec4(position, 0.0, 1.0);13}14`;1516const fragmentShaderGLSL = `17precision highp float;1819varying vec2 vUv;2021uniform vec2 u_resolution;22uniform float u_time;23uniform float u_speed;24uniform float u_grain;25uniform vec3 u_colors[3];2627vec3 mod289(vec3 x) { return x - floor(x * (1.0 / 289.0)) * 289.0; }28vec2 mod289(vec2 x) { return x - floor(x * (1.0 / 289.0)) * 289.0; }29vec3 permute(vec3 x) { return mod289(((x * 34.0) + 1.0) * x); }3031float snoise(vec2 v) {32 const vec4 C = vec4(0.211324865405187, 0.366025403784439, -0.577350269189626, 0.024390243902439);33 vec2 i = floor(v + dot(v, C.yy));34 vec2 x0 = v - i + dot(i, C.xx);35 vec2 i1 = (x0.x > x0.y) ? vec2(1.0, 0.0) : vec2(0.0, 1.0);36 vec4 x12 = x0.xyxy + C.xxzz;37 x12.xy -= i1;38 i = mod289(i);39 vec3 p = permute(permute(i.y + vec3(0.0, i1.y, 1.0)) + i.x + vec3(0.0, i1.x, 1.0));40 vec3 m = max(0.5 - vec3(dot(x0, x0), dot(x12.xy, x12.xy), dot(x12.zw, x12.zw)), 0.0);41 m = m * m;42 m = m * m;43 vec3 x = 2.0 * fract(p * C.www) - 1.0;44 vec3 h = abs(x) - 0.5;45 vec3 ox = floor(x + 0.5);46 vec3 a0 = x - ox;47 m *= 1.79284291400159 - 0.85373472095314 * (a0 * a0 + h * h);48 vec3 g;49 g.x = a0.x * x0.x + h.x * x0.y;50 g.yz = a0.yz * x12.xz + h.yz * x12.yw;51 return 130.0 * dot(m, g);52}5354float fbm(vec2 p) {55 float value = 0.0;56 float amplitude = 0.5;57 mat2 rot = mat2(0.87, 0.48, -0.48, 0.87);5859 for (int i = 0; i < 5; i++) {60 value += amplitude * snoise(p);61 p = rot * p * 2.05;62 amplitude *= 0.5;63 }6465 return value;66}6768void main() {69 vec2 uv = vUv;70 float ratio = u_resolution.x / max(u_resolution.y, 1.0);71 vec2 p = (uv - 0.5) * vec2(ratio, 1.0);72 float t = u_time * u_speed;7374 vec2 warp = vec2(75 fbm(p * 1.4 + vec2(t * 0.08, t * 0.04)),76 fbm(p * 1.4 + vec2(-t * 0.06, t * 0.05) + 4.2)77 );78 vec2 q = p + warp * 0.35;7980 float ribbonA = abs(snoise(vec2(q.x * 1.8 + t * 0.12, q.y * 2.4 - t * 0.08)));81 float ribbonB = abs(snoise(vec2(q.x * 2.6 - t * 0.1, q.y * 1.6 + t * 0.06 + ribbonA)));82 float nebula = pow(1.0 - smoothstep(0.0, 0.55, ribbonA + ribbonB * 0.6), 2.2);8384 float drift = fbm(p * 0.9 + vec2(t * 0.05, -t * 0.03));85 nebula *= smoothstep(-0.4, 0.8, drift + 0.2);86 nebula *= smoothstep(0.05, 0.55, uv.y) * smoothstep(1.0, 0.35, uv.y);8788// … truncated
Files it writes
More from ForgeUI
All 28 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Animated Formanimated-form | ForgeUI | Components | Free | no deps | |
| Animated OTPanimated-otp | ForgeUI | Components | Free | no deps | |
| Animated Tabsanimated-tabs | ForgeUI | Components | Free | no deps | |
| Auralisauralis | ForgeUI | Components | Free | no deps | |
| Bot Detectionbot-detection | ForgeUI | Components | Free | no deps | |
| Chromatic Fluidchromatic-fluid | ForgeUI | Components | Free | no deps | |
| Cloudscapecloudscape | ForgeUI | Components | Free | no deps | |
| Cosmicriftcosmicrift | ForgeUI | Components | Free | no deps |
