Skip to content

three.js cube

A blue cube in three-quarter view, each face a different shade from lighting, centred on a near-black background

What you are looking at: one cube, three visible faces, each a different shade. That shading is the whole test — it means a real light is being evaluated per fragment and the depth buffer is sorting the faces correctly. A flat silhouette would mean something had quietly fallen back.

src/main.js is plain three.js 0.186: WebGLRenderer, PerspectiveCamera, MeshStandardMaterial, an ambient and a directional light, setAnimationLoop, and a resize handler.

MeshStandardMaterial is physically based — it compiles a substantial shader, so this is a meaningfully harder ask of the GL layer than a sprite.

Terminal window
npm run build:screenkit -w screenkit-example-threejs-cube
runtime/build/macos/screenkit-host --window examples/threejs-cube/app.skpkg