<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/building-an-infinite-liquid-glass-grid-with-three-js-webgpu-and-tsl-cwvx0gsr8" -->

---
title: Building an Infinite Liquid Glass Grid with Three.js,...
description: A creative development studio walks through how they built an infinite liquid glass grid demo using Three.js, WebGPU, and TSL (Three.js Shading Language). The...
canonical: https://daily.dev/posts/building-an-infinite-liquid-glass-grid-with-three-js-webgpu-and-tsl-cwvx0gsr8
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Building an Infinite Liquid Glass Grid with Three.js, WebGPU, and TSL | daily.dev
og:description: A creative development studio walks through how they built an infinite liquid glass grid demo using Three.js, WebGPU, and TSL (Three.js Shading Language). The...
og:url: https://daily.dev/posts/building-an-infinite-liquid-glass-grid-with-three-js-webgpu-and-tsl-cwvx0gsr8
og:image: https://api.daily.dev/og/posts/CWvx0gsr8.png
og:image:alt: Building an Infinite Liquid Glass Grid with Three.js, WebGPU, and TSL
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Building an Infinite Liquid Glass Grid with Three.js, WebGPU, and TSL

**[Codrops](https://daily.dev/sources/codrops)** · 9 min read · 9 upvotes · 1 comments

## Summary

A creative development studio walks through how they built an infinite liquid glass grid demo using Three.js, WebGPU, and TSL (Three.js Shading Language). The technique fakes glass entirely in a custom shader rather than using real geometry: a signed distance function generates a rounded-rectangle height map, normals are derived from the height map's slope, and multiple refraction taps with slightly different indices of refraction create chromatic dispersion. Reflection is faked via an environment map lookup with Fresnel-based intensity, and a rim light adds edge highlighting. The 'infinite' grid is actually a sphere with wrapped coordinates, giving the illusion of endless depth. Real HTML text is overlaid pixel-perfectly on the 3D cards using CSS matrix3d transforms mirroring the camera projection. An update section describes adding a GPU cloth simulation (XPBD solver via TSL compute passes) to make the glass grid physically wobble, with text migrated to in-scene MSDF font rendering via pmndrs/glyph.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://tympanus.net/codrops/2026/09/08/building-an-infinite-liquid-glass-grid-with-three-js-webgpu-and-tsl>

## Questions this post answers

### How can I fake glass refraction in Three.js without using MeshPhysicalMaterial's transmission property?

Use a flat, subdivided plane with a custom shader instead of real glass geometry. Compute a 2D signed distance function for a rounded rectangle, turn the distance into a height map using a superellipse bevel curve, derive surface normals by sampling the height map at nearby offsets, then refract the view ray through that normal to displace texture lookups. This avoids MeshPhysicalMaterial's need for a lit scene and a separate transmission render buffer.

_daily.dev surfaces shader techniques like this for developers building custom WebGPU materials._

### How do you achieve chromatic dispersion in a custom TSL glass shader?

Refract the view ray multiple times using a slightly different index of refraction (ior plus a dispersion offset) for each color channel tap, then sample the base texture at each displaced UV and weight the result into red, green, or blue. Because TSL unrolls plain JavaScript for loops at shader compile time, the number of taps becomes a simple quality knob that can be tuned per device without changing the shader code.

_Developers tuning shader performance across GPUs can track TSL techniques like this on daily.dev._

### How do you make real HTML text stay pixel-perfect on top of a 3D mesh in Three.js WebGPU?

Apply the same technique Three.js's CSS3DRenderer uses, done manually: set a CSS perspective on a fixed layer derived from the camera's field of view, apply the camera's inverse matrix as a matrix3d transform on a nested camera div, then apply each mesh's world matrix as a matrix3d transform on an absolutely positioned div per card. Because the browser's CSS perspective math matches the GPU's, the divs land exactly on the corresponding meshes and tilt with them during drag.

_daily.dev helps developers mixing DOM overlays with WebGPU scenes keep up with techniques like this._

## Community discussion

Top comments from developers on daily.dev.

**@agustinbarrientos** · 0 upvotes

> Do the MSDF labels still work with text selection and screen readers?

## Similar posts on daily.dev

- [Drawing With Light: An Exploration of Lit GPU Tubes with TSL and WebGPU](https://daily.dev/posts/drawing-with-light-an-exploration-of-lit-gpu-tubes-with-tsl-and-webgpu-hcfish0ru) · Codrops · 0 upvotes · 0 comments
- [Explore This Tactile UI Powered By Real-Time WebGL Shader](https://daily.dev/posts/explore-this-tactile-ui-powered-by-real-time-webgl-shader-unjsszd7a) · 80 LEVEL · 1 upvotes · 0 comments
- [Fascinating Particle Simulation Created with WebGPU](https://daily.dev/posts/fascinating-particle-simulation-created-with-webgpu-q0z5bb1e6) · 80 LEVEL · 0 upvotes · 0 comments
- [False Earth: From WebGL Limits to a WebGPU-Driven World](https://daily.dev/posts/false-earth-from-webgl-limits-to-a-webgpu-driven-world-zzrupzujv) · Codrops · 9 upvotes · 2 comments

---

Tags: [#creative-coding](https://daily.dev/tags/creative-coding), [#game-development](https://daily.dev/tags/game-development), [#react-three-fiber](https://daily.dev/tags/react-three-fiber), [#threejs](https://daily.dev/tags/threejs), [#webgpu](https://daily.dev/tags/webgpu)

[View this post on daily.dev](https://daily.dev/posts/building-an-infinite-liquid-glass-grid-with-three-js-webgpu-and-tsl-cwvx0gsr8)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Building an Infinite Liquid Glass Grid with Three.js, WebGPU, and TSL","url":"https://daily.dev/posts/building-an-infinite-liquid-glass-grid-with-three-js-webgpu-and-tsl-cwvx0gsr8","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/building-an-infinite-liquid-glass-grid-with-three-js-webgpu-and-tsl-cwvx0gsr8"},"datePublished":"2026-09-08T19:09:11.880Z","dateModified":"2026-10-15T02:22:25.975Z","description":"A creative development studio walks through how they built an infinite liquid glass grid demo using Three.js, WebGPU, and TSL (Three.js Shading Language). The...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/a0fec06f898f532f6ad39627763dc9ae?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/a0fec06f898f532f6ad39627763dc9ae?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Codrops","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Codrops","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/codrops","url":"https://daily.dev/sources/codrops"},"commentCount":1,"discussionUrl":"https://daily.dev/posts/building-an-infinite-liquid-glass-grid-with-three-js-webgpu-and-tsl-cwvx0gsr8","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":9},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":1}],"keywords":"creative-coding,game-development,react-three-fiber,threejs,webgpu","timeRequired":"PT9M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Codrops","item":"https://daily.dev/sources/codrops"},{"@type":"ListItem","position":3,"name":"Building an Infinite Liquid Glass Grid with Three.js, WebGPU, and TSL"}]}
{"@context":"https://schema.org","@type":"WebPage","@id":"https://daily.dev/posts/building-an-infinite-liquid-glass-grid-with-three-js-webgpu-and-tsl-cwvx0gsr8","comment":[{"@type":"Comment","text":"Do the MSDF labels still work with text selection and screen readers?","datePublished":"2026-09-09T18:28:20.140Z","url":"https://daily.dev/posts/CWvx0gsr8#c-B49k4Vzrm","author":{"@type":"Person","name":"Agustin Barrientos","url":"https://daily.dev/agustinbarrientos","image":"https://media.daily.dev/image/upload/s--5ayxQnqn--/f_auto/v1788281802/avatars/avatar_wQYYVe5Tbj0NJ7C7qPoa8?_a=BAMAMicg0"}}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/building-an-infinite-liquid-glass-grid-with-three-js-webgpu-and-tsl-cwvx0gsr8#faq","mainEntity":[{"@type":"Question","name":"How can I fake glass refraction in Three.js without using MeshPhysicalMaterial's transmission property?","acceptedAnswer":{"@type":"Answer","text":"Use a flat, subdivided plane with a custom shader instead of real glass geometry. Compute a 2D signed distance function for a rounded rectangle, turn the distance into a height map using a superellipse bevel curve, derive surface normals by sampling the height map at nearby offsets, then refract the view ray through that normal to displace texture lookups. This avoids MeshPhysicalMaterial's need for a lit scene and a separate transmission render buffer. daily.dev surfaces shader techniques like this for developers building custom WebGPU materials."}},{"@type":"Question","name":"How do you achieve chromatic dispersion in a custom TSL glass shader?","acceptedAnswer":{"@type":"Answer","text":"Refract the view ray multiple times using a slightly different index of refraction (ior plus a dispersion offset) for each color channel tap, then sample the base texture at each displaced UV and weight the result into red, green, or blue. Because TSL unrolls plain JavaScript for loops at shader compile time, the number of taps becomes a simple quality knob that can be tuned per device without changing the shader code. Developers tuning shader performance across GPUs can track TSL techniques like this on daily.dev."}},{"@type":"Question","name":"How do you make real HTML text stay pixel-perfect on top of a 3D mesh in Three.js WebGPU?","acceptedAnswer":{"@type":"Answer","text":"Apply the same technique Three.js's CSS3DRenderer uses, done manually: set a CSS perspective on a fixed layer derived from the camera's field of view, apply the camera's inverse matrix as a matrix3d transform on a nested camera div, then apply each mesh's world matrix as a matrix3d transform on an absolutely positioned div per card. Because the browser's CSS perspective math matches the GPU's, the divs land exactly on the corresponding meshes and tilt with them during drag. daily.dev helps developers mixing DOM overlays with WebGPU scenes keep up with techniques like this."}}]}
```

