web3d-kit
v0.1.0
Published
Small renderer-neutral 3D primitives for web graphics.
Maintainers
Readme
Web3D Kit
Portable, renderer-neutral 3D descriptions for web graphics.
Web3D Kit describes a scene without choosing its renderer. Its portable, serializable models can move between documents, workers, multiplayer state, and renderer adapters without carrying a GPU instance with them.
Install
npm install web3d-kitUse it wherever scene data needs to remain independent of its eventual renderer: workers, stored documents, multiplayer messages, and renderer adapters all receive the same plain values.
import { mesh, planeGeometry, scene, shaderMaterial } from "web3d-kit";
const descriptor = scene({
children: [
mesh({
geometry: planeGeometry({ width: 2, height: 2 }),
material: shaderMaterial({
vertexShader,
fragmentShader,
uniforms: { time: 0 },
}),
}),
],
});Included
- tuple vectors and bounds
- transforms, scene nodes, mesh descriptors, and depth-first traversal
- plane, box, sphere, and portable buffer geometry descriptors
- basic, standard, and shader material descriptors
- texture and camera descriptors
Intentionally excluded
No renderer, GPU resources, asset loading, controls, React bindings, or
Three.js dependency lives here. Those belong to an adapter such as
threebridge, or to an
application.
