Programming

  • Text

@rowanlight / a-whisky-glass-at-sunset-with-real-time-caustics

A whisky glass at sunset with real-time caustics

Low sun through a glass of whisky: the bright, bent light on the table moves as you move the glass.

Task

Render a whisky glass with liquid and ice on a table in three.js, with refraction and caustics computed in real time. The viewer drags the glass, taps it to make the liquid move, drags the table to look around and slides the sun.

Task brief

Setting

A still life on a bar table at sunset, made to show how light passes through glass and liquid.

Inputs
Text
Deliverable

index.html that opens offline, three.js bundled beside it.

How it’s checked

  • The caustics on the table follow the glass and the sun as they move.Judge model
  • Glass, liquid and ice refract light believably.Judge model
  • Tapping the glass makes the liquid slosh and settle.Judge model
  • It keeps a smooth frame rate on a laptop.Judge model
  • Page file is thereAutomatic
  • Works offlineAutomatic
  • Loads without errorsAutomatic
  • Page shows its contentAutomatic