Skip to main content

build-webgl-liquid-glass

Build production-ready GPU liquid-glass surfaces with liquid-gl for React, Vite, or DOM interfaces. Use this as the default skill for optimized glass material, liquid glass, refractive notification cards, floating panels, GPU bevel/refraction, or the WeFlow E/WebGL look. Prefer it over SDF glass unless WebGL is unavailable, the surface count is high, or the user explicitly asks for D/SDF/Vaso.

跳到安装

来源信息

仓库
woodfishhhh/glass-material-skills
最近来源活动
2026年8月4日 06:45
检测到的 SKILL.md 语言
英语
星标
1
分支
0

安装方式

默认使用会先检查来源的 Prompt;你也可以切换为直接命令,或下载本地副本。

检查来源文件

决定是否安装前,请先阅读 SKILL.md,以及 SkillsMP 当前展示的配套文件。

文件资源管理器
6 个文件

正在显示 SKILL.md

SKILL.md
来源说明 · 只读预览
name
build-webgl-liquid-glass
description
Build production-ready GPU liquid-glass surfaces with liquid-gl for React, Vite, or DOM interfaces. Use this as the default skill for optimized glass material, liquid glass, refractive notification cards, floating panels, GPU bevel/refraction, or the WeFlow E/WebGL look. Prefer it over SDF glass unless WebGL is unavailable, the surface count is high, or the user explicitly asks for D/SDF/Vaso.
# Build WebGL Liquid Glass Create a real refractive material while keeping text and controls crisp above the lens. ## Workflow 1. Inspect the existing framework, styling conventions, target background, and browser support. 2. Install `liquid-gl` with the repository's package manager. 3. Adapt `assets/react/WebGLLiquidGlass.tsx`, `webgl-liquid-glass.css`, and `liquid-gl.d.ts` for React projects. Preserve the same DOM layering in other frameworks. 4. Keep the WebGL target empty. Put readable content in a sibling overlay; never place text inside the rasterized lens target. 5. Point `snapshotSelector` at the real visual background, not the glass card or the whole app when avoidable. 6. Initialize after the target and background assets exist. Register animated or replaceable backgrounds with `liquidGL.registerDynamic()`. 7. Preserve a CSS `backdrop-filter` fallback and legible foreground colors when WebGL is unavailable. 8. Verify the result over light, dark, and high-frequency backgrounds. Drag or scroll the surface and confirm refraction stays aligned. ## Default Tuning Start with the asset defaults: - `resolution: 1.5` - `refraction: 0.007` - `aberration: 0.03` - `bevelDepth: 0.075` - `bevelWidth: 0.18` - `frost: 2.2` - `magnify: 1.006` - `shadow: false`, `specular: true`, `tilt: false` Read `references/tuning.md` before changing these values or adding several lenses. ## Quality Gates - Keep content as DOM text above the lens. Reject duplicated, blurred, or chromatically split text. - Avoid hard clipping, detached refraction, stale snapshots, black canvases, and visible shader seams. - Keep the surface dimensions stable during loading and interaction. - Reduce resolution and disable expensive options before replacing the WebGL approach. - Respect `prefers-reduced-motion`; do not add tilt or elastic motion by default. - Test Chromium desktop and a mobile viewport. Check the console and confirm the fallback remains usable. ## Fallback Choice Use `$build-sdf-liquid-glass` only when the user explicitly selects D/SDF, WebGL is unavailable, or many simultaneous glass surfaces make the shared GPU renderer inappropriate.
在 GitHub 查看