Skip to content
Back to work08 — WebGL · Interactive 3DExperimental

Prism

An experimental WebGL scene: a refractive glass form that reacts to the cursor and scroll, built to learn shaders, post-processing and performance budgeting.

RoleCreative development
CategoryWebGL · Interactive 3D
StackThree.js, React Three Fiber, GLSL, GSAP, Lenis, Next.js
Prism experiment: glass geometry with refracted colour bands on a dark scene

Overview

Prism is a learning project in real-time 3D for the web. A single glass geometry sits in the centre of the page; light bends through it, colour bands shift as the cursor moves, and scrolling rotates and splits the form into its facets.

Challenge

Refraction, bloom and depth of field are expensive. The experiment had to hit 60 fps on a mid-range laptop, degrade gracefully on phones, and stay under a small JavaScript budget.

Process

  1. 01

    Started with a plain mesh and a transmission material, then wrote a custom fragment shader for the colour dispersion.

  2. 02

    Added a post-processing pass for bloom with a strict resolution cap.

  3. 03

    Tied scroll progress to rotation and facet separation through GSAP ScrollTrigger and Lenis.

  4. 04

    Profiled on a low-end device and added a quality switch that drops passes before dropping frames.

Solution

A React Three Fiber scene inside a Next.js page. The material is a custom shader, post-processing is limited to one bloom pass, and every animation is driven by scroll or pointer rather than a free-running loop, so the GPU idles when nothing changes.

Features

Custom GLSL dispersion shader
Cursor-driven light direction
Scroll-driven rotation and facet split
Adaptive quality for phones and low-power devices
Reduced-motion fallback with a static render
Under 200 kB of JavaScript for the scene
Prism scene at rest
01The form at rest
Prism split into facets
02Facets split on scroll
Prism quality settings panel
03Quality switch
Next project

AI Learning Platform

A modern learning platform where students get personalised resources, an AI study assistant, progress tracking and interactive lessons in one place.

Open case study
Cover artwork for the AI Learning Platform