Best liquid-glass project, build with shader/webgl
🌐 Live Demo: [http://liquid-glass.liziyang.design]
A WebGL liquid glass refraction effect project based on Vue3 + Vite.
npm install
npm run dev
Visit http://localhost:3000 to see the effect
npm run build
npm run preview
Uses mathematical functions to define geometric shapes, more efficient than traditional polygon rendering:
float sdCircle(vec2 uv, float r) {
return length(uv) - r;
}
Simulates light refraction through transparent media based on physical optics principles:
vec2 offset = mix(vec2(0), normalize(st)/sd, length(st));
Implements complete shadow casting including distance attenuation and soft edges.
Requires modern browsers with WebGL2 support.
MIT License
Issues and Pull Requests are welcome!
🌐 在线演示: http://liquid-glass.liziyang.design
一个基于 Vue3 + Vite 的 WebGL 液体玻璃折射特效项目。
npm install
npm run dev
访问 http://localhost:3000 查看效果
npm run build
npm run preview
使用数学函数定义几何形状,比传统多边形渲染更高效:
float sdCircle(vec2 uv, float r) {
return length(uv) - r;
}
基于物理光学原理模拟光线通过透明介质的折射效果:
vec2 offset = mix(vec2(0), normalize(st)/sd, length(st));
实现了完整的阴影投射,包括距离衰减和柔和边缘。
需要支持 WebGL2 的现代浏览器。
MIT License
欢迎提交 Issue 和 Pull Request!