Coral Passage: a coral reef that runs in a browser tab.
Two blue tangs lead you through five parts of a reef: a sunlit passage, a coral crown, a blue grotto, a sand garden and an anemone cove. 39 fish of 23 kinds live along the way. Tap a lionfish, a mandarinfish or a garden eel in its burrow and the camera goes to swim beside it. A field guide lists them all.
There is no game engine on this page. The fish swim in a shader; the light, the sound and the interface are written with one web framework: Clarity.js, drawn by its own renderer on WebGL2 or WebGPU. The reef is a picture given depth, so the fish pass in front of it and behind it. The page's own JavaScript is 89 KB gzipped, renderer included.
The fish models are the work of Nachat's Aquarium (なちゃっと水族館), given to the public domain. Thank you.
What is Clarity.js?
An open-source (MIT) JavaScript framework. You write an ordinary website and a real-time 3D world in the same language, and an AI agent can read and play what you build through a contract the page declares.
The showcase has 40 worlds now, all running in the browser.
Links in the reply.
#javascript #webgpu
来源:Özdemir Şarman · x.com