From 4caac736f6e5fbd2728e48394e733c81f146e21b Mon Sep 17 00:00:00 2001 From: CRT Date: Wed, 26 Aug 2026 18:43:57 +0000 Subject: [PATCH] Report the backend that is actually in use MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The viewer's readout took `navigator.gpu ? 'WebGPU' : 'WebGL2 (fallback)'`, which is the browser's CAPABILITY and not the backend the renderer settled on. The two agree in every ordinary case, which is exactly why it would have gone on being wrong indefinitely. It came up while checking what a visitor without WebGPU actually gets from the page, since that page is meant to be published and Safari and Firefox only got WebGPU recently. Forcing the WebGL2 path, the readout went on saying WebGPU throughout. It now asks the renderer, and forcing the path again proves it: with `navigator.gpu` still present it correctly reads WebGL2 (fallback). One line, and it is the only signal anyone has about which path they are on — a readout that can be wrong is worse than none. The check itself was worth more than the fix. The whole viewer works on the WebGL2 backend, `@scifi-kit`'s TSL node materials included: the gauge renders with its emissive dial and its brass intact, and the console is clean. So the README's warning was wrong in the direction that costs you readers — it told people they needed WebGPU to run the viewer, when only the separate demo app insists on it. Also: the comment above the showcase buttons still did its arithmetic for 27 models. Same class of thing as the stale README numbers, in a place `check-docs` cannot see, so it now names all three durations and says why 90 s exists. --- README.md | 6 ++++-- src/viewer.ts | 24 ++++++++++++++++++------ 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 1285cd0..bffa19b 100644 --- a/README.md +++ b/README.md @@ -20,8 +20,10 @@ and edit, not an asset you load. ## Run the viewer -Requires [Bun](https://bun.sh) and a browser with WebGPU (the `@scifi-kit` model -in the demo uses TSL node materials; the medieval kit itself does not). +Requires [Bun](https://bun.sh). The viewer runs on WebGPU where the browser has +it and falls back to three's own WebGL2 backend where it does not — including +for `@scifi-kit`'s TSL node materials, which compile on both paths. Only the +separate demo app at `/` insists on WebGPU. ```sh bun install diff --git a/src/viewer.ts b/src/viewer.ts index 7240c6f..2058e64 100644 --- a/src/viewer.ts +++ b/src/viewer.ts @@ -118,11 +118,12 @@ app.innerHTML = ` 60 s is the default, not 30. The tour gives every model an equal share of the running time, so - with 27 of them 30 s is 1.1 s each. A beat spends that time sweeping - its parameters and stepping its counts, and none of it reads in a - second: the 30 s run is a flyby of the kit, while 60 s is the one - that actually shows what each model can do. The order and the - emphasis say so. + across 35 of them 30 s is 0.86 s each, 60 s is 1.7 and 90 s is 2.6. + A beat spends its time sweeping the parameters and stepping the + counts, and none of that reads in under a second: the 30 s run is a + flyby of the kit, 60 s is the one that shows what each model can do, + and 90 s is there because that share shrinks every time a model is + added. The order and the emphasis say so. -->