EN
全屏预览
Pelagic Glass 深海次表层焦散折射 WebGL2 着色器
一句话装进 Agent · 极速上手 Free Commercial · 无需绑卡 · 无试用倒计时
Claude Code Cursor Codex Antigravity OpenClaw
基于 Motion3D 原创 3D 网页蓝图「Pelagic Glass 深海次表层焦散折射 WebGL2 着色器」(https://motion3d.dev/works/pelagic-glass/):把自包含源码 ZIP 解压到 ./site,完整保留 60fps WebGL / GLSL + HTML5 动效骨架,替换为我的品牌文案、Logo 与主题色
免费商用永久有效 · 复制指令交给你的 Agent,免登录直接下载源码包解压即可开跑。
工艺拆解与配色
生产级英文提示词 · 7093 字符
Build "Pelagic Glass — Subsurface Light Field" (Study 04 by Nereid Optics Lab), a museum-grade, full-bleed interactive WebGL2/GLSL procedural underwater caustics artwork designed to render at a locked 60fps across desktop and retina displays. The default resting state MUST be a 100% unobstructed edge-to-edge canvas (`100vw × 100vh`, `overflow: hidden`, zero visible text, badges, borders, or chrome) so the viewer is immediately immersed in pure refracted pelagic light, matching the full-bleed contemplative purity of physical water-surface caustics. ### 1. Visual Aesthetic & Physically Grounded Color Ramp (Beer-Lambert Aquatic Absorption) Avoid cheesy neon Voronoi spiderwebs or rainbow RGB dispersion. Real underwater caustics attenuate warm red wavelengths first while letting blue-green light scatter deeply. Implement a strict, disciplined aquatic color hierarchy with zero overt chromatic aberration: - **Vertical Depth Backdrop Gradient** (always visible inside dark troughs): interpolate smoothly from Shallow Skylight Teal `#0A424E` across the top 15% of the viewport, through Pelagic Midnight `#042832` at mid-screen (40–60%), down to Abyssal Trench `#01131A` along the bottom 15% edge. - **Four-Tier Caustic Intensity Mapping**: 1. Faint gossamer secondary contour threads & wide outer veil: Subsurface Veil `#2F7A86` 2. Primary curved liquid ribbons & striated wave bands: Liquid Aquamarine `#58C0CA` 3. Sharp focused optical ridges: Electric Caustic Crest `#84FAFE` 4. Nonlinear focal intersection hotspots & constructive convergence cusps: Incandescent Cusp Core `#C9FFFF` (soft-shoulder HDR tonemapped so G and B approach 1.0 while R peaks near 0.78–0.96, staying glacially aquamarine-white without yellowing). - **Anti-Banding Micro-Grain**: Composite ultra-fine isotropic high-frequency filmic dithering (`std ≈ 0.5 / 255` per RGB channel) as the final shader pass to eliminate 8-bit banding across the deep `#01131A → #0A424E` water gradient. ### 2. Procedural Optical Caustics Math (Curvilinear Folds, Not Polygonal Voronoi) Write a custom GLSL ES 3.00 fragment shader on a fullscreen triangle that generates fluid, silk-like curvilinear caustic folds, pinched circular/toroidal lens rings, parallel wave-crest striations, and 1–2px gossamer ghost filaments: - **Exact 10.000-Second Seamless Closed-Orbit Loop (`T = 10.0`)**: Parameterize time strictly through circular phase angle `theta = 2.0 * PI * fract(uTime / 10.0)`. Drive all temporal noise coordinates along closed 4D/3D toroidal orbits `(R * cos(k * theta), R * sin(k * theta))` using integer harmonics `k = 1, 2, 3, 4`. Enforce zero net linear translational pan so the caustic web breathes, folds, pinches, and unfolds organically in-place with zero jump at the `10.0s → 0.0s` wrap. - **Multi-Stage Domain-Warped Ridge + Optical Convergence Field**: - Compute two-level iterative curl/domain warping (`q = fbm3D(p, orbit1)`, `r = fbm3D(p + 1.85 * q, orbit2)`) with gentle octave rotation matrices to eliminate axial grid alignment. - Derive the primary caustic ribbon from inverse-ridge focusing on the warped potential (`ridge = 1.0 - abs(fbm3D(p + 2.35 * r, orbit3))`) combined with local Jacobian/curvature focusing (`1.0 / (eps + length(grad))`) so flat wave-trough inflections bloom into luminous pools while steep folds pinch into razor-sharp `#C9FFFF` cusps and detached circular rings. - Shape intensity with a **dual-exponent optical kernel**: tight incandescent core `pow(ridge, 7.5) * 1.35` plus broad translucent volumetric veil `pow(ridge, 2.0) * 0.42`, layered with subtle parallel wave-crest striations (`sin(ridge * 18.0 + phase)` masked inside medium-high intensity bands). - Add a **phase-offset gossamer filament layer** (`exp(-52.0 * abs(secondaryRidge)) * 0.28`) to trace ultra-thin 1–2px `#2F7A86`–`#58C0CA` contour threads through the dark abyssal basins. ### 3. Millisecond-Accurate Harmonic Cadence & Choreographed Breathing Rhythm Tune the harmonic phase weights (`k = 1, 2, 3, 4`) so global bright-pixel coverage and deformation speed naturally follow a four-swell sinusoidal breathing curve (`easeInOutSine`, `cubic-bezier(0.37, 0, 0.63, 1)` per half-cycle) over each 10,000ms loop: - **0ms–1200ms (Opening Swell 1)**: Begins from a serene left-weighted cluster with an open right-hand pelagic dark basin (`~12%` bright area), accelerating smoothly across `400ms–1000ms` into central striated ribbons and pinched top-left rings (`~19.5%` bright area by `1200ms`). - **1200ms–2600ms (Swell 1 Ebb & Calm Trough)**: Forms an isolated upper-left circular ring and lower-right luminous pool (`1400ms`), then rapidly clears across `1600ms–2000ms` and decelerates into the sparsest abyssal trough at `2400ms–2800ms` (`~8%` bright coverage). - **2600ms–4000ms (Primary Climax Convergence)**: Accelerates steeply from `2800ms` to peak instantaneous morph velocity at `3400ms`, culminating in an incandescent multi-layer convergence plateau across `3600ms–4000ms` (`~28%` bright coverage flooding the central 75% of the frame). - **4200ms–5200ms (Midpoint Relaxation)**: Relaxes smoothly into horizontal striated ribbons and a calm velocity valley at `5200ms` (`~9.3%` bright coverage). - **5200ms–7200ms (Secondary Diagonal Swell)**: Sweeps diagonal aquamarine energy from bottom-left to top-right, peaking around `6000ms–6200ms` (`~17%` bright area) before easing gently to `7200ms`. - **7200ms–10000ms (Dual-Crest Closing Ebb & Seamless Wrap)**: Rebounds rapidly through a sharp velocity peak near `7800ms–8000ms`, settles past a soft secondary ridge (`8800ms`), decelerates to its calmest stillness around `9400ms–9600ms`, and wraps seamlessly back into the `0ms` left-cluster topology. ### 4. Subtle Interaction, Hidden Studio Drawer & Production Engineering - **Pointer Refractive Ripple**: Track normalized pointer coordinates with spring-damped velocity (`exponential decay τ = 1200ms`) and inject a gentle radial phase perturbation into the domain-warp field on mouse move or touch drag, bending nearby caustic ribbons organically without breaking the underlying 10.0s loop phase. - **Hidden-by-Default Exhibition HUD (`H` Key Toggle)**: Keep all UI completely invisible (`opacity: 0; pointer-events: none`) on initial load. Pressing `H` fades in (`320ms cubic-bezier(0.22, 1, 0.36, 1)`) a whisper-thin bottom-left frosted-glass placard (`rgba(4, 40, 50, 0.58)`, `backdrop-filter: blur(14px)`, `1px solid rgba(132, 250, 254, 0.16)`) titled **Pelagic Glass** (`Cormorant Garamond`, 20px light italic, `#C9FFFF`) with subtitle `STUDY 04 · NEREID OPTICS LAB` and compact controls (`IBM Plex Mono`, 10px uppercase, `tabular-nums`): `LOOP PHASE (0.00s–10.00s)`, `REFRACTION GAIN`, `SWELL PACE`, and `PAUSE / RESUME`. - **Engineering Polish**: Cap DPR at `Math.min(window.devicePixelRatio, 2)`, resize seamlessly via `ResizeObserver` preserving aspect-ratio-corrected isotropic UV space, support `?t=<seconds>` URL time-locking for deterministic visual QA, handle `webglcontextlost`, and slow animation pace to `0.35×` when `prefers-reduced-motion: reduce` is active.
工艺拆解、动效栈与配色系统

原创设计理念

Pelagic Glass(Nereid Optics Lab · Study 04)是一套 10.000 秒无缝闭环的全屏 WebGL2 水下焦散光场着色器,采用双级域扭曲液态折射与阻尼指针水波扰动,适用于海洋科技与高端创意背景。

色彩系统(点击复制 Hex)

版式与区块架构

整部作品采用 100% 全屏出血(`100vw × 100vh`,16:9 基准画幅 `1536×864`)的无边框单画布构图,不存在传统网页的页眉、导航栏、分段滚动区或常驻卡片,所有视觉层次完全由光场本身的空间疏密与垂直水深光学衰减构建: - **空间分区与视觉深度**:顶部 0%–15% 为较通透的浅海天光透射带(暗底中位 `#0A424E`),中部 40%–60% 为主焦散网络活跃的远洋中层区(暗底 `#042832`),底部 85%–100% 沉降为高对比度的深海暗礁阴影底(`#01131A`),形成天然的视觉呼吸重心与暗角收边。 - **动态负空间构图节奏**:画布并非均匀铺满光丝,而是随着 4 个谐波涌动周期在「高留白非对称构图(如 `0000ms` 左重右空、`2400ms` 仅 8% 亮区)」与「全屏满幅炽亮高潮(`3600ms–4000ms` 亮区达 28.4%,光丝覆盖约 75% 视口)」之间平滑切换。 - **隐藏式交互层(原创工程扩展)**:默认状态下 `opacity: 0` 完全隐身以维持 1:1 视觉纯度;当用户按下 `H` 键时,左下角轻柔浮现一枚超薄磨砂玻璃展览铭牌(*Pelagic Glass · Study 04 — Nereid Optics Lab*)与微型参数条(循环相位、折射增益、涌动速率、暂停/继续),不遮挡画面中心焦散主战场。

动效与前端工程栈

本作品的核心技术本质是一套 **单 Pass 高精全屏 WebGL2/GLSL 周期性光学焦散片元着色器**(Fullscreen Triangle + Custom Fragment Shader),无 3D 网格依赖却呈现出极强的流体折射体积感: 1. **闭环谐波时间引擎**:以 `T = 10.000s` 为基本周期,令 `θ = 2π * fract(uTime / 10.0)`,将多个整数倍频圆轨道 `(cos(kθ), sin(kθ))`(`k = 1, 2, 3, 4`)注入 3D/4D Simplex FBM 的两级域扭曲偏移量中;这既保证了 `9.80s → 10.00s/0.00s` 的零跳变无缝循环,又让整体亮度与瞬时变形速度自然呈现出每 ~2.4s 一次的 `easeInOutSine` 正弦呼吸感,并消除任何线性漂移。 2. **多层次光学焦散合成管线**: - **主焦散褶皱与尖点(Cusp Focusing)**:对二次域扭曲场取反脊 `1.0 - abs(f)` 并结合局部梯度模长衰减模拟光线经水面凹凸透镜的雅可比汇聚效应,使用双指数核(锐利高能核心 `pow(..., 7.5)` + 柔和体积辉光 `pow(..., 2.0)`)渲染出丝绸厚度的亮带与炽亮交点。 - **波峰平行干涉条带**:在中等至高亮能量带内调制高频相位余弦条纹,精准还原 `0800ms` 中部与 `5200ms` 右侧的多重平行折射细纹。 - **次级发丝幽灵轮廓层**:独立采样相位错开的域扭曲零交叉窄带 `exp(-52.0 * abs(f2))`,在暗盆地绘制 1–2px 半透明青绿细线,构建双层深水纵深感。 3. **色彩映射、抖动与轻交互**:使用符合水体光谱吸收的非线性渐变查表(`#01131A → #0A424E → #2F7A86 → #58C0CA → #84FAFE → #C9FFFF`)加软肩 HDR 色调映射,末端叠加 `~0.5/255` 高频抖动颗粒杜绝色带;交互上引入指数阻尼指针相位扰动(`τ = 1200ms`),支持鼠标划水微折射与 `?t=` 精确帧锁定。

工程实现要点与避坑指南

  • 严禁使用传统 Voronoi/Worley 蜂窝网格直接充当焦散:本作品焦散呈丝绸般的曲线褶皱、封闭椭圆环与平行干涉条带,而非僵硬多边形尖角;必须通过两级迭代域扭曲(Iterative Domain-Warped 3D/4D FBM)叠加反脊聚焦(1 - abs(field))与局部曲率/雅可比汇聚来实现有机液态折叠质感。
  • 禁止滥用彩虹色散(RGB Chromatic Aberration):逐通道互相关实测显示 R/G/B 位移为 (0,0) 至 (0,-1) 亚像素,画面严格遵循水体比尔-朗伯红光吸收定律(深暗区 R≈3, G≈30, B≈40;极亮核 R≈201, G≈255, B≈255),盲目加入品红/橙黄色散边会瞬间破坏静谧逼真的深海光学质感。
  • 10 秒无缝闭环必须采用闭轨相位采样而非线性时间推进:全片 9800ms→0000ms 像素差仅为 20.33(完全位于内部帧差均值 26.50 区间内),且 10 秒净平移量接近零;若直接对噪声 z 轴写 `uTime * speed` 会导致循环跳变或单向漂移,必须映射为闭圆坐标 `(R*cos(k*θ), R*sin(k*θ))`(`θ = 2π * t / 10.0`,整数谐波 `k ∈ {1,2,3,4}`)。
  • 双层光学厚度是高级感的核心分水岭:除了高指数尖锐亮脊(`pow(ridge, 7.5)`)与宽柔光晕(`pow(ridge, 2.0)`),必须在暗盆地区域叠加独立的相位偏移极细发丝层(1–2px 宽度、`exp(-52.0 * abs(secondaryRidge))`),否则暗部会显得死板扁平,失去真实水体上下层折射的空间纵深。
  • 必须叠加垂直深度吸收梯度与极细胶片防色带噪点:实测暗部底色自上而下呈 `#0A424E → #042832 → #01131A` 渐变,暗青色在 8-bit 屏幕极易出现明显断层色带(Banding);本作品暗盆地内置约 `std ≈ 0.50`(0–255 尺度)的各向同性高频微颗粒抖动,WebGL 片元末尾必须加入等量高频蓝噪/哈希抖动。
  • 保持默认首屏 100% 纯净无 UI 遮挡:本作品全程零文字、零控件,若在画布上强行常驻标题栏或浮窗会破坏 1:1 沉浸式光场构图;应将作品铭牌与光学参数抽屉默认完全隐藏(仅按 `H` 键淡入),并做好 DPR 上限 `<= 2.0` 与纵横比等比 UV 校正,防止超宽屏下拉伸畸变。

性能预算、移动端降级与 AI 二次开发规格

Pelagic Glass(WebGL 背景 · 3D 与交互工艺,Motion3D 工艺评分 9.4/10)采用零构建自包含的深色暗调影棚工程架构,全套包含 9 个源码文件(ZIP 体积 27.5 KB),核心技术栈为 WebGL / GLSL / HTML5 并内置 本地化离线依赖库。核心交互覆盖 光标 / 物理交互, GLSL 着色器,视觉基调锁定于标准色板(Abyssal Trench (#01131A), Pelagic Midnight (#042832), Shallow Skylight Teal (#0A424E), Subsurface Veil (#2F7A86))。

  • 60fps 渲染卫生与视口自适配:内置设备像素比(DPR)上限控制、防抖 resize 监听与 GPU 合成层优化,在高分屏下稳定输出流畅帧率,避免 WebGL 上下文泄漏或主线程滚动阻塞。
  • 移动端与减弱动态偏好降级:在触控设备上自动将悬停物理效果平滑过渡为触控与滚动响应,同时遵循 prefers-reduced-motion 系统偏好,保证移动端排版与转化按钮清晰可用。
  • AI 编程工具无损换皮:将随包附带的 7093 字符英文生产提示词贴入 Claude Code、Cursor、Codex、Antigravity 或 v0,或接入 Motion3D 官方 MCP(npx -y motion3d-mcp),保留着色器参数与相机阻尼骨架不变即可高效替换品牌与多语言内容。
  • 免费 Shadcn Registry CLI 直装:本免费商用蓝图已收录至开放组件仓库,可直接执行 npx shadcn@latest add https://motion3d.dev/r/pelagic-glass.json 拉取源码(索引:/r/registry.json)。
常见问题

关于「Pelagic Glass」的常见问题

「Pelagic Glass」支持购买前在线预览吗?可以用于商业项目和客户外包吗?

可以。「Pelagic Glass」属于永久免费商用蓝图(¥0 免登录),支持 1:1 浏览器实机预览、直接下载完整工程 ZIP(9 个文件,27.5 KB)、免 Key 官方 MCP 拉取与 Shadcn Registry CLI(npx shadcn@latest add https://motion3d.dev/r/pelagic-glass.json),可用于个人官网、企业站与收费客户外包且无需强制署名。

「Pelagic Glass」的技术栈、体积大小和移动端兼容表现如何?

本作品采用 WebGL / GLSL / HTML5 打造,完整工程包共 9 个源码文件(ZIP 体积 27.5 KB,内置 本地化离线依赖库)。桌面端针对 60fps 渲染做了 DPR 上限与视口防抖控制,移动端自动降级为触控友好交互,且所有依赖全部本地化打包,杜绝外链 CDN 失效白屏。

如何用 Claude Code、Cursor、Codex 或 v0 对「Pelagic Glass」进行品牌换皮?

解压自包含源码 ZIP(或通过官方 MCP `npx -y motion3d-mcp` / `npx shadcn@latest add https://motion3d.dev/r/pelagic-glass.json` 一键拉入工作区),将附带的 7093 字符生产级英文提示词与你的品牌文案、目标色板一并交给 AI 编程工具,保留核心 WebGL / GLSL / HTML5 动效骨架逐块替换文案和图片即可部署上线,亦可无缝迁移至 Next.js / React / Vue。

更多原创作品

更多3D 与交互工艺 →