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.
The showcase is the one deliverable a still render cannot check, and until now
the only way to check it was to watch it -- which is how a model half out of
frame gets shipped. `__probe.framing()` projects the current model's bounding
box into the frame and reports the worst corner in normalised device
coordinates: 0 is comfortably inside, 1 is exactly on the edge. The whole 60
seconds can then be swept and the bad moments found by number.
Swept, it found five models leaving the frame. Four of them were during the dip
between beats, where the veil is 92% opaque and the point is that you cannot see
the swap -- so the honest figure is two frames out of 1060, the broom and the
ladder, each for a twentieth of a second. Not much. Also not nothing, when the
whole point of the tour is that someone records it once and posts it.
The first fix was to widen the framing margin from 1.55 to 1.62. It worked and
it was the wrong fix: it took a slice of the frame off all thirty-five models to
buy back two frames from one, and mean fill fell to 0.515 -- every model sitting
in half a screen of empty space.
The right fix is in the chase. The camera's distance follows the model's size by
exponential approach at a single rate, and the two directions are not the same
mistake: falling behind a model that is GROWING crops it, and falling behind one
that is shrinking only leaves it small for a moment, which nobody notices. The
broom was the last offender because its bundle and its handle both sweep. So the
camera now retreats at 18 and closes at 7, and with that in place the margin
came back in past where it started, to 1.38.
Measured over the visible frames of a full 60 s run: no frame crops, the closest
any model comes to the edge is 0.81, and mean fill is 0.605 against 0.515 for
the wide-margin version and 0.55 for the original. Models are bigger in frame
than before AND nothing is cut.
Also here: the tour verified end to end -- 1201 frames, 60.05 s, 35 models, no
repeats, chest to oak -- and two stale numbers in the README. It claimed ~800
checks (1,044) and did its showcase arithmetic for 27 models, which is the kind
of sentence that goes quietly wrong every time a model is added, so it now says
what the number does when the kit grows.
One correction to my own measurements, twice over. `showcase.update` clamps its
delta to 0.05 internally, which `frameStep` does not, so stepping 0.2 advances
0.05 -- my first two readings of the tour's length were wrong by 4x and 10x and
disagreed with each other, which is what gave it away. And the run that
reported 34 models in 57.8 s was racing a page reload, not a dropped model.
Testing the recording flow turned up two faults, both of which produce a
bad file rather than an error.
The clip took whatever size the browser window happened to be. Measured
here that was 1220x900 -- a 1.36:1 video, which is not a shape any platform
expects and which each of them letterboxes differently. A recording now
locks the renderer to 1920x1080 at pixel ratio 1 and restores the previous
size when it stops. Pixel ratio matters: `captureStream` takes the drawing
buffer, so leaving it at 2 would have recorded 3840x2160 and paid four
times the pixels for a clip nobody watches above 1080.
The second is worse because it is silent. `setAnimationLoop` runs on
requestAnimationFrame, which browsers stop completely while a tab is
hidden -- measured at zero frames per second. The tour stops advancing and
the canvas stops feeding `captureStream`, but the recorder keeps writing,
so the file comes out the right length and full of one frozen image. A 60 s
tour is long enough that reaching for another window is the natural thing
to do. The recording now ends there, with a console warning saying why: a
short clip you know about beats a full-length one that is fifty seconds of
a still frame.
Adds `__probe.step(delta)` alongside the existing `renderOnce`. The file
already explained that the probe exists because requestAnimationFrame stops
in a background tab and automated tests could not get a frame; `renderOnce`
draws one but advances nothing, so it could not answer whether the showcase
gets through its beats. The animation loop's body is now a named function
that both the loop and the probe call.
Verified through that hook rather than by watching, since the browser pane
does not composite here:
tour 1201 steps = 60.1 s, ends clean, 27 distinct captions --
every model once, in order
output video/webm;codecs=vp9, decodes, duration finite at 2.489 s
for a 2.5 s capture (MediaRecorder often reports Infinity)
canvas 976x720 before, 1920x1080 during, 976x720 after
download fires as medieval-kit-60s.webm
hidden tab showcase and recorder both stop
cost 1.3 ms per frame at 1920x1080 -- ample headroom for 60 fps
27 models, 19007 triangles, all checks pass, build clean.
The tour splits its running time equally between the models, so with 27 of
them a 30 s run is 1.1 s each. A beat spends that time sweeping its
continuous parameters and stepping its counts at the midpoint, and none of
that reads in a second. 30 s is a flyby of the kit; 60 s is the length at
which the variation work is actually visible. The order and the emphasis
now say which is which, and the 30 s button is labelled for what it is.
A hands-off tour of the whole kit, built to be screen-free: it hides the
UI, drives every slider, fires the action on the models that have one and
holds a caption with the registry address. 30 / 60 / 90 s, also startable
from the URL (viewer.html?showcase=60) so an unattended recording is
possible. "Record to file" captures the canvas via MediaRecorder and
downloads a WebM instead of asking anyone to screen-record.
Three things came out of watching the first run:
- The parameter sweep was choppy. It was throttling `configure()` to
~14 Hz, which is a full rebuild — geometry, occlusion bake, mottle —
and at that rate it reads as the model freezing and jumping. Replaced
with actual morphing (src/morph.ts): both ends of a beat are built
once, their vertex buffers captured, and every frame blends between
them. Measured: 21 consecutive samples now give 21 distinct vertex
positions where before they stepped. The constraint is that integer
parameters must hold still within a beat, since they change the
triangle count; they change at the cuts instead.
- The bottom of models was being cropped. Two causes. The framing margin
was 1.32× the bounding sphere and the chase rate was slow, so a sweep
that grew the model outran the camera. And, more seriously,
`Box3.setFromObject` reuses `geometry.boundingBox` once it exists — the
morph was writing new positions without invalidating it, so the camera
was re-fitting against the shape the model had before the sweep began.
Margin is now 1.55, the chase is twice as fast, the bounds are dropped
on every blend, and the look-at point sits slightly below centre so the
model rides higher in frame.
- It felt rushed. Part of that was pacing, part was the cut: the dip to
black ran 0.22 s at each end, so a 2.2 s beat spent a fifth of itself
dimmed. Cut to 0.13 s, and 90 s added as the unhurried length.
The kit is going public, so everything a reader sees is now English:
27 model sources, the core vocabulary, meta.ts (titles, descriptions and
every slider label), the viewer UI, all script output, REFERENCE.md and
the READMEs.
Rules applied: only comments, doc comments and human-facing strings were
touched. Identifiers, numbers, logic, registry item ids, part names and
material slot names are unchanged — those are a published contract and
were already English.
Verified rather than assumed: for all 53 changed .ts files the code
skeleton (source with comments stripped and string contents replaced by a
placeholder) is byte-identical before and after. Full gate is green —
typecheck, registry conformance, ~510 model checks, GLB round trip and a
production build.
Also fixed here:
- index.html and viewer.html were missed by the translation pass because
the file list only covered .ts/.md/.css. Both had lang="tr" and Turkish
titles.
- The viewer formatted triangle counts with toLocaleString('tr-TR'), which
prints 15.425 rather than 15,425.
- REFERENCE.md's model table header did not match what
scripts/catalog-table.ts emits, so the next regeneration would have
silently changed it. Aligned to the generator.
- Removed scripts/probe.ts and scripts/zdiag.ts; they were throwaway
diagnostics that got committed by accident.
Modeller (13 → 26): chest, bench, torch, lantern, bell, sign, hay bale,
sack, broom, tankard, book, phial, coin pouch. Kürek, çapa ve yaba
render'lara bakılarak yeniden yazıldı.
core:
- createKitModel artık tipli `actions` ve `update(dt)` taşıyor
- BuiltPart.extras: bir parça birden çok materyal yuvası kullanabiliyor
(sandığın kapağı = meşe tahta + demir kayış, birlikte dönmek zorunda)
- BuiltPart.origin: parça başına dönme merkezi (menteşe, sarkaç)
- bendGeometry / roughenGeometry / mottleGeometry
- 5 yeni materyal yuvası: steel, brass, straw, cloth, leather, glass
- bandGeometry({ inner }) — serbest halkalar kapalı katı olabilsin
my-registry/meta.ts: katalog metadata'sı artık build.ts ve viewer için
tek kaynak. Doğrulama modelle metadata'nın uyuştuğunu denetliyor ve bu
eklendiği gün dört modelde gerçek bir sapma yakaladı.
Doğrulama (~500 kontrol):
- metadata uyumu, eylem semantiği, kare hızı bağımsızlığı
- scripts/render.ts: tarayıcısız yazılım rasterleyici. Bütün doğrulama
geometrikti; "bu kürek küreğe benzemiyor" diyebilmek için modele
bakmak gerekiyordu
- scripts/verify-glb.ts: dışa aktar → geri oku → karşılaştır
GLB dışa aktarımı: viewer düğmesi ve toplu CLI aynı kodu kullanıyor.
Viewer:
- parça paneli (solo/izole) ve materyal yuvası paneli (canlı renk override)
- kit görünümü: 26 model tek sahnede, ölçek ve ton tutarlılığı için
- configure() sonrası gölge bayraklarının düşmesi düzeltildi
A lowpoly medieval procedural model library for Vibe3D, plus the model
inspector used to build it.
Registry (@medieval-kit, published as @medieval-kit/registry):
- core: deterministic mulberry32 RNG, slot-based vertex-coloured materials,
a geometry vocabulary (box, prism, stave, band, head, flip), and the
stable-anchor part slots the Vibe3D protocol requires
- wooden-barrel: 806 tris, 13 separate staves, iron hoops, recessed heads
- wooden-crate: 360 tris, plank rows on corner posts, forged straps
- iron-brazier: 423 tris, typed actions, per-frame flame flicker, own light
The kit declares no renderer capabilities, so it runs on WebGLRenderer as
well as WebGPURenderer. Colour variation lives in vertex attributes rather
than in materials, so each model keeps one draw call per material.
Verification (bun run verify) covers 64 checks without a browser: geometry
validity, winding by two measures (radial alignment for bodies of
revolution, signed volume for closed solids), coplanar-face detection for
z-fighting, stable root and anchor identity across configure(),
deterministic seeding, material ownership, and idempotent disposal.