跳到正文
Özdemir Şarman· 来源· @ozsarman · X·· 2 天前AI 评分68
正文 · 原文

Clarity.js: one framework for web apps and real-time 3D worlds, in the browser.

Little Lantern Harbour is one of them. Pilot a small tug round a lighthouse island and tow a mail float, a drifting skiff and a lost fishing net home. A reef camera shows the fish and coral under the water. On night watch the lighthouse turns and the pier lamps come on.

There is no game engine on this page. The water, light, shadows, sound and interface are written with one web framework: Clarity.js.

What is Clarity.js?
An open-source (MIT) JavaScript framework. You write an ordinary website and a 3D world in the browser in the same language.

What it can do:
• UI: components built on signals, no virtual DOM. A counter app is 2.2 KB (66.8 KB with React).
• Its own 3D renderer: WebGL2 and WebGPU, no dependencies, no three.js. glTF models, skeletal animation, shadows, hundreds of lights, volumetric fog and clouds.
• Its own physics: bodies that fall and collide, hinges, a car, cloth.
• Interface inside the scene: the page's own form works on a 3D surface.
• Ready for AI: the worlds open a contract, so an AI agent can read their state and play them.
• Batteries: a 22-component UI library, forms, i18n, server rendering, testing, TypeScript.
• An iOS and Android app with one command, a VS Code extension, and a tool that ports React and three.js code to Clarity.

The site itself is written in Clarity. The showcase has 35 worlds, all running in the browser. This whole harbour is 120 KB of JavaScript, renderer included.

Links in the reply.

#javascript #webgpu

来源:Özdemir Şarman · x.com