<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/from-rays-to-meshes-building-vercel-s-prism-with-vgpu-ml9qzyfcx" -->

---
title: From Rays to Meshes: Building Vercel’s Prism with vgpu
description: A Vercel engineer recounts building the glass prism hero effect for the vgpu library's landing page, describing the shift from an expensive ray-traced approach...
canonical: https://daily.dev/posts/from-rays-to-meshes-building-vercel-s-prism-with-vgpu-ml9qzyfcx
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: From Rays to Meshes: Building Vercel’s Prism with vgpu | daily.dev
og:description: A Vercel engineer recounts building the glass prism hero effect for the vgpu library's landing page, describing the shift from an expensive ray-traced approach...
og:url: https://daily.dev/posts/from-rays-to-meshes-building-vercel-s-prism-with-vgpu-ml9qzyfcx
og:image: https://api.daily.dev/og/posts/Ml9qZYFCx.png
og:image:alt: From Rays to Meshes: Building Vercel’s Prism with vgpu
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.

# From Rays to Meshes: Building Vercel’s Prism with vgpu

**[Codrops](https://daily.dev/sources/codrops)** · 5 min read · 2 upvotes · 0 comments

## Summary

A Vercel engineer recounts building the glass prism hero effect for the vgpu library's landing page, describing the shift from an expensive ray-traced approach to a cheaper mesh-based technique for rendering light refraction. The piece covers building a glass shader with cubemap reflections, creating light and dark mode variants using AI-generated concept art, static normal maps for wall texture, baked shadow textures, and an adaptive quality system that switches rendering fidelity based on GPU tier, battery level, and frame rate.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://tympanus.net/codrops/2026/09/03/from-rays-to-meshes-building-vercels-prism-with-vgpu>

## Questions this post answers

### How do you render a realistic light refraction effect through a glass prism efficiently in WebGL without expensive ray tracing?

Convert the ray-traced light paths into a 3D mesh instead of tracing rays per pixel. Calculate how each wavelength refracts entering and exiting the prism, represent those paths as lines forming a fan of colors, then connect neighboring paths into triangular faces so the GPU can shade a mesh directly, producing a smoother and cheaper result than a 16-sample jittered ray-tracing approach.

_daily.dev surfaces techniques like this for developers optimizing real-time WebGL shader effects._

### What signals should a web app use to automatically switch to a lower-quality rendering mode for performance?

Use three signals: GPU tier, battery level, and frame rate. Low-tier or mobile GPUs start in low-quality mode by default, laptops under 30% battery and not charging switch to low quality to save power, and any device unable to maintain a stable frame rate also drops to the lighter shader version with fewer samples and less detail.

_Developers tuning adaptive rendering strategies can track approaches like this on daily.dev._

## Similar posts on daily.dev

- [Vercel’s vgpu: A WebGPU library built for AI agents](https://daily.dev/posts/vercel-s-vgpu-a-webgpu-library-built-for-ai-agents-7rm9jxwem) · LogRocket · 1 upvotes · 0 comments
- [Exploring Procedural Geometry with Three.js and WebGPU](https://daily.dev/posts/exploring-procedural-geometry-with-three-js-and-webgpu-fmy1y3gze) · Codrops · 1 upvotes · 0 comments
- [Behind the build: Generative plugins and shaders at Figma](https://daily.dev/posts/behind-the-build-generative-plugins-and-shaders-at-figma-jy1gzcfgy) · Figma · 0 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

---

Tags: [#3d](https://daily.dev/tags/3d), [#game-development](https://daily.dev/tags/game-development), [#gpu](https://daily.dev/tags/gpu), [#vercel](https://daily.dev/tags/vercel), [#webgl](https://daily.dev/tags/webgl)

[View this post on daily.dev](https://daily.dev/posts/from-rays-to-meshes-building-vercel-s-prism-with-vgpu-ml9qzyfcx)

```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":"From Rays to Meshes: Building Vercel’s Prism with vgpu","url":"https://daily.dev/posts/from-rays-to-meshes-building-vercel-s-prism-with-vgpu-ml9qzyfcx","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/from-rays-to-meshes-building-vercel-s-prism-with-vgpu-ml9qzyfcx"},"datePublished":"2026-09-03T16:05:39.081Z","dateModified":"2026-10-15T02:24:25.679Z","description":"A Vercel engineer recounts building the glass prism hero effect for the vgpu library's landing page, describing the shift from an expensive ray-traced approach...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/30f5e7d1c8734ad69186ca0312a2b5c6?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/30f5e7d1c8734ad69186ca0312a2b5c6?_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":0,"discussionUrl":"https://daily.dev/posts/from-rays-to-meshes-building-vercel-s-prism-with-vgpu-ml9qzyfcx","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":2},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"3d,game-development,gpu,vercel,webgl","timeRequired":"PT5M"}
{"@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":"From Rays to Meshes: Building Vercel’s Prism with vgpu"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/from-rays-to-meshes-building-vercel-s-prism-with-vgpu-ml9qzyfcx#faq","mainEntity":[{"@type":"Question","name":"How do you render a realistic light refraction effect through a glass prism efficiently in WebGL without expensive ray tracing?","acceptedAnswer":{"@type":"Answer","text":"Convert the ray-traced light paths into a 3D mesh instead of tracing rays per pixel. Calculate how each wavelength refracts entering and exiting the prism, represent those paths as lines forming a fan of colors, then connect neighboring paths into triangular faces so the GPU can shade a mesh directly, producing a smoother and cheaper result than a 16-sample jittered ray-tracing approach. daily.dev surfaces techniques like this for developers optimizing real-time WebGL shader effects."}},{"@type":"Question","name":"What signals should a web app use to automatically switch to a lower-quality rendering mode for performance?","acceptedAnswer":{"@type":"Answer","text":"Use three signals: GPU tier, battery level, and frame rate. Low-tier or mobile GPUs start in low-quality mode by default, laptops under 30% battery and not charging switch to low quality to save power, and any device unable to maintain a stable frame rate also drops to the lighter shader version with fewer samples and less detail. Developers tuning adaptive rendering strategies can track approaches like this on daily.dev."}}]}
```

