惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

爱范儿
爱范儿
量子位
大猫的无限游戏
大猫的无限游戏
小众软件
小众软件
J
Java Code Geeks
B
Blog
V
V2EX
博客园 - 三生石上(FineUI控件)
Blog — PlanetScale
Blog — PlanetScale
aimingoo的专栏
aimingoo的专栏
Y
Y Combinator Blog
F
Fortinet All Blogs
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
The Cloudflare Blog
A
About on SuperTechFans
D
DataBreaches.Net
阮一峰的网络日志
阮一峰的网络日志
博客园 - Franky
H
Help Net Security
宝玉的分享
宝玉的分享
Martin Fowler
Martin Fowler
酷 壳 – CoolShell
酷 壳 – CoolShell
MongoDB | Blog
MongoDB | Blog
L
LangChain Blog

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
Where WebGL Meets Liquid Glass
Carson Ye · 2026-06-25 · via DEV Community

Recently, I worked on experiments implementing the well-known liquid glass effects on the web. Most of the implementations right now use a similar idea: clone the DOM content behind a glass element, distort that cloned layer, add blur, tint, highlights, and chromatic offsets, then place the result back under the glass surface.

But it breaks down when the thing behind the glass is a real canvas. Because a DOM clone can copy HTML, text, images, layout, and backgrounds. But it cannot naturally copy the actual pixels generated inside a WebGL canvas. A canvas is not a static DOM subtree. It is a framebuffer that changes every frame.

To make liquid-glass work on canvas, I would either need to capture the canvas every frame, which can become expensive and easy to desync, or move the glass refraction into the canvas/WebGL pipeline itself.

I needed a better WebGL demonstration

To test and demonstrate canvas-native liquid glass properly, I needed a background that was worth refracting. I wanted something alive: something with motion, attractive and visually pleasing.

Around that time, I saw a beautiful interactive water ripple demonstration on X by Konmari. The visual language was simple but very attractive: soft water motion, cursor-driven ripples, floating elements, and slightly poetic atmosphere.

I borrowed the core idea and built my own version:

Water Ripples

The result is an interactive WebGL water scene with realistic ripple physics, floating yellow plumeria flowers, sunlight glints, and a liquid-glass settings panel that refracts the live canvas underneath it.

The transparent and luminous visual effect is hard to describe in a few words, so I would suggest trying the demo directly.

The core idea

The demo is built around two parts: the water ripple scene, and the liquid-glass panel that refracts that scene.

The water uses a simple height-field ripple simulation. Pointer movement adds disturbances to a grid, the grid spreads those waves outward, and a WebGL shader turns the height changes into distortion and light. It is not a full fluid simulation, but for this kind of visual effect, a height map plus refraction and sunlight details is enough.

The flowers are rendered on a 2D canvas above the water. They are partly decoration, but they also help reveal the effect. When the glass bends something recognizable, like a flower, the refraction becomes much easier to read.

For the liquid glass part, the important detail is that the panel samples pixels instead of cloning DOM. The WebGL water canvas and the 2D flower canvas are first composited into one hidden source canvas. Then the glass shader samples that source and offsets the UVs inside the panel area.

In practice, the render flow is:

render WebGL water
render 2D flowers
composite both into one source canvas
sample that canvas in the glass shader

Inside the panel, the shader estimates a soft edge normal and uses it to bend the source texture. The center stays calmer, while the edges distort the scene more strongly. A little tint, highlight, and chromatic split make it feel thicker than a normal blurred card.

The goal is not physical accuracy, but to make the panel feel like a material sitting above a living canvas scene.

This is not the end

This demo is only an experiment for liquid glass inside canvas. It works because the scene is already pixels, so the shader can sample and bend them directly. A complete liquid-glass solution for the web is much harder, because real pages include DOM, text, images, video, scrolling, transforms, and many different rendering paths.

Many people are exploring this direction, and maybe we will eventually get a mature solution. But performance will always matter. This demo is not optimized as a production implementation; it is just a small exploration, and I will keep watching where this area goes.