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. |
||
|---|---|---|
| my-registry | ||
| scripts | ||
| src | ||
| .gitattributes | ||
| .gitignore | ||
| bun.lock | ||
| index.html | ||
| LICENSE | ||
| models.json | ||
| models.lock.json | ||
| package.json | ||
| README.md | ||
| REFERENCE.md | ||
| tsconfig.json | ||
| viewer.html | ||
| vite.config.ts | ||
| vite.viewer.config.ts | ||
medieval-kit
A lowpoly medieval model library for Vibe3D, plus the viewer used to build it.
Vibe3D is a source-first model registry for Three.js: you install the TypeScript that generates a model into your own project rather than depending on an opaque package. This repository holds one such registry.
my-registry/— the@medieval-kitregistry, published to npm as@medieval-kit/registry.src/— a demo app that installs from both@medieval-kitand the first-party@scifi-kit, so the two can be inspected side by side.
Run the viewer
Requires Bun and a browser with WebGPU (the @scifi-kit model
in the demo uses TSL node materials; the medieval kit itself does not).
bun install
bun run registry:build
bun run dev
Open /viewer.html for the model inspector: registry-grouped catalogue, live
triangle counts, configuration sliders wired to configure(), and a wireframe
overlay.
Use the kit in your own project
bunx vibe3d init
bunx vibe3d add @medieval-kit/wooden-barrel
See my-registry/README.md for the model list,
configuration fields, and runtime contract.
Verify
bun run typecheck
bun run verify
verify runs 64 checks against the installed sources without a browser:
geometry validity, winding, coplanar-face (z-fighting) detection, stable root
and anchor identity across configure(), deterministic seeding, material
ownership, and idempotent disposal.
Two of those deserve a note, because both were written after a real bug:
- Winding is checked two ways, because two kinds of geometry need two
measures. Bodies of revolution use radial alignment — every radial face on the
outer shell must point away from the axis. Closed solids use signed volume:
Σ a·(b×c)/6is positive only when the winding faces outward. - Z-fighting is checked by looking for triangles that share a plane, share a normal direction, and overlap in area. Edge contact between neighbouring boards is fine and is not flagged; genuine coplanar overlap is.
Layout
my-registry/
models/core/ shared palette, RNG, geometry vocabulary, part slots
models/<model-id>/ one procedural model per folder
build.ts compiles models/ into dist/registry.json
src/
viewer.ts the model inspector
lib/vibe3d/ Vibe3D contracts installed by `vibe3d init`
models/ installed model source (owned, editable)
scripts/
verify-model.ts browser-free conformance checks
zfight.ts coplanar overlap detection
models.json which registries this project resolves
models.lock.json install receipt; `vibe3d diff` compares against it
src/models/ is generated by vibe3d add but committed on purpose: it is the
demo's own source, and keeping it in the tree is what makes vibe3d diff
meaningful.
Released under the MIT License.