@gliwy/runtime-gltf
v0.1.0-preview.1
Published
Optional Gliwy prebuilt static GLB browser runtime
Readme
Optional static GLB runtime (experimental)
This first-party package selects a separate prebuilt Bevy runtime. It does not add asset loading or glTF dependencies to the stock runtime package. Consumers retain the generated JS/WASM and use npm/Vite without building Rust.
The retained 0.1.0-preview.1 release packet for source
4c37fd2b2b604c3a1780844f307129bc6b5f5b2a passed packed-consumer, optional
dependency-notice and root/nested static-model browser checks in
release run 36933330094,
artifact 11197960228.
That evidence covers the packet's exact bytes and Chromium software WebGL 2,
including textured rendering, camera controls and explicit document reopen.
It does not establish native rendering, hardware performance, every browser or
later artifact revisions. Qualifying a packet does not publish npm packages;
a source-only checkout is not a usable prebuilt distribution.
For a local first run, see Your first static model in the source checkout.
Select externalRuntime from this package with
gliwy({runtime: externalRuntime}) in @gliwy/runtime-bevy/vite. Place your own
models under your application's public/assets/; source: 'models/chair.glb'
resolves to {Vite base}/assets/models/chair.glb. Root and nested same-origin
Vite bases are supported by the existing runtime integration. A custom host must
provide the same frame-to-application asset-root mapping.
createAssetClient(app) exposes load, setTransform, unload, inspect, and
waitForReady. load({id, source, scene: 0, transform}) returns the applied
extension receipt and generation. Pass that generation to
waitForReady(id, {generation, signal, timeoutMs}). Receipt means the load was
admitted; ready means a CPU scene instance is installed, not that a GPU frame
has presented. Failure and superseded/unloaded/runtime-ended generations reject
explicitly. A wait timeout or abort stops waiting; call unload to remove the
instance. The runtime also fails loading after 30 seconds.
The application owns ID, source path, scene selection and complete root transform. Save those descriptors and retain the GLB file in your project. Inspection is bounded and contains no raw geometry, Bevy entities or GPU handles. Save/reopen does not embed the model file, choose persistence or promise that a URL's contents remain unchanged. Use versioned filenames for immutable content.
Deliberate subset
Self-contained glTF 2.0 binary .glb with one embedded BIN buffer, static triangle
meshes with exported normals, node hierarchy/transforms, opaque metallic/roughness
PBR materials and embedded 8-bit PNG/JPEG textures. UV0/UV1, colors and tangents follow
Bevy's loader; KHR_materials_unlit is the only allowed extension. Coordinates
are retained as authored, right-handed Y-up, meter units by glTF convention.
Export opaque, static models with normals and embedded textures from your authoring
tool. Source TRS scales must be positive; matrix transforms must be affine, non-sheared and non-reflected. Root transforms use unit quaternions
and positive bounded scales.
External/data URIs, .gltf sidecar closures, skins, animations, morphs, cameras,
transparency, high-bit-depth images, sparse accessors, non-triangle topologies and other extensions
(including Draco, Meshopt, KTX2/Basis and texture-transform extensions) reject.
Nothing silently substitutes a cube or drops a required unsupported feature.
The GLB preflight runs before Bevy is allowed to load its dependencies.
Budgets: 32 instances, 4 distinct sources, 16 MiB per GLB, 512 source nodes/depth 32, 2048 loaded scene nodes, 128 meshes/materials, 256 shared primitives and instances per scene (1024 across all scenes), 200k vertices/600k indices, 16 images, 32 textures, 2048px image edge, 32 MiB estimated decoded RGBA image data per source. These are admission limits, not performance promises. Browser fetch, decode staging, CPU and GPU allocations may use more memory than these figures.
This is trusted application source composition, not a security sandbox or a hostile-upload service. Model paths are canonical application-relative paths; HTTP(S) asset-source features are not enabled. The application/host and its own origin still control served content and redirects. No unrestricted fetch or sandbox guarantee is made. Keep CSP appropriate to your own hosting policy.
Instances release their private roots and Bevy world instances on unload/reload. Shared mesh/material/image handles are reference-owned by Bevy and are not removed by asset ID while another instance might use them. This does not promise immediate GPU-memory reclamation. Stopping the RuntimeClient removes its iframe/WASM lifetime using the existing browser adapter.
Protocol compatibility remains gliwy.bevy/2 plus gliwy.extensions/1; assets
use gliwy.assets/1. Scene and extension receipts are independent. Rust authors
use pinned Bevy 0.19.1 source composition; this is not a binary plugin ABI.
Original fixture artwork is generated from source under CC0, with no external
asset license dependency. Linked third-party code still requires its full notices.
