@vgpu/render 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +55 -0
- package/dist/domain/camera.d.ts +10 -0
- package/dist/domain/camera.d.ts.map +1 -0
- package/dist/domain/camera.js +2 -0
- package/dist/domain/camera.js.map +1 -0
- package/dist/domain/capsule-data.d.ts +10 -0
- package/dist/domain/capsule-data.d.ts.map +1 -0
- package/dist/domain/capsule-data.js +61 -0
- package/dist/domain/capsule-data.js.map +1 -0
- package/dist/domain/cone-data.d.ts +13 -0
- package/dist/domain/cone-data.d.ts.map +1 -0
- package/dist/domain/cone-data.js +52 -0
- package/dist/domain/cone-data.js.map +1 -0
- package/dist/domain/cylinder-data.d.ts +14 -0
- package/dist/domain/cylinder-data.d.ts.map +1 -0
- package/dist/domain/cylinder-data.js +58 -0
- package/dist/domain/cylinder-data.js.map +1 -0
- package/dist/domain/deg-to-rad.d.ts +2 -0
- package/dist/domain/deg-to-rad.d.ts.map +1 -0
- package/dist/domain/deg-to-rad.js +4 -0
- package/dist/domain/deg-to-rad.js.map +1 -0
- package/dist/domain/disk-data.d.ts +12 -0
- package/dist/domain/disk-data.d.ts.map +1 -0
- package/dist/domain/disk-data.js +21 -0
- package/dist/domain/disk-data.js.map +1 -0
- package/dist/domain/icosphere-data.d.ts +8 -0
- package/dist/domain/icosphere-data.d.ts.map +1 -0
- package/dist/domain/icosphere-data.js +58 -0
- package/dist/domain/icosphere-data.js.map +1 -0
- package/dist/domain/index.d.ts +40 -0
- package/dist/domain/index.d.ts.map +1 -0
- package/dist/domain/index.js +23 -0
- package/dist/domain/index.js.map +1 -0
- package/dist/domain/material-factory.d.ts +34 -0
- package/dist/domain/material-factory.d.ts.map +1 -0
- package/dist/domain/material-factory.js +106 -0
- package/dist/domain/material-factory.js.map +1 -0
- package/dist/domain/material-sampler.d.ts +7 -0
- package/dist/domain/material-sampler.d.ts.map +1 -0
- package/dist/domain/material-sampler.js +11 -0
- package/dist/domain/material-sampler.js.map +1 -0
- package/dist/domain/material-textures-schema.d.ts +29 -0
- package/dist/domain/material-textures-schema.d.ts.map +1 -0
- package/dist/domain/material-textures-schema.js +57 -0
- package/dist/domain/material-textures-schema.js.map +1 -0
- package/dist/domain/material-textures.d.ts +13 -0
- package/dist/domain/material-textures.d.ts.map +1 -0
- package/dist/domain/material-textures.js +91 -0
- package/dist/domain/material-textures.js.map +1 -0
- package/dist/domain/material.d.ts +27 -0
- package/dist/domain/material.d.ts.map +1 -0
- package/dist/domain/material.js +2 -0
- package/dist/domain/material.js.map +1 -0
- package/dist/domain/mesh-box.d.ts +8 -0
- package/dist/domain/mesh-box.d.ts.map +1 -0
- package/dist/domain/mesh-box.js +57 -0
- package/dist/domain/mesh-box.js.map +1 -0
- package/dist/domain/mesh-cache.d.ts +4 -0
- package/dist/domain/mesh-cache.d.ts.map +1 -0
- package/dist/domain/mesh-cache.js +14 -0
- package/dist/domain/mesh-cache.js.map +1 -0
- package/dist/domain/mesh-capsule.d.ts +14 -0
- package/dist/domain/mesh-capsule.d.ts.map +1 -0
- package/dist/domain/mesh-capsule.js +52 -0
- package/dist/domain/mesh-capsule.js.map +1 -0
- package/dist/domain/mesh-cone.d.ts +16 -0
- package/dist/domain/mesh-cone.d.ts.map +1 -0
- package/dist/domain/mesh-cone.js +54 -0
- package/dist/domain/mesh-cone.js.map +1 -0
- package/dist/domain/mesh-cylinder.d.ts +18 -0
- package/dist/domain/mesh-cylinder.d.ts.map +1 -0
- package/dist/domain/mesh-cylinder.js +67 -0
- package/dist/domain/mesh-cylinder.js.map +1 -0
- package/dist/domain/mesh-disk.d.ts +11 -0
- package/dist/domain/mesh-disk.d.ts.map +1 -0
- package/dist/domain/mesh-disk.js +45 -0
- package/dist/domain/mesh-disk.js.map +1 -0
- package/dist/domain/mesh-dodecahedron.d.ts +4 -0
- package/dist/domain/mesh-dodecahedron.d.ts.map +1 -0
- package/dist/domain/mesh-dodecahedron.js +10 -0
- package/dist/domain/mesh-dodecahedron.js.map +1 -0
- package/dist/domain/mesh-fullscreen-quad.d.ts +7 -0
- package/dist/domain/mesh-fullscreen-quad.d.ts.map +1 -0
- package/dist/domain/mesh-fullscreen-quad.js +39 -0
- package/dist/domain/mesh-fullscreen-quad.js.map +1 -0
- package/dist/domain/mesh-icosahedron.d.ts +4 -0
- package/dist/domain/mesh-icosahedron.d.ts.map +1 -0
- package/dist/domain/mesh-icosahedron.js +10 -0
- package/dist/domain/mesh-icosahedron.js.map +1 -0
- package/dist/domain/mesh-icosphere.d.ts +11 -0
- package/dist/domain/mesh-icosphere.d.ts.map +1 -0
- package/dist/domain/mesh-icosphere.js +47 -0
- package/dist/domain/mesh-icosphere.js.map +1 -0
- package/dist/domain/mesh-octahedron.d.ts +4 -0
- package/dist/domain/mesh-octahedron.d.ts.map +1 -0
- package/dist/domain/mesh-octahedron.js +10 -0
- package/dist/domain/mesh-octahedron.js.map +1 -0
- package/dist/domain/mesh-plane.d.ts +13 -0
- package/dist/domain/mesh-plane.d.ts.map +1 -0
- package/dist/domain/mesh-plane.js +51 -0
- package/dist/domain/mesh-plane.js.map +1 -0
- package/dist/domain/mesh-ring.d.ts +12 -0
- package/dist/domain/mesh-ring.d.ts.map +1 -0
- package/dist/domain/mesh-ring.js +47 -0
- package/dist/domain/mesh-ring.js.map +1 -0
- package/dist/domain/mesh-sphere.d.ts +10 -0
- package/dist/domain/mesh-sphere.d.ts.map +1 -0
- package/dist/domain/mesh-sphere.js +51 -0
- package/dist/domain/mesh-sphere.js.map +1 -0
- package/dist/domain/mesh-tetrahedron.d.ts +5 -0
- package/dist/domain/mesh-tetrahedron.d.ts.map +1 -0
- package/dist/domain/mesh-tetrahedron.js +10 -0
- package/dist/domain/mesh-tetrahedron.js.map +1 -0
- package/dist/domain/mesh-torus.d.ts +17 -0
- package/dist/domain/mesh-torus.d.ts.map +1 -0
- package/dist/domain/mesh-torus.js +56 -0
- package/dist/domain/mesh-torus.js.map +1 -0
- package/dist/domain/mesh-types.d.ts +38 -0
- package/dist/domain/mesh-types.d.ts.map +1 -0
- package/dist/domain/mesh-types.js +2 -0
- package/dist/domain/mesh-types.js.map +1 -0
- package/dist/domain/mesh.d.ts +61 -0
- package/dist/domain/mesh.d.ts.map +1 -0
- package/dist/domain/mesh.js +49 -0
- package/dist/domain/mesh.js.map +1 -0
- package/dist/domain/orthographic-camera.d.ts +14 -0
- package/dist/domain/orthographic-camera.d.ts.map +1 -0
- package/dist/domain/orthographic-camera.js +10 -0
- package/dist/domain/orthographic-camera.js.map +1 -0
- package/dist/domain/perspective-camera.d.ts +12 -0
- package/dist/domain/perspective-camera.d.ts.map +1 -0
- package/dist/domain/perspective-camera.js +10 -0
- package/dist/domain/perspective-camera.js.map +1 -0
- package/dist/domain/plane-data.d.ts +12 -0
- package/dist/domain/plane-data.d.ts.map +1 -0
- package/dist/domain/plane-data.js +25 -0
- package/dist/domain/plane-data.js.map +1 -0
- package/dist/domain/polyhedron-data.d.ts +7 -0
- package/dist/domain/polyhedron-data.d.ts.map +1 -0
- package/dist/domain/polyhedron-data.js +42 -0
- package/dist/domain/polyhedron-data.js.map +1 -0
- package/dist/domain/polyhedron-mesh.d.ts +10 -0
- package/dist/domain/polyhedron-mesh.d.ts.map +1 -0
- package/dist/domain/polyhedron-mesh.js +37 -0
- package/dist/domain/polyhedron-mesh.js.map +1 -0
- package/dist/domain/polyhedron-seeds.d.ts +6 -0
- package/dist/domain/polyhedron-seeds.d.ts.map +1 -0
- package/dist/domain/polyhedron-seeds.js +51 -0
- package/dist/domain/polyhedron-seeds.js.map +1 -0
- package/dist/domain/primitive-data-utils.d.ts +9 -0
- package/dist/domain/primitive-data-utils.d.ts.map +1 -0
- package/dist/domain/primitive-data-utils.js +36 -0
- package/dist/domain/primitive-data-utils.js.map +1 -0
- package/dist/domain/ring-data.d.ts +13 -0
- package/dist/domain/ring-data.d.ts.map +1 -0
- package/dist/domain/ring-data.js +24 -0
- package/dist/domain/ring-data.js.map +1 -0
- package/dist/domain/sphere-data.d.ts +11 -0
- package/dist/domain/sphere-data.d.ts.map +1 -0
- package/dist/domain/sphere-data.js +31 -0
- package/dist/domain/sphere-data.js.map +1 -0
- package/dist/domain/srgb.d.ts +5 -0
- package/dist/domain/srgb.d.ts.map +1 -0
- package/dist/domain/srgb.js +11 -0
- package/dist/domain/srgb.js.map +1 -0
- package/dist/domain/torus-data.d.ts +11 -0
- package/dist/domain/torus-data.d.ts.map +1 -0
- package/dist/domain/torus-data.js +38 -0
- package/dist/domain/torus-data.js.map +1 -0
- package/dist/domain/vertex-layout.d.ts +3 -0
- package/dist/domain/vertex-layout.d.ts.map +1 -0
- package/dist/domain/vertex-layout.js +14 -0
- package/dist/domain/vertex-layout.js.map +1 -0
- package/dist/domain/wgsl-alignment.d.ts +17 -0
- package/dist/domain/wgsl-alignment.d.ts.map +1 -0
- package/dist/domain/wgsl-alignment.js +39 -0
- package/dist/domain/wgsl-alignment.js.map +1 -0
- package/dist/edit/edit-source.d.ts +10 -0
- package/dist/edit/edit-source.d.ts.map +1 -0
- package/dist/edit/edit-source.js +9 -0
- package/dist/edit/edit-source.js.map +1 -0
- package/dist/edit/editable-mesh.d.ts +11 -0
- package/dist/edit/editable-mesh.d.ts.map +1 -0
- package/dist/edit/editable-mesh.js +30 -0
- package/dist/edit/editable-mesh.js.map +1 -0
- package/dist/edit/element-set.d.ts +4 -0
- package/dist/edit/element-set.d.ts.map +1 -0
- package/dist/edit/element-set.js +78 -0
- package/dist/edit/element-set.js.map +1 -0
- package/dist/edit/errors.d.ts +11 -0
- package/dist/edit/errors.d.ts.map +1 -0
- package/dist/edit/errors.js +11 -0
- package/dist/edit/errors.js.map +1 -0
- package/dist/edit/half-edge-bake.d.ts +5 -0
- package/dist/edit/half-edge-bake.d.ts.map +1 -0
- package/dist/edit/half-edge-bake.js +30 -0
- package/dist/edit/half-edge-bake.js.map +1 -0
- package/dist/edit/half-edge-build.d.ts +4 -0
- package/dist/edit/half-edge-build.d.ts.map +1 -0
- package/dist/edit/half-edge-build.js +61 -0
- package/dist/edit/half-edge-build.js.map +1 -0
- package/dist/edit/half-edge-kernel.d.ts +21 -0
- package/dist/edit/half-edge-kernel.d.ts.map +1 -0
- package/dist/edit/half-edge-kernel.js +14 -0
- package/dist/edit/half-edge-kernel.js.map +1 -0
- package/dist/edit/half-edge-views.d.ts +8 -0
- package/dist/edit/half-edge-views.d.ts.map +1 -0
- package/dist/edit/half-edge-views.js +40 -0
- package/dist/edit/half-edge-views.js.map +1 -0
- package/dist/edit/index.d.ts +38 -0
- package/dist/edit/index.d.ts.map +1 -0
- package/dist/edit/index.js +20 -0
- package/dist/edit/index.js.map +1 -0
- package/dist/edit/kernel-handle.d.ts +5 -0
- package/dist/edit/kernel-handle.d.ts.map +1 -0
- package/dist/edit/kernel-handle.js +7 -0
- package/dist/edit/kernel-handle.js.map +1 -0
- package/dist/edit/operator-utils.d.ts +33 -0
- package/dist/edit/operator-utils.d.ts.map +1 -0
- package/dist/edit/operator-utils.js +101 -0
- package/dist/edit/operator-utils.js.map +1 -0
- package/dist/edit/operators/bevel.d.ts +18 -0
- package/dist/edit/operators/bevel.d.ts.map +1 -0
- package/dist/edit/operators/bevel.js +65 -0
- package/dist/edit/operators/bevel.js.map +1 -0
- package/dist/edit/operators/bridge.d.ts +14 -0
- package/dist/edit/operators/bridge.d.ts.map +1 -0
- package/dist/edit/operators/bridge.js +55 -0
- package/dist/edit/operators/bridge.js.map +1 -0
- package/dist/edit/operators/dissolve-edges.d.ts +12 -0
- package/dist/edit/operators/dissolve-edges.d.ts.map +1 -0
- package/dist/edit/operators/dissolve-edges.js +55 -0
- package/dist/edit/operators/dissolve-edges.js.map +1 -0
- package/dist/edit/operators/dissolve-faces.d.ts +9 -0
- package/dist/edit/operators/dissolve-faces.d.ts.map +1 -0
- package/dist/edit/operators/dissolve-faces.js +98 -0
- package/dist/edit/operators/dissolve-faces.js.map +1 -0
- package/dist/edit/operators/dissolve-vertices.d.ts +13 -0
- package/dist/edit/operators/dissolve-vertices.d.ts.map +1 -0
- package/dist/edit/operators/dissolve-vertices.js +36 -0
- package/dist/edit/operators/dissolve-vertices.js.map +1 -0
- package/dist/edit/operators/extrude.d.ts +18 -0
- package/dist/edit/operators/extrude.d.ts.map +1 -0
- package/dist/edit/operators/extrude.js +33 -0
- package/dist/edit/operators/extrude.js.map +1 -0
- package/dist/edit/operators/fill-hole.d.ts +12 -0
- package/dist/edit/operators/fill-hole.d.ts.map +1 -0
- package/dist/edit/operators/fill-hole.js +29 -0
- package/dist/edit/operators/fill-hole.js.map +1 -0
- package/dist/edit/operators/grid-fill.d.ts +12 -0
- package/dist/edit/operators/grid-fill.d.ts.map +1 -0
- package/dist/edit/operators/grid-fill.js +20 -0
- package/dist/edit/operators/grid-fill.js.map +1 -0
- package/dist/edit/operators/heal-manifold.d.ts +15 -0
- package/dist/edit/operators/heal-manifold.d.ts.map +1 -0
- package/dist/edit/operators/heal-manifold.js +62 -0
- package/dist/edit/operators/heal-manifold.js.map +1 -0
- package/dist/edit/operators/inset.d.ts +16 -0
- package/dist/edit/operators/inset.d.ts.map +1 -0
- package/dist/edit/operators/inset.js +40 -0
- package/dist/edit/operators/inset.js.map +1 -0
- package/dist/edit/operators/loop-cut.d.ts +14 -0
- package/dist/edit/operators/loop-cut.d.ts.map +1 -0
- package/dist/edit/operators/loop-cut.js +120 -0
- package/dist/edit/operators/loop-cut.js.map +1 -0
- package/dist/edit/operators/merge-by-distance.d.ts +15 -0
- package/dist/edit/operators/merge-by-distance.d.ts.map +1 -0
- package/dist/edit/operators/merge-by-distance.js +78 -0
- package/dist/edit/operators/merge-by-distance.js.map +1 -0
- package/dist/edit/operators/recompute-normals.d.ts +7 -0
- package/dist/edit/operators/recompute-normals.d.ts.map +1 -0
- package/dist/edit/operators/recompute-normals.js +67 -0
- package/dist/edit/operators/recompute-normals.js.map +1 -0
- package/dist/edit/operators/subdivide-edges.d.ts +11 -0
- package/dist/edit/operators/subdivide-edges.d.ts.map +1 -0
- package/dist/edit/operators/subdivide-edges.js +106 -0
- package/dist/edit/operators/subdivide-edges.js.map +1 -0
- package/dist/edit/operators/subdivide-faces.d.ts +11 -0
- package/dist/edit/operators/subdivide-faces.d.ts.map +1 -0
- package/dist/edit/operators/subdivide-faces.js +45 -0
- package/dist/edit/operators/subdivide-faces.js.map +1 -0
- package/dist/edit/selection.d.ts +19 -0
- package/dist/edit/selection.d.ts.map +1 -0
- package/dist/edit/selection.js +21 -0
- package/dist/edit/selection.js.map +1 -0
- package/dist/edit/to-editable.d.ts +9 -0
- package/dist/edit/to-editable.d.ts.map +1 -0
- package/dist/edit/to-editable.js +19 -0
- package/dist/edit/to-editable.js.map +1 -0
- package/dist/edit/types.d.ts +111 -0
- package/dist/edit/types.d.ts.map +1 -0
- package/dist/edit/types.js +2 -0
- package/dist/edit/types.js.map +1 -0
- package/dist/edit/warnings.d.ts +14 -0
- package/dist/edit/warnings.d.ts.map +1 -0
- package/dist/edit/warnings.js +11 -0
- package/dist/edit/warnings.js.map +1 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -0
- package/dist/inspect/index.d.ts +9 -0
- package/dist/inspect/index.d.ts.map +1 -0
- package/dist/inspect/index.js +5 -0
- package/dist/inspect/index.js.map +1 -0
- package/dist/inspect/inspect-material.d.ts +12 -0
- package/dist/inspect/inspect-material.d.ts.map +1 -0
- package/dist/inspect/inspect-material.js +2 -0
- package/dist/inspect/inspect-material.js.map +1 -0
- package/dist/inspect/mesh-to-readable.d.ts +4 -0
- package/dist/inspect/mesh-to-readable.d.ts.map +1 -0
- package/dist/inspect/mesh-to-readable.js +47 -0
- package/dist/inspect/mesh-to-readable.js.map +1 -0
- package/dist/inspect/mesh-to-wireframe.d.ts +5 -0
- package/dist/inspect/mesh-to-wireframe.d.ts.map +1 -0
- package/dist/inspect/mesh-to-wireframe.js +101 -0
- package/dist/inspect/mesh-to-wireframe.js.map +1 -0
- package/dist/inspect/normal-debug-material.d.ts +8 -0
- package/dist/inspect/normal-debug-material.d.ts.map +1 -0
- package/dist/inspect/normal-debug-material.js +42 -0
- package/dist/inspect/normal-debug-material.js.map +1 -0
- package/dist/inspect/normal-debug-shader.d.ts +2 -0
- package/dist/inspect/normal-debug-shader.d.ts.map +1 -0
- package/dist/inspect/normal-debug-shader.js +32 -0
- package/dist/inspect/normal-debug-shader.js.map +1 -0
- package/dist/inspect/wireframe-material.d.ts +9 -0
- package/dist/inspect/wireframe-material.d.ts.map +1 -0
- package/dist/inspect/wireframe-material.js +45 -0
- package/dist/inspect/wireframe-material.js.map +1 -0
- package/dist/inspect/wireframe-mesh.d.ts +9 -0
- package/dist/inspect/wireframe-mesh.d.ts.map +1 -0
- package/dist/inspect/wireframe-mesh.js +2 -0
- package/dist/inspect/wireframe-mesh.js.map +1 -0
- package/dist/inspect/wireframe-shader.d.ts +2 -0
- package/dist/inspect/wireframe-shader.d.ts.map +1 -0
- package/dist/inspect/wireframe-shader.js +24 -0
- package/dist/inspect/wireframe-shader.js.map +1 -0
- package/dist/passes/index.d.ts +6 -0
- package/dist/passes/index.d.ts.map +1 -0
- package/dist/passes/index.js +5 -0
- package/dist/passes/index.js.map +1 -0
- package/dist/passes/pass-sequence.d.ts +9 -0
- package/dist/passes/pass-sequence.d.ts.map +1 -0
- package/dist/passes/pass-sequence.js +21 -0
- package/dist/passes/pass-sequence.js.map +1 -0
- package/dist/passes/pass.d.ts +4 -0
- package/dist/passes/pass.d.ts.map +1 -0
- package/dist/passes/pass.js +99 -0
- package/dist/passes/pass.js.map +1 -0
- package/dist/pipeline.d.ts +16 -0
- package/dist/pipeline.d.ts.map +1 -0
- package/dist/pipeline.js +10 -0
- package/dist/pipeline.js.map +1 -0
- package/dist/rapid-renderer.d.ts +18 -0
- package/dist/rapid-renderer.d.ts.map +1 -0
- package/dist/rapid-renderer.js +58 -0
- package/dist/rapid-renderer.js.map +1 -0
- package/dist/render-pass.d.ts +33 -0
- package/dist/render-pass.d.ts.map +1 -0
- package/dist/render-pass.js +67 -0
- package/dist/render-pass.js.map +1 -0
- package/dist/render-target/render-target-canvas.d.ts +15 -0
- package/dist/render-target/render-target-canvas.d.ts.map +1 -0
- package/dist/render-target/render-target-canvas.js +59 -0
- package/dist/render-target/render-target-canvas.js.map +1 -0
- package/dist/render-target/render-target-multi.d.ts +4 -0
- package/dist/render-target/render-target-multi.d.ts.map +1 -0
- package/dist/render-target/render-target-multi.js +90 -0
- package/dist/render-target/render-target-multi.js.map +1 -0
- package/dist/render-target/render-target.d.ts +10 -0
- package/dist/render-target/render-target.d.ts.map +1 -0
- package/dist/render-target/render-target.js +98 -0
- package/dist/render-target/render-target.js.map +1 -0
- package/dist/render-target/types.d.ts +59 -0
- package/dist/render-target/types.d.ts.map +1 -0
- package/dist/render-target/types.js +2 -0
- package/dist/render-target/types.js.map +1 -0
- package/dist/uniform-pool-internals.d.ts +12 -0
- package/dist/uniform-pool-internals.d.ts.map +1 -0
- package/dist/uniform-pool-internals.js +24 -0
- package/dist/uniform-pool-internals.js.map +1 -0
- package/dist/uniform-pool-types.d.ts +22 -0
- package/dist/uniform-pool-types.d.ts.map +1 -0
- package/dist/uniform-pool-types.js +2 -0
- package/dist/uniform-pool-types.js.map +1 -0
- package/dist/uniform-pool.d.ts +30 -0
- package/dist/uniform-pool.d.ts.map +1 -0
- package/dist/uniform-pool.js +127 -0
- package/dist/uniform-pool.js.map +1 -0
- package/dist/utils/canvas-mouse-tracker.d.ts +11 -0
- package/dist/utils/canvas-mouse-tracker.d.ts.map +1 -0
- package/dist/utils/canvas-mouse-tracker.js +19 -0
- package/dist/utils/canvas-mouse-tracker.js.map +1 -0
- package/dist/utils/canvas-resolution.d.ts +9 -0
- package/dist/utils/canvas-resolution.d.ts.map +1 -0
- package/dist/utils/canvas-resolution.js +16 -0
- package/dist/utils/canvas-resolution.js.map +1 -0
- package/dist/utils/frame-clock.d.ts +10 -0
- package/dist/utils/frame-clock.d.ts.map +1 -0
- package/dist/utils/frame-clock.js +47 -0
- package/dist/utils/frame-clock.js.map +1 -0
- package/dist/utils/index.d.ts +7 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +4 -0
- package/dist/utils/index.js.map +1 -0
- package/package.json +76 -0
- package/src/RenderPass.docs.md +41 -0
- package/src/createRenderPipeline.docs.md +34 -0
- package/src/domain/camera.docs.md +21 -0
- package/src/domain/deg-to-rad.docs.md +9 -0
- package/src/domain/material-factory.docs.md +59 -0
- package/src/domain/material.docs.md +12 -0
- package/src/domain/mesh.docs.md +28 -0
- package/src/domain/orthographic-camera.docs.md +22 -0
- package/src/domain/perspective-camera.docs.md +20 -0
- package/src/domain/srgb.docs.md +11 -0
- package/src/inspect/inspect-material.docs.md +23 -0
- package/src/inspect/mesh-to-wireframe.docs.md +29 -0
- package/src/inspect/normal-debug-material.docs.md +26 -0
- package/src/inspect/wireframe-material.docs.md +22 -0
- package/src/rapid-renderer.docs.md +18 -0
- package/src/uniform-pool.docs.md +60 -0
- package/src/utils/canvas-mouse-tracker.docs.md +13 -0
- package/src/utils/canvas-resolution.docs.md +13 -0
- package/src/utils/frame-clock.docs.md +14 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Mesh
|
|
2
|
+
|
|
3
|
+
`Mesh` is a pure geometry value for draw code. It owns a vertex buffer, a vertex count, a vertex
|
|
4
|
+
attribute description, and a bounding box. It does not store transforms or scene hierarchy data.
|
|
5
|
+
|
|
6
|
+
## `Mesh.box({ device, size })`
|
|
7
|
+
|
|
8
|
+
`Mesh.box({ device })` returns a unit cube with face normals suitable for flat-shaded lighting. The
|
|
9
|
+
default size is `1`, so the bounding box spans `[-0.5, -0.5, -0.5]` to `[0.5, 0.5, 0.5]`.
|
|
10
|
+
|
|
11
|
+
Pass `size` to build a cube with a different edge length:
|
|
12
|
+
|
|
13
|
+
```ts
|
|
14
|
+
const unit = Mesh.box({ device });
|
|
15
|
+
const large = Mesh.box({ device, size: 2 });
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
The vertex layout is interleaved as `[position, normal]` with two `vec3<f32>` attributes:
|
|
19
|
+
|
|
20
|
+
- stride: 24 bytes
|
|
21
|
+
- position: offset 0, format `float32x3`
|
|
22
|
+
- normal: offset 12, format `float32x3`
|
|
23
|
+
|
|
24
|
+
The cube uses 36 vertices: six faces, two triangles per face, and three vertices per triangle. Faces
|
|
25
|
+
do not share vertices, so each face has one constant normal.
|
|
26
|
+
|
|
27
|
+
Meshes are cached per device and per size. Repeating `Mesh.box({ device, size: 1 })` returns the same
|
|
28
|
+
mesh instance and reuses one GPU vertex buffer for that device.
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# orthographicCamera
|
|
2
|
+
|
|
3
|
+
Creates a pure camera value for orthographic projection.
|
|
4
|
+
|
|
5
|
+
Pass the left, right, bottom, top, near, and far planes, plus a world-space `position` and `target`. The optional `up` vector defaults to `[0, 1, 0]`.
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
import { orthographicCamera } from "@vgpu/render";
|
|
9
|
+
|
|
10
|
+
const camera = orthographicCamera({
|
|
11
|
+
left: -1,
|
|
12
|
+
right: 1,
|
|
13
|
+
bottom: -1,
|
|
14
|
+
top: 1,
|
|
15
|
+
near: 0.1,
|
|
16
|
+
far: 100,
|
|
17
|
+
position: new Float32Array([0, 0, 5]),
|
|
18
|
+
target: new Float32Array([0, 0, 0]),
|
|
19
|
+
});
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
The matrix is computed once as projection times view and stored on `camera.viewProjectionMatrix`.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# perspectiveCamera
|
|
2
|
+
|
|
3
|
+
Creates a pure camera value for perspective projection.
|
|
4
|
+
|
|
5
|
+
Pass a vertical field of view in radians, aspect ratio, near and far planes, and a world-space `position` and `target`. The optional `up` vector defaults to `[0, 1, 0]`.
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
import { degToRad, perspectiveCamera } from "@vgpu/render";
|
|
9
|
+
|
|
10
|
+
const camera = perspectiveCamera({
|
|
11
|
+
fovYRadians: degToRad(45),
|
|
12
|
+
aspect: canvas.width / canvas.height,
|
|
13
|
+
near: 0.1,
|
|
14
|
+
far: 100,
|
|
15
|
+
position: new Float32Array([0, 0, 5]),
|
|
16
|
+
target: new Float32Array([0, 0, 0]),
|
|
17
|
+
});
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
The matrix is computed once as projection times view and stored on `camera.viewProjectionMatrix`.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# srgb
|
|
2
|
+
|
|
3
|
+
Converts colors from sRGB into linear RGB.
|
|
4
|
+
|
|
5
|
+
The input is sRGB: the way humans, design tools, and hex color pickers usually describe colors. The output is linear RGB in the `0..1` range, which is the color space shaders need for lighting math.
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
const baseColor = srgb(0xcc8844);
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
You can pass a packed hex value such as `0xff6600`, or a three-component sRGB tuple such as `[0.5, 0.5, 0.5]`.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# InspectMaterial
|
|
2
|
+
|
|
3
|
+
`InspectMaterial` is the low-level material shape used by the inspect sub-export.
|
|
4
|
+
It contains a pipeline, a group-0 bind group layout, and a typed uniform writer.
|
|
5
|
+
|
|
6
|
+
```ts
|
|
7
|
+
const uniforms = device.createBuffer({
|
|
8
|
+
size: material.uniformByteSize,
|
|
9
|
+
usage: ["uniform", "copy_dst"],
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
material.writeUniforms(uniforms.gpu, 0, {
|
|
13
|
+
viewProjectionMatrix: camera.viewProjectionMatrix,
|
|
14
|
+
modelMatrix,
|
|
15
|
+
});
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
`writeUniforms` writes the shared inspect matrices into the buffer. This keeps
|
|
19
|
+
inspect materials independent from application materials used by `RapidRenderer`.
|
|
20
|
+
|
|
21
|
+
`InspectMaterialUniformParams` includes `viewProjectionMatrix` and `modelMatrix`.
|
|
22
|
+
Future inspect materials should extend this interface explicitly if they need
|
|
23
|
+
additional uniform inputs.
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# meshToWireframe
|
|
2
|
+
|
|
3
|
+
`meshToWireframe(mesh, device)` converts a readable triangle-list `Mesh` into a
|
|
4
|
+
line-list index buffer with duplicate edges removed by endpoint position.
|
|
5
|
+
|
|
6
|
+
```ts
|
|
7
|
+
import { meshToWireframe } from "@vgpu/render/inspect";
|
|
8
|
+
|
|
9
|
+
const wireframe = await meshToWireframe(readableMesh, device);
|
|
10
|
+
|
|
11
|
+
// wireframe.vertexBuffer is readableMesh.vertexBuffer
|
|
12
|
+
// wireframe.indexBuffer contains two indices per line segment
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
The source mesh's vertex buffer must be created with `GPUBufferUsage.COPY_SRC`
|
|
16
|
+
so `meshToWireframe` can read back vertex positions. If the buffer is not
|
|
17
|
+
readable, the function throws `VGPU-CORE-INVALID-USAGE`; `Mesh.box` currently
|
|
18
|
+
does not satisfy this contract.
|
|
19
|
+
|
|
20
|
+
Endpoints are quantized to a `1e-6` grid before comparison. Meshes with distinct
|
|
21
|
+
features below that scale may have edges incorrectly merged, so author debug
|
|
22
|
+
geometry at a larger scale or use a precomputed wireframe for tiny details.
|
|
23
|
+
|
|
24
|
+
Coplanar triangle diagonals are omitted by comparing triangle face normals, so a
|
|
25
|
+
readable unit-box triangle list produces 12 line segments and 24 indices.
|
|
26
|
+
|
|
27
|
+
The returned `indexBuffer` is a raw `GPUBuffer`. Callers own its lifetime and
|
|
28
|
+
should call `indexBuffer.destroy()` when done, or rely on `device.destroy()` to
|
|
29
|
+
clean up at teardown.
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# normalDebugMaterial
|
|
2
|
+
|
|
3
|
+
Renders each fragment colored by its surface normal, which is useful for
|
|
4
|
+
verifying mesh normals visually during development.
|
|
5
|
+
|
|
6
|
+
```ts
|
|
7
|
+
import { Mesh } from "@vgpu/render";
|
|
8
|
+
import { normalDebugMaterial } from "@vgpu/render/inspect";
|
|
9
|
+
|
|
10
|
+
const mesh = Mesh.box({ device });
|
|
11
|
+
const material = normalDebugMaterial({ device });
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Each fragment outputs `(normal + 1) / 2` as RGB, mapping the unit-cube normal
|
|
15
|
+
range `[-1, +1]³` to `[0, 1]³`. A face whose normal points along +X reads pure
|
|
16
|
+
red; +Y reads pure green; +Z reads pure blue. Reverse directions read cyan,
|
|
17
|
+
magenta, and yellow.
|
|
18
|
+
|
|
19
|
+
The pipeline uses `triangle-list` topology with depth testing and back-face
|
|
20
|
+
culling. Default `targetFormat` is `'bgra8unorm-srgb'`; use
|
|
21
|
+
`'rgba8unorm-srgb'` on platforms that require it.
|
|
22
|
+
|
|
23
|
+
Normals are passed through in object space. Applying a rotation in `modelMatrix`
|
|
24
|
+
rotates the visualized colors with the geometry, which is the intended behavior
|
|
25
|
+
for this inspector. A normal matrix is not applied; this is a development
|
|
26
|
+
visualization, not a lighting pass.
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# wireframeMaterial
|
|
2
|
+
|
|
3
|
+
`wireframeMaterial` renders a mesh as line segments, which is useful for
|
|
4
|
+
visualizing geometry edges during development.
|
|
5
|
+
|
|
6
|
+
```ts
|
|
7
|
+
import { meshToWireframe, wireframeMaterial } from "@vgpu/render/inspect";
|
|
8
|
+
|
|
9
|
+
const wireframe = await meshToWireframe(readableMesh, device);
|
|
10
|
+
const material = wireframeMaterial({ device, color: [1, 1, 1] });
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
The pipeline uses `line-list` topology with depth testing on and no back-face
|
|
14
|
+
culling. It expects the same interleaved position and normal vertex layout as the
|
|
15
|
+
source mesh passed to `meshToWireframe`.
|
|
16
|
+
|
|
17
|
+
`color` defaults to `[1, 1, 1]` in linear RGB. `targetFormat` defaults to
|
|
18
|
+
`'bgra8unorm-srgb'`; use `'rgba8unorm-srgb'` on platforms that require it.
|
|
19
|
+
|
|
20
|
+
The returned `InspectMaterial` is for low-level draws. Pair it with
|
|
21
|
+
`meshToWireframe`, bind a uniform buffer at group 0, then issue an indexed
|
|
22
|
+
line-list draw.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# RapidRenderer
|
|
2
|
+
|
|
3
|
+
`RapidRenderer` submits one draw to a target view. The renderer binds a material,
|
|
4
|
+
optionally binds a mesh, then draws either `vertexCount` or `mesh.vertexCount`.
|
|
5
|
+
|
|
6
|
+
```ts
|
|
7
|
+
material.writeUniforms({ viewProjection, model, cameraPosition, light });
|
|
8
|
+
await renderer.draw({ material, mesh, target, depthTarget });
|
|
9
|
+
await renderer.draw({ material, pipeline, target, vertexCount: 3 });
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
`material` is required. `pipeline` is an optional override; otherwise the renderer
|
|
13
|
+
uses `material.pipeline`. Call `material.writeUniforms()` before `draw()` when the
|
|
14
|
+
material has uniforms. The renderer does not write camera, transform, light, or
|
|
15
|
+
material parameters.
|
|
16
|
+
|
|
17
|
+
`clearValue` defaults to opaque black. `depthTarget` is optional. `renderer.gpu`
|
|
18
|
+
returns the raw `GPUDevice`. `draw()` resolves after command submission.
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# UniformPool
|
|
2
|
+
|
|
3
|
+
`UniformPool` stages per-draw uniform bytes in CPU memory and uploads them to a
|
|
4
|
+
WebGPU uniform buffer at the frame boundary. Each `push()` returns the dynamic
|
|
5
|
+
offset, in bytes, to pass when binding the slot for a draw.
|
|
6
|
+
|
|
7
|
+
## Slots
|
|
8
|
+
|
|
9
|
+
`pool.alloc(layout)` returns a `UniformSlot<T>` with:
|
|
10
|
+
|
|
11
|
+
- `slot.gpu`: the underlying `GPUBuffer` used by the pool.
|
|
12
|
+
- `slot.bindGroup`: a real `GPUBindGroup` with a dynamic uniform-buffer binding.
|
|
13
|
+
- `slot.bindGroupLayout`: a real `GPUBindGroupLayout` whose binding uses
|
|
14
|
+
`hasDynamicOffset: true`.
|
|
15
|
+
- `slot.stride`: `layout.size` padded up to the device's uniform-buffer offset
|
|
16
|
+
alignment.
|
|
17
|
+
|
|
18
|
+
All slots allocated by one pool share the same backing `GPUBuffer`. Each slot
|
|
19
|
+
has its own bind group so callers can bind the slot once and vary only the
|
|
20
|
+
dynamic offset returned by `push()` or `pushBytes()`.
|
|
21
|
+
|
|
22
|
+
## Pipeline layout sharing
|
|
23
|
+
|
|
24
|
+
A layout may provide a pre-built bind group layout:
|
|
25
|
+
|
|
26
|
+
```ts
|
|
27
|
+
const slot = pool.alloc({
|
|
28
|
+
size,
|
|
29
|
+
bindGroupLayout: material.bindGroupLayout,
|
|
30
|
+
encode(value, dst, byteOffset) {
|
|
31
|
+
// write uniform bytes
|
|
32
|
+
},
|
|
33
|
+
});
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
When `bindGroupLayout` is provided, the slot reuses it instead of creating a new
|
|
37
|
+
layout. Use this when a pipeline already owns the bind group layout that will
|
|
38
|
+
consume the slot's bind group.
|
|
39
|
+
|
|
40
|
+
## Frame uploads
|
|
41
|
+
|
|
42
|
+
`push(value)` and `pushBytes(bytes)` write into the pool's CPU mirror only. They
|
|
43
|
+
do not call WebGPU immediately. `endFrame()` uploads pending bytes with
|
|
44
|
+
`device.gpu.queue.writeBuffer(pool.gpu, 0, pool.cpuMirror, 0, pool.usedBytes)`.
|
|
45
|
+
|
|
46
|
+
Calling `endFrame()` on a clean pool is a no-op. If more values are pushed after
|
|
47
|
+
`endFrame()`, a later `endFrame()` uploads the updated CPU mirror again.
|
|
48
|
+
|
|
49
|
+
## Submit readiness
|
|
50
|
+
|
|
51
|
+
Call `endFrame()` before submitting command buffers that read data from the
|
|
52
|
+
pool. `assertReadyForSubmit(opName)` checks this invariant. If there are pending
|
|
53
|
+
pushes that have not been uploaded, it throws `VGPU-CORE-INVALID-USAGE` with:
|
|
54
|
+
|
|
55
|
+
```txt
|
|
56
|
+
UniformPool has unflushed pushes; call endFrame() before submitting.
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Renderers should call `assertReadyForSubmit()` immediately before
|
|
60
|
+
`queue.submit()`.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# canvasMouseTracker
|
|
2
|
+
|
|
3
|
+
Tracks the latest pointer position over a canvas. Use it when a render loop needs the mouse position without storing event handlers in your app code.
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
const mouse = canvasMouseTracker({ canvas, normalize: true });
|
|
7
|
+
function draw() {
|
|
8
|
+
const [x, y] = mouse.position;
|
|
9
|
+
material.writeUniforms({ mouse: [x, y] });
|
|
10
|
+
}
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Call `dispose()` when the canvas is removed.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# canvasResolution
|
|
2
|
+
|
|
3
|
+
Reads the drawing size of a canvas. Use it when shaders or render targets need the current canvas width and height.
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
const size = canvasResolution(canvas, { observe: true });
|
|
7
|
+
function draw() {
|
|
8
|
+
material.writeUniforms({ resolution: [size.width, size.height] });
|
|
9
|
+
renderer.draw({ target, material, mesh });
|
|
10
|
+
}
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Call `dispose()` to stop observing size changes.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# frameClock
|
|
2
|
+
|
|
3
|
+
Measures elapsed time and frame delta in seconds. Use it in animation loops that need stable time values and pause support.
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
const clock = frameClock();
|
|
7
|
+
function frame() {
|
|
8
|
+
const time = clock.now();
|
|
9
|
+
const dt = clock.delta();
|
|
10
|
+
update(time, dt);
|
|
11
|
+
}
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Use `pause()`, `resume()`, and `reset()` to control the clock.
|