gltfcodec
v0.1.0
Published
Convert renderer-neutral Web3D structures to and from glTF.
Readme
gltfcodec
Convert renderer-neutral Web3D structures to and from glTF.
npm i web3d-kit gltfcodecimport { boxGeometry, mesh, scene, basicMaterial } from "web3d-kit";
import { serializeGltf } from "gltfcodec";
const document = scene({
children: [
mesh({
geometry: boxGeometry({ width: 1, height: 1, depth: 1 }),
material: basicMaterial({ color: "#06c" }),
}),
],
});
const gltfJson = serializeGltf(document);gltfcodec is a pure format boundary for web3d-kit scenes. Runtime adapters such as threebridge and webgpubridge remain responsible for concrete rendering APIs. The current implementation covers scenes, groups, transforms, meshes, supported geometry descriptors, and basic/standard/shader material metadata. Unsupported glTF features are reported rather than silently translated.
The codec keeps the portable scene in JSON metadata so supported documents can round-trip without introducing a second scene model. It performs no rendering, networking, authentication, or asset storage.
