@luma.gl/engine 10.0.0-beta.1 → 10.0.0-beta.2
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/dist/animation/deform-positions.d.ts +1 -1
- package/dist/animation/deform-positions.d.ts.map +1 -1
- package/dist/animation/skin.cjs +4 -4
- package/dist/animation/skin.d.ts +1 -1
- package/dist/animation/skin.d.ts.map +1 -1
- package/dist/animation/skin.js +1 -1
- package/dist/animation/skin.js.map +1 -1
- package/dist/animation/texture-transform.cjs +7 -7
- package/dist/animation/texture-transform.js +1 -1
- package/dist/animation/texture-transform.js.map +1 -1
- package/dist/arrow/arrow-mesh-types.d.ts +1 -1
- package/dist/arrow/arrow-mesh-types.d.ts.map +1 -1
- package/dist/arrow/index.cjs.map +2 -2
- package/dist/arrow/renderers/path/conversion/arrow-path-storage-gpu-vectors.cjs +2 -2
- package/dist/arrow/renderers/path/conversion/arrow-path-storage-gpu-vectors.d.ts +1 -1
- package/dist/arrow/renderers/path/conversion/arrow-path-storage-gpu-vectors.js +1 -1
- package/dist/arrow/renderers/splats/conversion/make-gpu-splat-data-from-gltf.cjs +2 -2
- package/dist/arrow/renderers/splats/conversion/make-gpu-splat-data-from-gltf.js +1 -1
- package/dist/arrow/renderers/splats/conversion/make-gpu-splat-data-from-gltf.js.map +1 -1
- package/dist/audio/audio-controller.cjs +6 -6
- package/dist/audio/audio-controller.d.ts +1 -1
- package/dist/audio/audio-controller.d.ts.map +1 -1
- package/dist/audio/audio-controller.js +1 -1
- package/dist/audio/audio-controller.js.map +1 -1
- package/dist/audio/audio-environment.cjs +6 -6
- package/dist/audio/audio-environment.d.ts +1 -1
- package/dist/audio/audio-environment.d.ts.map +1 -1
- package/dist/audio/audio-environment.js +1 -1
- package/dist/audio/audio-environment.js.map +1 -1
- package/dist/compute/computation.d.ts +1 -1
- package/dist/compute/computation.d.ts.map +1 -1
- package/dist/debug/pixel-data-utils.d.ts +1 -1
- package/dist/debug/pixel-data-utils.d.ts.map +1 -1
- package/dist/dist.dev.js +239 -228
- package/dist/dist.min.js +59 -59
- package/dist/effects/index.cjs.map +1 -1
- package/dist/effects/passes/screen-space/camera-reprojection-temporal-antialiasing.d.ts +1 -1
- package/dist/effects/passes/screen-space/camera-reprojection-temporal-antialiasing.d.ts.map +1 -1
- package/dist/effects/passes/screen-space/clustered-volumetric-lighting.d.ts +1 -1
- package/dist/effects/passes/screen-space/clustered-volumetric-lighting.d.ts.map +1 -1
- package/dist/effects/passes/screen-space/gtao.cjs +4 -4
- package/dist/effects/passes/screen-space/gtao.d.ts +1 -1
- package/dist/effects/passes/screen-space/gtao.d.ts.map +1 -1
- package/dist/effects/passes/screen-space/gtao.js +1 -1
- package/dist/effects/passes/screen-space/gtao.js.map +1 -1
- package/dist/effects/passes/screen-space/height-fog.d.ts +1 -1
- package/dist/effects/passes/screen-space/height-fog.d.ts.map +1 -1
- package/dist/effects/passes/screen-space/screen-space-global-illumination.d.ts +1 -1
- package/dist/effects/passes/screen-space/screen-space-global-illumination.d.ts.map +1 -1
- package/dist/effects/passes/screen-space/screen-space-reflections.d.ts +1 -1
- package/dist/effects/passes/screen-space/screen-space-reflections.d.ts.map +1 -1
- package/dist/effects/passes/screen-space/ssr-camera-temporal.d.ts +1 -1
- package/dist/effects/passes/screen-space/ssr-camera-temporal.d.ts.map +1 -1
- package/dist/experimental/controls/index.cjs +0 -3
- package/dist/experimental/controls/index.cjs.map +2 -2
- package/dist/experimental/controls/index.d.ts +0 -2
- package/dist/experimental/controls/index.d.ts.map +1 -1
- package/dist/experimental/controls/index.js +0 -1
- package/dist/experimental/controls/index.js.map +1 -1
- package/dist/experimental/webxr/webxr-input.d.ts +1 -1
- package/dist/experimental/webxr/webxr-input.d.ts.map +1 -1
- package/dist/experimental-controls.cjs +21 -0
- package/dist/experimental-controls.d.ts +2 -0
- package/dist/experimental-controls.d.ts.map +1 -0
- package/dist/experimental-controls.js +5 -0
- package/dist/experimental-controls.js.map +1 -0
- package/dist/experimental-materials.cjs +21 -0
- package/dist/experimental-materials.d.ts +2 -0
- package/dist/experimental-materials.d.ts.map +1 -0
- package/dist/experimental-materials.js +5 -0
- package/dist/experimental-materials.js.map +1 -0
- package/dist/experimental-textures.cjs +21 -0
- package/dist/experimental-textures.d.ts +2 -0
- package/dist/experimental-textures.d.ts.map +1 -0
- package/dist/experimental-textures.js +5 -0
- package/dist/experimental-textures.js.map +1 -0
- package/dist/{experimental/controls/orbit-controls.cjs → experimental-webxr.cjs} +5 -11
- package/dist/experimental-webxr.d.ts +2 -0
- package/dist/experimental-webxr.d.ts.map +1 -0
- package/dist/experimental-webxr.js +5 -0
- package/dist/experimental-webxr.js.map +1 -0
- package/dist/geometry/edge-geometry.d.ts +1 -1
- package/dist/geometry/edge-geometry.d.ts.map +1 -1
- package/dist/geometry/geometry-primitives.cjs +18 -17
- package/dist/geometry/geometry-primitives.d.ts +2 -2
- package/dist/geometry/geometry-primitives.d.ts.map +1 -1
- package/dist/geometry/geometry-primitives.js +3 -2
- package/dist/geometry/geometry-primitives.js.map +1 -1
- package/dist/geometry/geometry-table.d.ts +1 -1
- package/dist/geometry/geometry-table.d.ts.map +1 -1
- package/dist/geometry/geometry-utils.cjs +6 -6
- package/dist/geometry/geometry-utils.d.ts +2 -2
- package/dist/geometry/geometry-utils.d.ts.map +1 -1
- package/dist/geometry/geometry-utils.js +1 -1
- package/dist/geometry/geometry-utils.js.map +1 -1
- package/dist/geometry/geometry.cjs +2 -2
- package/dist/geometry/geometry.d.ts +4 -3
- package/dist/geometry/geometry.d.ts.map +1 -1
- package/dist/geometry/geometry.js +1 -1
- package/dist/geometry/geometry.js.map +1 -1
- package/dist/geometry/gpu-geometry.d.ts +1 -1
- package/dist/geometry/gpu-geometry.d.ts.map +1 -1
- package/dist/geometry/gpu-vector-geometry-adapter.d.ts +1 -1
- package/dist/geometry/gpu-vector-geometry-adapter.d.ts.map +1 -1
- package/dist/geometry/ring-geometry.cjs +6 -6
- package/dist/geometry/ring-geometry.d.ts +1 -1
- package/dist/geometry/ring-geometry.d.ts.map +1 -1
- package/dist/geometry/ring-geometry.js +2 -2
- package/dist/geometry/ring-geometry.js.map +1 -1
- package/dist/gltf/gltf/create-gltf-model.d.ts +1 -1
- package/dist/gltf/gltf/create-gltf-model.d.ts.map +1 -1
- package/dist/gltf/gltf/gltf-animated-crowd.d.ts +2 -1
- package/dist/gltf/gltf/gltf-animated-crowd.d.ts.map +1 -1
- package/dist/gltf/gltf/gltf-animated-crowd.js.map +1 -1
- package/dist/gltf/gltf/gltf-instancing.cjs +2 -2
- package/dist/gltf/gltf/gltf-instancing.d.ts +1 -1
- package/dist/gltf/gltf/gltf-instancing.d.ts.map +1 -1
- package/dist/gltf/gltf/gltf-instancing.js +1 -1
- package/dist/gltf/gltf/gltf-instancing.js.map +1 -1
- package/dist/gltf/gltf/gltf-lightmap.cjs +2 -2
- package/dist/gltf/gltf/gltf-lightmap.d.ts +1 -1
- package/dist/gltf/gltf/gltf-lightmap.d.ts.map +1 -1
- package/dist/gltf/gltf/gltf-lightmap.js +1 -1
- package/dist/gltf/gltf/gltf-lightmap.js.map +1 -1
- package/dist/gltf/index.cjs.map +2 -2
- package/dist/gltf/parsers/parse-gltf-lights.cjs +5 -5
- package/dist/gltf/parsers/parse-gltf-lights.js +1 -1
- package/dist/gltf/parsers/parse-gltf-lights.js.map +1 -1
- package/dist/gltf/parsers/parse-pbr-material.cjs +27 -27
- package/dist/gltf/parsers/parse-pbr-material.js +1 -1
- package/dist/gltf/parsers/parse-pbr-material.js.map +1 -1
- package/dist/gltf/physics/export-state.cjs +8 -8
- package/dist/gltf/physics/export-state.js +1 -1
- package/dist/gltf/physics/export-state.js.map +1 -1
- package/dist/gltf/physics/index.cjs.map +2 -2
- package/dist/gltf/physics/mesh-snapshot.cjs +3 -3
- package/dist/gltf/physics/mesh-snapshot.js +1 -1
- package/dist/gltf/physics/mesh-snapshot.js.map +1 -1
- package/dist/gltf/physics/node-collision-geometry.cjs +3 -3
- package/dist/gltf/physics/node-collision-geometry.js +1 -1
- package/dist/gltf/physics/node-collision-geometry.js.map +1 -1
- package/dist/gltf/physics/parse-gltf-physics.cjs +10 -10
- package/dist/gltf/physics/parse-gltf-physics.js +1 -1
- package/dist/gltf/physics/parse-gltf-physics.js.map +1 -1
- package/dist/gltf/physics/parse-physics-joints.cjs +3 -3
- package/dist/gltf/physics/parse-physics-joints.d.ts +1 -1
- package/dist/gltf/physics/parse-physics-joints.d.ts.map +1 -1
- package/dist/gltf/physics/parse-physics-joints.js +1 -1
- package/dist/gltf/physics/parse-physics-joints.js.map +1 -1
- package/dist/gltf/physics/property-bindings.cjs +4 -4
- package/dist/gltf/physics/property-bindings.js +1 -1
- package/dist/gltf/physics/property-bindings.js.map +1 -1
- package/dist/graph/models/index.cjs.map +2 -2
- package/dist/graph/models/path/path-storage-model.cjs +8 -8
- package/dist/graph/models/path/path-storage-model.d.ts +1 -1
- package/dist/graph/models/path/path-storage-model.js +2 -2
- package/dist/graph/models/polygon/polygon-attribute-model.cjs +4 -4
- package/dist/graph/models/polygon/polygon-attribute-model.d.ts +1 -1
- package/dist/graph/models/polygon/polygon-attribute-model.js +1 -1
- package/dist/graph/models/polygon/polygon-shaders.d.ts +1 -1
- package/dist/graph/models/polygon/polygon-storage-model.cjs +4 -4
- package/dist/graph/models/polygon/polygon-storage-model.d.ts +1 -1
- package/dist/graph/models/polygon/polygon-storage-model.js +1 -1
- package/dist/graph/physics/index.cjs.map +2 -2
- package/dist/graph/physics/index.d.ts +1 -1
- package/dist/graph/physics/index.d.ts.map +1 -1
- package/dist/graph/physics/physics-controller-geometry.cjs +8 -8
- package/dist/graph/physics/physics-controller-geometry.js +2 -2
- package/dist/graph/physics/physics-controller-geometry.js.map +1 -1
- package/dist/graph/physics/physics-controller.cjs +95 -31
- package/dist/graph/physics/physics-controller.d.ts +36 -9
- package/dist/graph/physics/physics-controller.d.ts.map +1 -1
- package/dist/graph/physics/physics-controller.js +96 -31
- package/dist/graph/physics/physics-controller.js.map +1 -1
- package/dist/graph/physics/physics-scenegraph.cjs +4 -4
- package/dist/graph/physics/physics-scenegraph.d.ts +1 -1
- package/dist/graph/physics/physics-scenegraph.d.ts.map +1 -1
- package/dist/graph/physics/physics-scenegraph.js +1 -1
- package/dist/graph/physics/physics-scenegraph.js.map +1 -1
- package/dist/graph/physics/scenegraph-instance.cjs +14 -7
- package/dist/graph/physics/scenegraph-instance.d.ts.map +1 -1
- package/dist/graph/physics/scenegraph-instance.js +15 -7
- package/dist/graph/physics/scenegraph-instance.js.map +1 -1
- package/dist/graph/physics/scenegraph-motion.cjs +7 -7
- package/dist/graph/physics/scenegraph-motion.d.ts +1 -1
- package/dist/graph/physics/scenegraph-motion.d.ts.map +1 -1
- package/dist/graph/physics/scenegraph-motion.js +1 -1
- package/dist/graph/physics/scenegraph-motion.js.map +1 -1
- package/dist/graph/physics/scenegraph-properties.cjs +3 -3
- package/dist/graph/physics/scenegraph-properties.js +1 -1
- package/dist/graph/physics/scenegraph-properties.js.map +1 -1
- package/dist/graph/physics/scenegraph-publication.cjs +5 -5
- package/dist/graph/physics/scenegraph-publication.d.ts +1 -1
- package/dist/graph/physics/scenegraph-publication.d.ts.map +1 -1
- package/dist/graph/physics/scenegraph-publication.js +1 -1
- package/dist/graph/physics/scenegraph-publication.js.map +1 -1
- package/dist/graph/tables/index.cjs.map +2 -2
- package/dist/index.cjs.map +2 -2
- package/dist/lighting/ambient-occlusion-pass.cjs +3 -3
- package/dist/lighting/ambient-occlusion-pass.d.ts +2 -1
- package/dist/lighting/ambient-occlusion-pass.d.ts.map +1 -1
- package/dist/lighting/ambient-occlusion-pass.js +1 -1
- package/dist/lighting/ambient-occlusion-pass.js.map +1 -1
- package/dist/lighting/clustered-light-grid.d.ts +1 -1
- package/dist/lighting/clustered-light-grid.d.ts.map +1 -1
- package/dist/lighting/contact-shadow-pass.cjs +2 -2
- package/dist/lighting/contact-shadow-pass.d.ts +2 -1
- package/dist/lighting/contact-shadow-pass.d.ts.map +1 -1
- package/dist/lighting/contact-shadow-pass.js +1 -1
- package/dist/lighting/contact-shadow-pass.js.map +1 -1
- package/dist/lighting/index.cjs.map +2 -2
- package/dist/lighting/lightmap-atlas.cjs +6 -6
- package/dist/lighting/lightmap-atlas.d.ts +1 -1
- package/dist/lighting/lightmap-atlas.d.ts.map +1 -1
- package/dist/lighting/lightmap-atlas.js +1 -1
- package/dist/lighting/lightmap-atlas.js.map +1 -1
- package/dist/lighting/reflection-probe.cjs +4 -4
- package/dist/lighting/reflection-probe.d.ts +2 -1
- package/dist/lighting/reflection-probe.d.ts.map +1 -1
- package/dist/lighting/reflection-probe.js +1 -1
- package/dist/lighting/reflection-probe.js.map +1 -1
- package/dist/lighting/shadow-map-renderer.cjs +13 -13
- package/dist/lighting/shadow-map-renderer.d.ts +2 -2
- package/dist/lighting/shadow-map-renderer.d.ts.map +1 -1
- package/dist/lighting/shadow-map-renderer.js +1 -1
- package/dist/lighting/shadow-map-renderer.js.map +1 -1
- package/dist/model/gpu-vector-model.d.ts +1 -1
- package/dist/model/gpu-vector-model.d.ts.map +1 -1
- package/dist/model/model.d.ts +1 -1
- package/dist/model/model.d.ts.map +1 -1
- package/dist/models/light-model-utils.cjs +2 -2
- package/dist/models/light-model-utils.d.ts +1 -1
- package/dist/models/light-model-utils.d.ts.map +1 -1
- package/dist/models/light-model-utils.js +1 -1
- package/dist/models/light-model-utils.js.map +1 -1
- package/dist/modules/picking/color-picking.d.ts +1 -1
- package/dist/modules/picking/index-color-picking.d.ts +1 -1
- package/dist/modules/picking/index-picking.d.ts +1 -1
- package/dist/modules/picking/legacy-color-picking.d.ts +1 -1
- package/dist/modules/picking/picking-uniforms.d.ts +1 -1
- package/dist/modules/picking/picking-uniforms.d.ts.map +1 -1
- package/dist/modules/picking/picking.d.ts +1 -1
- package/dist/scenegraph/controllers/area-light-controller.cjs +11 -11
- package/dist/scenegraph/controllers/area-light-controller.js +1 -1
- package/dist/scenegraph/controllers/area-light-controller.js.map +1 -1
- package/dist/scenegraph/controllers/billboard-controller.cjs +28 -28
- package/dist/scenegraph/controllers/billboard-controller.d.ts +2 -1
- package/dist/scenegraph/controllers/billboard-controller.d.ts.map +1 -1
- package/dist/scenegraph/controllers/billboard-controller.js +1 -1
- package/dist/scenegraph/controllers/billboard-controller.js.map +1 -1
- package/dist/scenegraph/controllers/joint-controller.cjs +5 -5
- package/dist/scenegraph/controllers/joint-controller.js +1 -1
- package/dist/scenegraph/controllers/joint-controller.js.map +1 -1
- package/dist/scenegraph/controllers/punctual-light-controller.cjs +2 -2
- package/dist/scenegraph/controllers/punctual-light-controller.d.ts +1 -1
- package/dist/scenegraph/controllers/punctual-light-controller.d.ts.map +1 -1
- package/dist/scenegraph/controllers/punctual-light-controller.js +1 -1
- package/dist/scenegraph/controllers/punctual-light-controller.js.map +1 -1
- package/dist/scenegraph/controllers/skin-controller.cjs +2 -2
- package/dist/scenegraph/controllers/skin-controller.js +1 -1
- package/dist/scenegraph/controllers/skin-controller.js.map +1 -1
- package/dist/scenegraph/group-node.cjs +14 -14
- package/dist/scenegraph/group-node.d.ts +2 -2
- package/dist/scenegraph/group-node.d.ts.map +1 -1
- package/dist/scenegraph/group-node.js +1 -1
- package/dist/scenegraph/group-node.js.map +1 -1
- package/dist/scenegraph/model-node.d.ts +1 -1
- package/dist/scenegraph/model-node.d.ts.map +1 -1
- package/dist/scenegraph/physics-transforms.cjs +2 -2
- package/dist/scenegraph/physics-transforms.d.ts +1 -1
- package/dist/scenegraph/physics-transforms.d.ts.map +1 -1
- package/dist/scenegraph/physics-transforms.js +1 -1
- package/dist/scenegraph/physics-transforms.js.map +1 -1
- package/dist/scenegraph/scenegraph-bounds.cjs +3 -3
- package/dist/scenegraph/scenegraph-bounds.d.ts +1 -1
- package/dist/scenegraph/scenegraph-bounds.d.ts.map +1 -1
- package/dist/scenegraph/scenegraph-bounds.js +1 -1
- package/dist/scenegraph/scenegraph-bounds.js.map +1 -1
- package/dist/scenegraph/scenegraph-node.cjs +7 -7
- package/dist/scenegraph/scenegraph-node.d.ts +2 -1
- package/dist/scenegraph/scenegraph-node.d.ts.map +1 -1
- package/dist/scenegraph/scenegraph-node.js +1 -1
- package/dist/scenegraph/scenegraph-node.js.map +1 -1
- package/dist/scenegraph/transform-source.d.ts +1 -1
- package/dist/scenegraph/transform-source.d.ts.map +1 -1
- package/dist/text/text-3d/extrude.cjs +15 -15
- package/dist/text/text-3d/extrude.js +1 -1
- package/dist/text/text-3d/extrude.js.map +1 -1
- package/dist/text/text-3d/index.cjs.map +2 -2
- package/dist/text/text-3d/paths/curves.cjs +5 -5
- package/dist/text/text-3d/paths/curves.d.ts +1 -1
- package/dist/text/text-3d/paths/curves.d.ts.map +1 -1
- package/dist/text/text-3d/paths/curves.js +1 -1
- package/dist/text/text-3d/paths/curves.js.map +1 -1
- package/dist/text/text-3d/paths/path.cjs +5 -5
- package/dist/text/text-3d/paths/path.d.ts +1 -1
- package/dist/text/text-3d/paths/path.d.ts.map +1 -1
- package/dist/text/text-3d/paths/path.js +1 -1
- package/dist/text/text-3d/paths/path.js.map +1 -1
- package/dist/text/text-3d/paths/shape-path.d.ts +1 -1
- package/dist/text/text-3d/paths/shape-path.d.ts.map +1 -1
- package/dist/text/text-3d/paths/shape-utils.cjs +2 -2
- package/dist/text/text-3d/paths/shape-utils.d.ts +1 -1
- package/dist/text/text-3d/paths/shape-utils.d.ts.map +1 -1
- package/dist/text/text-3d/paths/shape-utils.js +1 -1
- package/dist/text/text-3d/paths/shape-utils.js.map +1 -1
- package/package.json +12 -12
- package/src/animation/deform-positions.ts +1 -1
- package/src/animation/skin.ts +2 -1
- package/src/animation/texture-transform.ts +1 -1
- package/src/arrow/arrow-geometry.ts +1 -1
- package/src/arrow/arrow-mesh-types.ts +1 -1
- package/src/arrow/renderers/path/conversion/arrow-path-storage-gpu-vectors.ts +1 -1
- package/src/arrow/renderers/polygon/renderers/arrow-polygon-renderer.ts +1 -1
- package/src/arrow/renderers/splats/conversion/make-gpu-splat-data-from-gltf.ts +1 -1
- package/src/audio/audio-controller.ts +1 -1
- package/src/audio/audio-environment.ts +1 -1
- package/src/compute/computation.ts +1 -1
- package/src/debug/pixel-data-utils.ts +1 -1
- package/src/effects/passes/screen-space/camera-reprojection-temporal-antialiasing.ts +1 -1
- package/src/effects/passes/screen-space/clustered-volumetric-lighting.ts +1 -1
- package/src/effects/passes/screen-space/gtao.ts +1 -1
- package/src/effects/passes/screen-space/height-fog.ts +1 -1
- package/src/effects/passes/screen-space/screen-space-global-illumination.ts +1 -1
- package/src/effects/passes/screen-space/screen-space-reflections.ts +1 -1
- package/src/effects/passes/screen-space/ssr-camera-temporal.ts +1 -1
- package/src/experimental/controls/index.ts +0 -2
- package/src/experimental/webxr/webxr-input.ts +1 -1
- package/{dist/experimental/controls/orbit-controls.js → src/experimental-controls.ts} +2 -2
- package/src/experimental-materials.ts +5 -0
- package/src/experimental-textures.ts +5 -0
- package/src/experimental-webxr.ts +5 -0
- package/src/geometry/edge-geometry.ts +2 -2
- package/src/geometry/geometry-primitives.ts +6 -3
- package/src/geometry/geometry-table.ts +1 -1
- package/src/geometry/geometry-utils.ts +3 -3
- package/src/geometry/geometry.ts +7 -7
- package/src/geometry/gpu-geometry.ts +1 -1
- package/src/geometry/gpu-vector-geometry-adapter.ts +1 -1
- package/src/geometry/ring-geometry.ts +2 -2
- package/src/gltf/gltf/create-gltf-model.ts +1 -1
- package/src/gltf/gltf/gltf-animated-crowd.ts +2 -1
- package/src/gltf/gltf/gltf-instancing.ts +1 -1
- package/src/gltf/gltf/gltf-lightmap.ts +1 -1
- package/src/gltf/parsers/parse-gltf-lights.ts +1 -1
- package/src/gltf/parsers/parse-pbr-material.ts +1 -1
- package/src/gltf/physics/export-state.ts +1 -1
- package/src/gltf/physics/mesh-snapshot.ts +1 -1
- package/src/gltf/physics/node-collision-geometry.ts +1 -1
- package/src/gltf/physics/parse-gltf-physics.ts +1 -1
- package/src/gltf/physics/parse-physics-joints.ts +1 -1
- package/src/gltf/physics/property-bindings.ts +1 -1
- package/src/graph/models/path/path-storage-model.ts +3 -3
- package/src/graph/models/polygon/polygon-attribute-model.ts +1 -1
- package/src/graph/models/polygon/polygon-storage-model.ts +1 -1
- package/src/graph/physics/index.ts +1 -0
- package/src/graph/physics/physics-controller-geometry.ts +2 -2
- package/src/graph/physics/physics-controller.ts +139 -40
- package/src/graph/physics/physics-scenegraph.ts +1 -1
- package/src/graph/physics/scenegraph-instance.ts +25 -9
- package/src/graph/physics/scenegraph-motion.ts +1 -1
- package/src/graph/physics/scenegraph-properties.ts +1 -1
- package/src/graph/physics/scenegraph-publication.ts +1 -1
- package/src/lighting/ambient-occlusion-pass.ts +2 -1
- package/src/lighting/clustered-light-grid.ts +1 -1
- package/src/lighting/contact-shadow-pass.ts +2 -1
- package/src/lighting/lightmap-atlas.ts +1 -1
- package/src/lighting/reflection-probe.ts +2 -1
- package/src/lighting/shadow-map-renderer.ts +2 -2
- package/src/model/gpu-vector-model.ts +1 -1
- package/src/model/model.ts +1 -1
- package/src/models/light-model-utils.ts +2 -1
- package/src/modules/picking/legacy-picking-manager.ts +1 -1
- package/src/modules/picking/picking-uniforms.ts +1 -1
- package/src/scenegraph/controllers/area-light-controller.ts +1 -1
- package/src/scenegraph/controllers/billboard-controller.ts +2 -1
- package/src/scenegraph/controllers/joint-controller.ts +1 -1
- package/src/scenegraph/controllers/punctual-light-controller.ts +1 -1
- package/src/scenegraph/controllers/skin-controller.ts +1 -1
- package/src/scenegraph/group-node.ts +2 -2
- package/src/scenegraph/model-node.ts +1 -1
- package/src/scenegraph/physics-transforms.ts +1 -1
- package/src/scenegraph/scenegraph-bounds.ts +2 -2
- package/src/scenegraph/scenegraph-node.ts +2 -1
- package/src/scenegraph/transform-source.ts +1 -1
- package/src/text/text-3d/extrude.ts +1 -1
- package/src/text/text-3d/font.ts +1 -1
- package/src/text/text-3d/paths/curves.ts +1 -1
- package/src/text/text-3d/paths/path.ts +1 -1
- package/src/text/text-3d/paths/shape-path.ts +1 -1
- package/src/text/text-3d/paths/shape-utils.ts +2 -2
- package/dist/experimental/controls/orbit-controls.d.ts +0 -3
- package/dist/experimental/controls/orbit-controls.d.ts.map +0 -1
- package/dist/experimental/controls/orbit-controls.js.map +0 -1
- package/src/experimental/controls/orbit-controls.ts +0 -6
package/dist/dist.dev.js
CHANGED
|
@@ -657,6 +657,18 @@ var __exports__ = (() => {
|
|
|
657
657
|
}
|
|
658
658
|
};
|
|
659
659
|
|
|
660
|
+
// ../../node_modules/@math.gl/core/dist/types/typed-array-brand.js
|
|
661
|
+
var typedArrayTagGetter = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Uint8Array.prototype), Symbol.toStringTag).get;
|
|
662
|
+
function getTypedArrayName(value) {
|
|
663
|
+
return ArrayBuffer.isView(value) ? typedArrayTagGetter.call(value) : void 0;
|
|
664
|
+
}
|
|
665
|
+
|
|
666
|
+
// ../../node_modules/@math.gl/core/dist/types/is-array.js
|
|
667
|
+
function isTypedArray(value) {
|
|
668
|
+
const name = getTypedArrayName(value);
|
|
669
|
+
return name !== void 0 && name !== "BigInt64Array" && name !== "BigUint64Array";
|
|
670
|
+
}
|
|
671
|
+
|
|
660
672
|
// ../../node_modules/@math.gl/geometry/dist/lib/geometry.js
|
|
661
673
|
var geometryId = 0;
|
|
662
674
|
var Geometry = class {
|
|
@@ -712,9 +724,6 @@ var __exports__ = (() => {
|
|
|
712
724
|
}
|
|
713
725
|
return attribute;
|
|
714
726
|
}
|
|
715
|
-
function isTypedArray(value) {
|
|
716
|
-
return ArrayBuffer.isView(value) && !(value instanceof DataView);
|
|
717
|
-
}
|
|
718
727
|
function validateIndices(indices, attributes) {
|
|
719
728
|
let maximumIndex = -1;
|
|
720
729
|
for (const index of indices.value)
|
|
@@ -3555,31 +3564,6 @@ var __exports__ = (() => {
|
|
|
3555
3564
|
}
|
|
3556
3565
|
};
|
|
3557
3566
|
|
|
3558
|
-
// ../../node_modules/@math.gl/geometry/dist/lib/geometry-utils.js
|
|
3559
|
-
function unpackIndexedGeometry(geometry) {
|
|
3560
|
-
if (!geometry.indices)
|
|
3561
|
-
return geometry;
|
|
3562
|
-
const indices = geometry.indices.value;
|
|
3563
|
-
const attributes = {};
|
|
3564
|
-
for (const [name, attribute] of Object.entries(geometry.attributes)) {
|
|
3565
|
-
if (!attribute)
|
|
3566
|
-
continue;
|
|
3567
|
-
if (attribute.constant || !attribute.size) {
|
|
3568
|
-
attributes[name] = attribute;
|
|
3569
|
-
continue;
|
|
3570
|
-
}
|
|
3571
|
-
const ArrayType = attribute.value.constructor;
|
|
3572
|
-
const value = new ArrayType(indices.length * attribute.size);
|
|
3573
|
-
for (let i = 0; i < indices.length; i++) {
|
|
3574
|
-
for (let component = 0; component < attribute.size; component++) {
|
|
3575
|
-
value[i * attribute.size + component] = attribute.value[Number(indices[i]) * attribute.size + component];
|
|
3576
|
-
}
|
|
3577
|
-
}
|
|
3578
|
-
attributes[name] = { ...attribute, value };
|
|
3579
|
-
}
|
|
3580
|
-
return { attributes };
|
|
3581
|
-
}
|
|
3582
|
-
|
|
3583
3567
|
// ../../node_modules/@math.gl/geometry/dist/geometries/geometry-helpers.js
|
|
3584
3568
|
function assertPositive(value, name) {
|
|
3585
3569
|
if (!Number.isFinite(value) || value <= 0)
|
|
@@ -4194,6 +4178,33 @@ var __exports__ = (() => {
|
|
|
4194
4178
|
|
|
4195
4179
|
// src/geometry/geometry-utils.ts
|
|
4196
4180
|
var import_core3 = __toESM(require_core(), 1);
|
|
4181
|
+
|
|
4182
|
+
// ../../node_modules/@math.gl/geometry/dist/lib/geometry-utils.js
|
|
4183
|
+
function unpackIndexedGeometry(geometry) {
|
|
4184
|
+
if (!geometry.indices)
|
|
4185
|
+
return geometry;
|
|
4186
|
+
const indices = geometry.indices.value;
|
|
4187
|
+
const attributes = {};
|
|
4188
|
+
for (const [name, attribute] of Object.entries(geometry.attributes)) {
|
|
4189
|
+
if (!attribute)
|
|
4190
|
+
continue;
|
|
4191
|
+
if (attribute.constant || !attribute.size) {
|
|
4192
|
+
attributes[name] = attribute;
|
|
4193
|
+
continue;
|
|
4194
|
+
}
|
|
4195
|
+
const ArrayType = attribute.value.constructor;
|
|
4196
|
+
const value = new ArrayType(indices.length * attribute.size);
|
|
4197
|
+
for (let i = 0; i < indices.length; i++) {
|
|
4198
|
+
for (let component = 0; component < attribute.size; component++) {
|
|
4199
|
+
value[i * attribute.size + component] = attribute.value[Number(indices[i]) * attribute.size + component];
|
|
4200
|
+
}
|
|
4201
|
+
}
|
|
4202
|
+
attributes[name] = { ...attribute, value };
|
|
4203
|
+
}
|
|
4204
|
+
return { attributes };
|
|
4205
|
+
}
|
|
4206
|
+
|
|
4207
|
+
// src/geometry/geometry-utils.ts
|
|
4197
4208
|
function makeInterleavedGeometry(geometry, options = {}) {
|
|
4198
4209
|
const bufferName = options.bufferName || "geometry";
|
|
4199
4210
|
if (isInterleavedGeometry(geometry, bufferName)) {
|
|
@@ -4630,7 +4641,7 @@ var __exports__ = (() => {
|
|
|
4630
4641
|
};
|
|
4631
4642
|
|
|
4632
4643
|
// src/animation-loop/animation-loop.ts
|
|
4633
|
-
var
|
|
4644
|
+
var import_core4 = __toESM(require_core(), 1);
|
|
4634
4645
|
|
|
4635
4646
|
// src/animation-loop/request-animation-frame.ts
|
|
4636
4647
|
function requestAnimationFramePolyfill(callback) {
|
|
@@ -4900,7 +4911,7 @@ var __exports__ = (() => {
|
|
|
4900
4911
|
throw new Error("No device provided");
|
|
4901
4912
|
}
|
|
4902
4913
|
this.stats = props.stats || new Stats({ id: `animation-loop-${statIdCounter++}` });
|
|
4903
|
-
this.sharedStats =
|
|
4914
|
+
this.sharedStats = import_core4.luma.stats.get(ANIMATION_LOOP_STATS);
|
|
4904
4915
|
this.frameRate = this.stats.get("Frame Rate");
|
|
4905
4916
|
this.frameRate.setSampleSize(1);
|
|
4906
4917
|
this.cpuTime = this.stats.get("CPU Time");
|
|
@@ -5312,10 +5323,10 @@ var __exports__ = (() => {
|
|
|
5312
5323
|
};
|
|
5313
5324
|
|
|
5314
5325
|
// src/animation-loop/make-animation-loop.ts
|
|
5315
|
-
var
|
|
5326
|
+
var import_core5 = __toESM(require_core(), 1);
|
|
5316
5327
|
function makeAnimationLoop(AnimationLoopTemplateCtor, props) {
|
|
5317
5328
|
let renderLoop = null;
|
|
5318
|
-
const device = props?.device ||
|
|
5329
|
+
const device = props?.device || import_core5.luma.createDevice({
|
|
5319
5330
|
id: "animation-loop",
|
|
5320
5331
|
adapters: props?.adapters,
|
|
5321
5332
|
createCanvasContext: true
|
|
@@ -5673,7 +5684,7 @@ var __exports__ = (() => {
|
|
|
5673
5684
|
}
|
|
5674
5685
|
|
|
5675
5686
|
// src/model/gpu-vector-model.ts
|
|
5676
|
-
var
|
|
5687
|
+
var import_core13 = __toESM(require_core(), 1);
|
|
5677
5688
|
var import_shaders3 = __toESM(require_shaders(), 1);
|
|
5678
5689
|
|
|
5679
5690
|
// ../shaders/src/lib/utils/assert.ts
|
|
@@ -9358,7 +9369,7 @@ ${declarations.join("\n")}`).match(
|
|
|
9358
9369
|
};
|
|
9359
9370
|
|
|
9360
9371
|
// src/model/batch-uniform-buffer.ts
|
|
9361
|
-
var
|
|
9372
|
+
var import_core6 = __toESM(require_core(), 1);
|
|
9362
9373
|
var BatchUniformBuffer = class {
|
|
9363
9374
|
constructor(device) {
|
|
9364
9375
|
this.device = device;
|
|
@@ -9373,7 +9384,7 @@ ${declarations.join("\n")}`).match(
|
|
|
9373
9384
|
const buffer = this.device.createBuffer({
|
|
9374
9385
|
id: "batch-uniforms",
|
|
9375
9386
|
byteLength: capacity,
|
|
9376
|
-
usage:
|
|
9387
|
+
usage: import_core6.Buffer.UNIFORM | import_core6.Buffer.COPY_DST
|
|
9377
9388
|
});
|
|
9378
9389
|
this.buffer?.destroy();
|
|
9379
9390
|
this.buffer = buffer;
|
|
@@ -9387,7 +9398,7 @@ ${declarations.join("\n")}`).match(
|
|
|
9387
9398
|
}
|
|
9388
9399
|
/** Writes one slot without overwriting earlier batches in this call. */
|
|
9389
9400
|
write(data) {
|
|
9390
|
-
(0,
|
|
9401
|
+
(0, import_core6.assert)(this.buffer && this.byteOffset + data.byteLength <= this.buffer.byteLength);
|
|
9391
9402
|
const binding = { buffer: this.buffer, offset: this.byteOffset, size: data.byteLength };
|
|
9392
9403
|
this.buffer.write(data, binding.offset);
|
|
9393
9404
|
this.byteOffset += this.getAlignedByteLength(data.byteLength);
|
|
@@ -9565,7 +9576,7 @@ ${declarations.join("\n")}`).match(
|
|
|
9565
9576
|
}
|
|
9566
9577
|
|
|
9567
9578
|
// src/utils/buffer-layout-helper.ts
|
|
9568
|
-
var
|
|
9579
|
+
var import_core7 = __toESM(require_core(), 1);
|
|
9569
9580
|
var BufferLayoutHelper = class {
|
|
9570
9581
|
bufferLayouts;
|
|
9571
9582
|
constructor(bufferLayouts) {
|
|
@@ -9576,7 +9587,7 @@ ${declarations.join("\n")}`).match(
|
|
|
9576
9587
|
}
|
|
9577
9588
|
/** Get attribute names from a BufferLayout */
|
|
9578
9589
|
getAttributeNamesForBuffer(bufferLayout) {
|
|
9579
|
-
return (0,
|
|
9590
|
+
return (0, import_core7.getBufferLayoutAttributeNames)(bufferLayout);
|
|
9580
9591
|
}
|
|
9581
9592
|
mergeBufferLayouts(bufferLayouts1, bufferLayouts2) {
|
|
9582
9593
|
const mergedLayouts = [...bufferLayouts1];
|
|
@@ -9593,16 +9604,16 @@ ${declarations.join("\n")}`).match(
|
|
|
9593
9604
|
};
|
|
9594
9605
|
|
|
9595
9606
|
// src/utils/buffer-layout-order.ts
|
|
9596
|
-
var
|
|
9607
|
+
var import_core8 = __toESM(require_core(), 1);
|
|
9597
9608
|
function sortedBufferLayoutByShaderSourceLocations(shaderLayout, bufferLayout) {
|
|
9598
|
-
const shaderLayoutMap = (0,
|
|
9609
|
+
const shaderLayoutMap = (0, import_core8.getShaderAttributeLocationMap)(shaderLayout);
|
|
9599
9610
|
const sortedLayout = bufferLayout.slice();
|
|
9600
9611
|
sortedLayout.sort((a, b) => {
|
|
9601
|
-
const minLocationA = (0,
|
|
9602
|
-
(0,
|
|
9612
|
+
const minLocationA = (0, import_core8.getMinimumAttributeLocation)(
|
|
9613
|
+
(0, import_core8.getBufferLayoutAttributeNames)(a).map((attributeName) => shaderLayoutMap[attributeName])
|
|
9603
9614
|
);
|
|
9604
|
-
const minLocationB = (0,
|
|
9605
|
-
(0,
|
|
9615
|
+
const minLocationB = (0, import_core8.getMinimumAttributeLocation)(
|
|
9616
|
+
(0, import_core8.getBufferLayoutAttributeNames)(b).map((attributeName) => shaderLayoutMap[attributeName])
|
|
9606
9617
|
);
|
|
9607
9618
|
return minLocationA - minLocationB;
|
|
9608
9619
|
});
|
|
@@ -9765,7 +9776,7 @@ ${declarations.join("\n")}`).match(
|
|
|
9765
9776
|
}
|
|
9766
9777
|
|
|
9767
9778
|
// src/model/gpu-vector-model-batches.ts
|
|
9768
|
-
var
|
|
9779
|
+
var import_core9 = __toESM(require_core(), 1);
|
|
9769
9780
|
function validateGPUVectorModelLayouts(ownerName, vectors, bufferLayouts) {
|
|
9770
9781
|
for (const [name, vector] of Object.entries(vectors)) {
|
|
9771
9782
|
if (!vector) continue;
|
|
@@ -9829,22 +9840,22 @@ ${declarations.join("\n")}`).match(
|
|
|
9829
9840
|
if (format.includes("<")) {
|
|
9830
9841
|
throw new Error(`${ownerName} GPUVector "${name}" requires a fixed-width scalar format`);
|
|
9831
9842
|
}
|
|
9832
|
-
return
|
|
9843
|
+
return import_core9.vertexFormatDecoder.getVertexFormatInfo(format);
|
|
9833
9844
|
}
|
|
9834
9845
|
|
|
9835
9846
|
// src/utils/gpu-vector-batch-structure.ts
|
|
9836
|
-
var
|
|
9847
|
+
var import_core10 = __toESM(require_core(), 1);
|
|
9837
9848
|
function validateGPUVectorBatchStructure(vectors) {
|
|
9838
9849
|
let reference;
|
|
9839
9850
|
for (const vector of Object.values(vectors)) {
|
|
9840
9851
|
if (!vector || "isConstant" in vector) continue;
|
|
9841
9852
|
let rowCount = 0;
|
|
9842
9853
|
for (const chunk of vector.data) rowCount += chunk.length;
|
|
9843
|
-
(0,
|
|
9854
|
+
(0, import_core10.assert)(rowCount === vector.length);
|
|
9844
9855
|
if (reference) {
|
|
9845
|
-
(0,
|
|
9856
|
+
(0, import_core10.assert)(vector.length === reference.length && vector.data.length === reference.data.length);
|
|
9846
9857
|
for (let batchIndex = 0; batchIndex < vector.data.length; batchIndex++) {
|
|
9847
|
-
(0,
|
|
9858
|
+
(0, import_core10.assert)(vector.data[batchIndex].length === reference.data[batchIndex].length);
|
|
9848
9859
|
}
|
|
9849
9860
|
} else reference = vector;
|
|
9850
9861
|
}
|
|
@@ -9937,7 +9948,7 @@ ${declarations.join("\n")}`).match(
|
|
|
9937
9948
|
}
|
|
9938
9949
|
|
|
9939
9950
|
// src/model/gpu-vector-bindings.ts
|
|
9940
|
-
var
|
|
9951
|
+
var import_core11 = __toESM(require_core(), 1);
|
|
9941
9952
|
var GPUVectorBindings = class {
|
|
9942
9953
|
constructor(device, id) {
|
|
9943
9954
|
this.device = device;
|
|
@@ -9962,7 +9973,7 @@ ${declarations.join("\n")}`).match(
|
|
|
9962
9973
|
validateGPUVectorBatchStructure(columns);
|
|
9963
9974
|
} else {
|
|
9964
9975
|
for (const column of Object.values(columns)) {
|
|
9965
|
-
if (column && !isConstant(column)) (0,
|
|
9976
|
+
if (column && !isConstant(column)) (0, import_core11.assert)(column.data.length === 1);
|
|
9966
9977
|
}
|
|
9967
9978
|
}
|
|
9968
9979
|
this.claimedNames.clear();
|
|
@@ -9980,7 +9991,7 @@ ${declarations.join("\n")}`).match(
|
|
|
9980
9991
|
(layout) => layout.name === name || layout.attributes?.some((attribute) => attribute.attribute === name)
|
|
9981
9992
|
))
|
|
9982
9993
|
return [];
|
|
9983
|
-
(0,
|
|
9994
|
+
(0, import_core11.assert)(column.format);
|
|
9984
9995
|
const format = column.format;
|
|
9985
9996
|
const byteStride = isConstant(column) ? 0 : column.byteStride;
|
|
9986
9997
|
return [{ name, stepMode, byteStride, attributes: [{ attribute: name, format, byteOffset: 0 }] }];
|
|
@@ -9996,10 +10007,10 @@ ${declarations.join("\n")}`).match(
|
|
|
9996
10007
|
);
|
|
9997
10008
|
const mode = layout?.stepMode ?? stepMode;
|
|
9998
10009
|
if (mode === "instance") {
|
|
9999
|
-
(0,
|
|
10010
|
+
(0, import_core11.assert)(this.instanceCount === void 0 || this.instanceCount === column.length);
|
|
10000
10011
|
this.instanceCount = column.length;
|
|
10001
10012
|
} else {
|
|
10002
|
-
(0,
|
|
10013
|
+
(0, import_core11.assert)(this.vertexCount === void 0 || this.vertexCount === column.length);
|
|
10003
10014
|
this.vertexCount = column.length;
|
|
10004
10015
|
}
|
|
10005
10016
|
this.rowCount = stepMode === "instance" ? this.instanceCount : this.vertexCount;
|
|
@@ -10044,7 +10055,7 @@ ${declarations.join("\n")}`).match(
|
|
|
10044
10055
|
for (const definition of definitions) {
|
|
10045
10056
|
const column = columns[definition.attribute] ?? (definition.attribute === layout.name ? columns[layout.name] : void 0);
|
|
10046
10057
|
if (!column) continue;
|
|
10047
|
-
(0,
|
|
10058
|
+
(0, import_core11.assert)(column.format === void 0 || column.format === definition.format);
|
|
10048
10059
|
if (isConstant(column)) {
|
|
10049
10060
|
this.constants[definition.attribute] = getShaderConstant(column);
|
|
10050
10061
|
constantByteLength = Math.max(
|
|
@@ -10071,7 +10082,7 @@ ${declarations.join("\n")}`).match(
|
|
|
10071
10082
|
buffer = this.device.createBuffer({
|
|
10072
10083
|
id: `${this.id}-${layout.name}-constant`,
|
|
10073
10084
|
byteLength: bytes.byteLength,
|
|
10074
|
-
usage:
|
|
10085
|
+
usage: import_core11.Buffer.VERTEX | import_core11.Buffer.COPY_DST | import_core11.Buffer.COPY_SRC
|
|
10075
10086
|
});
|
|
10076
10087
|
this.constantBuffers[layout.name] = buffer;
|
|
10077
10088
|
}
|
|
@@ -10108,7 +10119,7 @@ ${declarations.join("\n")}`).match(
|
|
|
10108
10119
|
const chunk = vector.data[0];
|
|
10109
10120
|
if (!chunk) return;
|
|
10110
10121
|
const byteOffset = chunk.byteOffset - layoutOffset;
|
|
10111
|
-
(0,
|
|
10122
|
+
(0, import_core11.assert)(byteOffset >= 0);
|
|
10112
10123
|
this.buffers[name] = chunk.buffer;
|
|
10113
10124
|
this.byteOffsets[name] = byteOffset;
|
|
10114
10125
|
}
|
|
@@ -10117,7 +10128,7 @@ ${declarations.join("\n")}`).match(
|
|
|
10117
10128
|
return Boolean(column && "isConstant" in column && column.isConstant);
|
|
10118
10129
|
}
|
|
10119
10130
|
function getShaderConstant(column) {
|
|
10120
|
-
const information =
|
|
10131
|
+
const information = import_core11.vertexFormatDecoder.getVertexFormatInfo(column.format);
|
|
10121
10132
|
if (column.format === "unorm10-10-10-2") {
|
|
10122
10133
|
const word = column.value[0];
|
|
10123
10134
|
return new Float32Array([
|
|
@@ -10187,13 +10198,13 @@ ${declarations.join("\n")}`).match(
|
|
|
10187
10198
|
}
|
|
10188
10199
|
|
|
10189
10200
|
// src/shader-inputs.ts
|
|
10190
|
-
var
|
|
10201
|
+
var import_core12 = __toESM(require_core(), 1);
|
|
10191
10202
|
var import_shaders2 = __toESM(require_shaders(), 1);
|
|
10192
10203
|
|
|
10193
10204
|
// src/model/split-uniforms-and-bindings.ts
|
|
10194
10205
|
function isUniformValue(value) {
|
|
10195
|
-
const
|
|
10196
|
-
return
|
|
10206
|
+
const isNumericArray2 = Array.isArray(value) ? value.length === 0 || typeof value[0] === "number" : ArrayBuffer.isView(value) && !(value instanceof DataView);
|
|
10207
|
+
return isNumericArray2 || typeof value === "number" || typeof value === "boolean";
|
|
10197
10208
|
}
|
|
10198
10209
|
function splitUniformsAndBindings(uniforms, uniformTypes2 = {}) {
|
|
10199
10210
|
const result = { bindings: {}, uniforms: {} };
|
|
@@ -10237,7 +10248,7 @@ ${declarations.join("\n")}`).match(
|
|
|
10237
10248
|
for (const resolvedModule of resolvedModules) {
|
|
10238
10249
|
modules[resolvedModule.name] = resolvedModule;
|
|
10239
10250
|
}
|
|
10240
|
-
|
|
10251
|
+
import_core12.log.log(1, "Creating ShaderInputs with modules", Object.keys(modules))();
|
|
10241
10252
|
this.modules = modules;
|
|
10242
10253
|
this.moduleUniforms = {};
|
|
10243
10254
|
this.moduleBindings = {};
|
|
@@ -10245,7 +10256,7 @@ ${declarations.join("\n")}`).match(
|
|
|
10245
10256
|
if (module) {
|
|
10246
10257
|
this._addModule(module);
|
|
10247
10258
|
if (module.name && name !== module.name && !this.options.disableWarnings) {
|
|
10248
|
-
|
|
10259
|
+
import_core12.log.warn(`Module name: ${name} vs ${module.name}`)();
|
|
10249
10260
|
}
|
|
10250
10261
|
}
|
|
10251
10262
|
}
|
|
@@ -10269,7 +10280,7 @@ ${declarations.join("\n")}`).match(
|
|
|
10269
10280
|
const module = this.modules[moduleName];
|
|
10270
10281
|
if (!module) {
|
|
10271
10282
|
if (!this.options.disableWarnings) {
|
|
10272
|
-
|
|
10283
|
+
import_core12.log.warn(`Module ${name} not found`)();
|
|
10273
10284
|
}
|
|
10274
10285
|
} else {
|
|
10275
10286
|
const oldUniforms = this.moduleUniforms[moduleName];
|
|
@@ -13644,13 +13655,13 @@ ${declarations.join("\n")}`).match(
|
|
|
13644
13655
|
var GPUVectorModel = class _GPUVectorModel {
|
|
13645
13656
|
/** Creates a model while allowing the backend to compile its render pipeline asynchronously. */
|
|
13646
13657
|
static async createAsync(device, props) {
|
|
13647
|
-
const ownsCompilation = !
|
|
13648
|
-
const asyncCompilation = ownsCompilation ?
|
|
13658
|
+
const ownsCompilation = !import_core13.PipelineFactory.getAsyncCompilation(device);
|
|
13659
|
+
const asyncCompilation = ownsCompilation ? import_core13.PipelineFactory.beginAsyncCompilation(device) : import_core13.PipelineFactory.getAsyncCompilation(device);
|
|
13649
13660
|
let model;
|
|
13650
13661
|
try {
|
|
13651
13662
|
model = new this(device, props);
|
|
13652
13663
|
} finally {
|
|
13653
|
-
if (ownsCompilation)
|
|
13664
|
+
if (ownsCompilation) import_core13.PipelineFactory.endAsyncCompilation(device, asyncCompilation);
|
|
13654
13665
|
}
|
|
13655
13666
|
try {
|
|
13656
13667
|
if (ownsCompilation) {
|
|
@@ -13665,7 +13676,7 @@ ${declarations.join("\n")}`).match(
|
|
|
13665
13676
|
}
|
|
13666
13677
|
}
|
|
13667
13678
|
static defaultProps = {
|
|
13668
|
-
...
|
|
13679
|
+
...import_core13.RenderPipeline.defaultProps,
|
|
13669
13680
|
inferDrawCount: "no",
|
|
13670
13681
|
enforceMatchingVectorLengths: true,
|
|
13671
13682
|
geometry: null,
|
|
@@ -13849,7 +13860,7 @@ ${declarations.join("\n")}`).match(
|
|
|
13849
13860
|
const isWebGPU = this.device.type === "webgpu";
|
|
13850
13861
|
if (isWebGPU && this.props.source) {
|
|
13851
13862
|
const shaderAssembler = this.props.shaderAssembler;
|
|
13852
|
-
(0,
|
|
13863
|
+
(0, import_core13.assert)(isShaderAssemblerForLanguage(shaderAssembler, "wgsl"));
|
|
13853
13864
|
const {
|
|
13854
13865
|
source: source4,
|
|
13855
13866
|
getUniforms: getUniforms2,
|
|
@@ -13886,7 +13897,7 @@ ${declarations.join("\n")}`).match(
|
|
|
13886
13897
|
this.props.shaderLayout = mergeShaderModuleBindingsIntoLayout(shaderLayout || null, modules) || null;
|
|
13887
13898
|
} else {
|
|
13888
13899
|
const shaderAssembler = this.props.shaderAssembler;
|
|
13889
|
-
(0,
|
|
13900
|
+
(0, import_core13.assert)(isShaderAssemblerForLanguage(shaderAssembler, "glsl"));
|
|
13890
13901
|
const { vs: vs4, fs: fs4, getUniforms: getUniforms2 } = shaderAssembler.assembleGLSLShaderPair({
|
|
13891
13902
|
platformInfo,
|
|
13892
13903
|
...this.props,
|
|
@@ -13902,9 +13913,9 @@ ${declarations.join("\n")}`).match(
|
|
|
13902
13913
|
this._getModuleUniforms = getUniforms2;
|
|
13903
13914
|
this._bindingTable = [];
|
|
13904
13915
|
}
|
|
13905
|
-
this.pipelineFactory = props.pipelineFactory ||
|
|
13906
|
-
this.shaderFactory = props.shaderFactory ||
|
|
13907
|
-
const asyncCompilation =
|
|
13916
|
+
this.pipelineFactory = props.pipelineFactory || import_core13.PipelineFactory.getDefaultPipelineFactory(this.device);
|
|
13917
|
+
this.shaderFactory = props.shaderFactory || import_core13.ShaderFactory.getDefaultShaderFactory(this.device);
|
|
13918
|
+
const asyncCompilation = import_core13.PipelineFactory.getAsyncCompilation(this.device);
|
|
13908
13919
|
if (asyncCompilation) {
|
|
13909
13920
|
this._pipelineInitialization = this._initializePipelineAsync(props);
|
|
13910
13921
|
asyncCompilation.push(this._pipelineInitialization);
|
|
@@ -14039,12 +14050,12 @@ ${declarations.join("\n")}`).match(
|
|
|
14039
14050
|
return this.drawVectorGroups(renderPass);
|
|
14040
14051
|
}
|
|
14041
14052
|
if (this._drawBlockedReason && !this._pipelineNeedsUpdate) {
|
|
14042
|
-
|
|
14053
|
+
import_core13.log.info(LOG_DRAW_PRIORITY, `>>> DRAWING ABORTED ${this.id}: ${this._drawBlockedReason}`)();
|
|
14043
14054
|
return false;
|
|
14044
14055
|
}
|
|
14045
14056
|
const loadingBinding = this._areBindingsLoading();
|
|
14046
14057
|
if (loadingBinding) {
|
|
14047
|
-
|
|
14058
|
+
import_core13.log.info(LOG_DRAW_PRIORITY, `>>> DRAWING ABORTED ${this.id}: ${loadingBinding} not loaded`)();
|
|
14048
14059
|
return false;
|
|
14049
14060
|
}
|
|
14050
14061
|
this._syncAttachmentFormats(renderPass);
|
|
@@ -14068,7 +14079,7 @@ ${declarations.join("\n")}`).match(
|
|
|
14068
14079
|
this.pipeline = this._updatePipeline();
|
|
14069
14080
|
pipelineErrored = this.pipeline.isErrored;
|
|
14070
14081
|
if (pipelineErrored) {
|
|
14071
|
-
|
|
14082
|
+
import_core13.log.info(
|
|
14072
14083
|
LOG_DRAW_PRIORITY,
|
|
14073
14084
|
`>>> DRAWING ABORTED ${this.id}: ${PIPELINE_INITIALIZATION_FAILED}`
|
|
14074
14085
|
)();
|
|
@@ -14076,7 +14087,7 @@ ${declarations.join("\n")}`).match(
|
|
|
14076
14087
|
} else {
|
|
14077
14088
|
const drawValidationError = this.vertexArray.getDrawValidationError();
|
|
14078
14089
|
if (drawValidationError) {
|
|
14079
|
-
|
|
14090
|
+
import_core13.log.info(LOG_DRAW_PRIORITY, `>>> DRAWING ABORTED ${this.id}: ${drawValidationError}`)();
|
|
14080
14091
|
this._drawBlockedReason = drawValidationError;
|
|
14081
14092
|
drawSuccess = false;
|
|
14082
14093
|
} else {
|
|
@@ -14151,7 +14162,7 @@ ${declarations.join("\n")}`).match(
|
|
|
14151
14162
|
this.claimVectorLayouts(this.geometryVectorBindings);
|
|
14152
14163
|
this.syncVectorBindings();
|
|
14153
14164
|
const rowCount = this.geometryVectorBindings.rowCount;
|
|
14154
|
-
(0,
|
|
14165
|
+
(0, import_core13.assert)(
|
|
14155
14166
|
rowCount === void 0 || this.attributeVectorBindings.vertexCount === void 0 || rowCount === this.attributeVectorBindings.vertexCount
|
|
14156
14167
|
);
|
|
14157
14168
|
if (this.props.inferDrawCount === "vertex")
|
|
@@ -14188,7 +14199,7 @@ ${declarations.join("\n")}`).match(
|
|
|
14188
14199
|
const vertexCount = this.attributeVectorBindings.vertexCount;
|
|
14189
14200
|
if (vertexCount !== void 0 && this.props.inferDrawCount === "vertex") {
|
|
14190
14201
|
const geometryRowCount = this.geometryVectorBindings.rowCount;
|
|
14191
|
-
(0,
|
|
14202
|
+
(0, import_core13.assert)(geometryRowCount === void 0 || geometryRowCount === vertexCount);
|
|
14192
14203
|
if (geometryRowCount === void 0) this.setVertexCount(vertexCount);
|
|
14193
14204
|
}
|
|
14194
14205
|
}
|
|
@@ -14199,9 +14210,9 @@ ${declarations.join("\n")}`).match(
|
|
|
14199
14210
|
/** Replaces the borrowed contiguous uint16/uint32 index vector. */
|
|
14200
14211
|
setIndexVector(vector) {
|
|
14201
14212
|
if (vector) {
|
|
14202
|
-
(0,
|
|
14203
|
-
(0,
|
|
14204
|
-
(0,
|
|
14213
|
+
(0, import_core13.assert)(vector.format === "uint8" || vector.format === "uint16" || vector.format === "uint32");
|
|
14214
|
+
(0, import_core13.assert)(vector.data.length <= 1);
|
|
14215
|
+
(0, import_core13.assert)(
|
|
14205
14216
|
vector.byteStride === (vector.format === "uint32" ? 4 : vector.format === "uint16" ? 2 : 1)
|
|
14206
14217
|
);
|
|
14207
14218
|
}
|
|
@@ -14213,7 +14224,7 @@ ${declarations.join("\n")}`).match(
|
|
|
14213
14224
|
const chunk = vector?.data[0];
|
|
14214
14225
|
if (chunk && this.indexVector) {
|
|
14215
14226
|
const buffer = chunk.buffer instanceof DynamicBuffer ? chunk.buffer.buffer : chunk.buffer;
|
|
14216
|
-
(0,
|
|
14227
|
+
(0, import_core13.assert)(
|
|
14217
14228
|
buffer.indexType === this.indexVector.format && chunk.byteOffset % this.indexVector.byteStride === 0
|
|
14218
14229
|
);
|
|
14219
14230
|
}
|
|
@@ -14287,7 +14298,7 @@ ${declarations.join("\n")}`).match(
|
|
|
14287
14298
|
/** Binds contiguous borrowed vectors; use drawBatches() for multi-chunk inputs. */
|
|
14288
14299
|
setGPUVectors(vectors, options) {
|
|
14289
14300
|
const batches = getGPUVectorModelBatches(this.id, vectors);
|
|
14290
|
-
(0,
|
|
14301
|
+
(0, import_core13.assert)(batches.length <= 1);
|
|
14291
14302
|
validateGPUVectorModelLayouts(this.id, vectors, this.bufferLayout);
|
|
14292
14303
|
if (batches[0]) this.setGPUData(batches[0].data);
|
|
14293
14304
|
this.setBatchDrawCount(batches[0]?.rowCount ?? 0, options?.count);
|
|
@@ -14326,7 +14337,7 @@ ${declarations.join("\n")}`).match(
|
|
|
14326
14337
|
const batches = getGPUVectorModelBatches(this.id, vectors);
|
|
14327
14338
|
validateGPUVectorModelLayouts(this.id, vectors, this.bufferLayout);
|
|
14328
14339
|
for (const name of Object.keys(vectors)) {
|
|
14329
|
-
(0,
|
|
14340
|
+
(0, import_core13.assert)(!vectors[name] || this.currentAttributes[name]);
|
|
14330
14341
|
}
|
|
14331
14342
|
const previousAttributes = { ...this.currentAttributes };
|
|
14332
14343
|
const previousAttributeByteOffsets = { ...this.currentAttributeByteOffsets };
|
|
@@ -14336,7 +14347,7 @@ ${declarations.join("\n")}`).match(
|
|
|
14336
14347
|
const previousIsInstanced = this.isInstanced;
|
|
14337
14348
|
const previousVertexCountSet = this._vertexCountSet;
|
|
14338
14349
|
const drawingVectorBatches = this.drawingVectorBatches;
|
|
14339
|
-
const batchUniformStore = this.device.type === "webgpu" && batches.length ? new
|
|
14350
|
+
const batchUniformStore = this.device.type === "webgpu" && batches.length ? new import_core13.UniformStore(this.device, this.shaderInputs.modules) : void 0;
|
|
14340
14351
|
if (batchUniformStore && this._uniformStore.uniformBuffers.size) {
|
|
14341
14352
|
this.batchUniformBuffer ??= new BatchUniformBuffer(this.device);
|
|
14342
14353
|
let batchByteLength = 0;
|
|
@@ -14397,7 +14408,7 @@ ${declarations.join("\n")}`).match(
|
|
|
14397
14408
|
Object.entries(data).map(([name, chunk]) => {
|
|
14398
14409
|
const layout = this.bufferLayout.find((layout2) => layout2.name === name);
|
|
14399
14410
|
const byteOffset = chunk.byteOffset - (layout?.attributes?.[0]?.byteOffset ?? 0);
|
|
14400
|
-
(0,
|
|
14411
|
+
(0, import_core13.assert)(byteOffset >= 0);
|
|
14401
14412
|
return [name, byteOffset];
|
|
14402
14413
|
})
|
|
14403
14414
|
)
|
|
@@ -14405,7 +14416,7 @@ ${declarations.join("\n")}`).match(
|
|
|
14405
14416
|
);
|
|
14406
14417
|
}
|
|
14407
14418
|
validateVectorLengthPolicy() {
|
|
14408
|
-
(0,
|
|
14419
|
+
(0, import_core13.assert)(this.props.enforceMatchingVectorLengths !== false || this.props.inferDrawCount === "no");
|
|
14409
14420
|
}
|
|
14410
14421
|
setBatchDrawCount(rowCount, count = this.props.inferDrawCount === "no" ? "none" : this.props.inferDrawCount) {
|
|
14411
14422
|
if (count === "instance") {
|
|
@@ -14528,7 +14539,7 @@ ${declarations.join("\n")}`).match(
|
|
|
14528
14539
|
/** Set the shader inputs */
|
|
14529
14540
|
setShaderInputs(shaderInputs) {
|
|
14530
14541
|
this.shaderInputs = shaderInputs;
|
|
14531
|
-
this._uniformStore = new
|
|
14542
|
+
this._uniformStore = new import_core13.UniformStore(this.device, this.shaderInputs.modules);
|
|
14532
14543
|
for (const [moduleName, module] of Object.entries(this.shaderInputs.modules)) {
|
|
14533
14544
|
if (shaderModuleHasUniforms(module) && this._usesManagedUniformBuffer(moduleName)) {
|
|
14534
14545
|
const uniformBuffer = this._uniformStore.getManagedUniformBuffer(moduleName);
|
|
@@ -14599,7 +14610,7 @@ ${declarations.join("\n")}`).match(
|
|
|
14599
14610
|
this._drawBlockedReason = false;
|
|
14600
14611
|
const disableWarnings = options?.disableWarnings ?? this.props.disableWarnings;
|
|
14601
14612
|
if (buffers["indices"]) {
|
|
14602
|
-
|
|
14613
|
+
import_core13.log.warn(
|
|
14603
14614
|
`Model:${this.id} setAttributes() - indexBuffer should be set using setIndexBuffer()`
|
|
14604
14615
|
)();
|
|
14605
14616
|
}
|
|
@@ -14613,7 +14624,7 @@ ${declarations.join("\n")}`).match(
|
|
|
14613
14624
|
const bufferLayout = bufferLayoutHelper.getBufferLayout(bufferName);
|
|
14614
14625
|
if (!bufferLayout) {
|
|
14615
14626
|
if (!disableWarnings) {
|
|
14616
|
-
|
|
14627
|
+
import_core13.log.warn(`Model(${this.id}): Missing layout for buffer "${bufferName}".`)();
|
|
14617
14628
|
}
|
|
14618
14629
|
continue;
|
|
14619
14630
|
}
|
|
@@ -14625,7 +14636,7 @@ ${declarations.join("\n")}`).match(
|
|
|
14625
14636
|
const bufferSlot = this.device.type === "webgpu" ? this.vertexArray.getBufferSlot(attributeInfo.bufferName) : attributeInfo.location;
|
|
14626
14637
|
if (bufferSlot === null) {
|
|
14627
14638
|
if (!disableWarnings) {
|
|
14628
|
-
|
|
14639
|
+
import_core13.log.warn(
|
|
14629
14640
|
`Model(${this.id}): Missing vertex array slot for buffer "${attributeInfo.bufferName}".`
|
|
14630
14641
|
)();
|
|
14631
14642
|
}
|
|
@@ -14646,7 +14657,7 @@ ${declarations.join("\n")}`).match(
|
|
|
14646
14657
|
}
|
|
14647
14658
|
}
|
|
14648
14659
|
if (!set2 && !disableWarnings) {
|
|
14649
|
-
|
|
14660
|
+
import_core13.log.warn(
|
|
14650
14661
|
`Model(${this.id}): Ignoring buffer "${resolvedBuffer.id}" for unknown attribute "${bufferName}"`
|
|
14651
14662
|
)();
|
|
14652
14663
|
}
|
|
@@ -14667,7 +14678,7 @@ ${declarations.join("\n")}`).match(
|
|
|
14667
14678
|
if (attributeInfo) {
|
|
14668
14679
|
this.vertexArray.setConstantWebGL(attributeInfo.location, value);
|
|
14669
14680
|
} else if (!(options?.disableWarnings ?? this.props.disableWarnings)) {
|
|
14670
|
-
|
|
14681
|
+
import_core13.log.warn(
|
|
14671
14682
|
`Model "${this.id}: Ignoring constant supplied for unknown attribute "${attributeName}"`
|
|
14672
14683
|
)();
|
|
14673
14684
|
}
|
|
@@ -14704,7 +14715,7 @@ ${declarations.join("\n")}`).match(
|
|
|
14704
14715
|
* @param bindings GPUVectorModel bindings already resolved for this draw preparation.
|
|
14705
14716
|
*/
|
|
14706
14717
|
_getBindGroups(shaderLayout = this._getCurrentShaderLayout(), bindings = this._getBindings(shaderLayout)) {
|
|
14707
|
-
return shaderLayout.bindings.length ? (0,
|
|
14718
|
+
return shaderLayout.bindings.length ? (0, import_core13.normalizeBindingsByGroup)(shaderLayout, bindings) : { 0: bindings };
|
|
14708
14719
|
}
|
|
14709
14720
|
_getBindGroupCacheKeys() {
|
|
14710
14721
|
return {};
|
|
@@ -14719,9 +14730,9 @@ ${declarations.join("\n")}`).match(
|
|
|
14719
14730
|
timestamp = Math.max(timestamp, entry.source.updateTimestamp);
|
|
14720
14731
|
}
|
|
14721
14732
|
for (const binding of Object.values(this.bindings)) {
|
|
14722
|
-
if (binding instanceof
|
|
14733
|
+
if (binding instanceof import_core13.TextureView) {
|
|
14723
14734
|
timestamp = Math.max(timestamp, binding.texture.updateTimestamp);
|
|
14724
|
-
} else if (binding instanceof
|
|
14735
|
+
} else if (binding instanceof import_core13.Buffer || binding instanceof import_core13.Texture || binding instanceof import_core13.ExternalTexture) {
|
|
14725
14736
|
timestamp = Math.max(timestamp, binding.updateTimestamp);
|
|
14726
14737
|
} else if (binding instanceof DynamicBuffer) {
|
|
14727
14738
|
timestamp = Math.max(timestamp, binding.updateTimestamp);
|
|
@@ -14780,7 +14791,7 @@ ${declarations.join("\n")}`).match(
|
|
|
14780
14791
|
const previousVertexShader = this.pipeline?.vs ?? null;
|
|
14781
14792
|
const previousFragmentShader = this.pipeline?.fs ?? null;
|
|
14782
14793
|
if (this.pipeline) {
|
|
14783
|
-
|
|
14794
|
+
import_core13.log.log(
|
|
14784
14795
|
1,
|
|
14785
14796
|
`GPUVectorModel ${this.id}: Recreating pipeline because "${this._pipelineNeedsUpdate}".`
|
|
14786
14797
|
)();
|
|
@@ -14830,7 +14841,7 @@ ${declarations.join("\n")}`).match(
|
|
|
14830
14841
|
};
|
|
14831
14842
|
}
|
|
14832
14843
|
_finishPipelineUpdate(update) {
|
|
14833
|
-
this._attributeInfos = (0,
|
|
14844
|
+
this._attributeInfos = (0, import_core13.getAttributeInfosFromLayouts)(
|
|
14834
14845
|
this.pipeline.shaderLayout,
|
|
14835
14846
|
this.bufferLayout
|
|
14836
14847
|
);
|
|
@@ -14846,24 +14857,24 @@ ${declarations.join("\n")}`).match(
|
|
|
14846
14857
|
_lastLogTime = 0;
|
|
14847
14858
|
_logOpen = false;
|
|
14848
14859
|
_logDrawCallStart() {
|
|
14849
|
-
const logDrawTimeout =
|
|
14850
|
-
if (
|
|
14860
|
+
const logDrawTimeout = import_core13.log.level > 3 ? 0 : LOG_DRAW_TIMEOUT;
|
|
14861
|
+
if (import_core13.log.level < 2 || Date.now() - this._lastLogTime < logDrawTimeout) {
|
|
14851
14862
|
return;
|
|
14852
14863
|
}
|
|
14853
14864
|
this._lastLogTime = Date.now();
|
|
14854
14865
|
this._logOpen = true;
|
|
14855
|
-
|
|
14866
|
+
import_core13.log.group(LOG_DRAW_PRIORITY, `>>> DRAWING MODEL ${this.id}`, { collapsed: import_core13.log.level <= 2 })();
|
|
14856
14867
|
}
|
|
14857
14868
|
_logDrawCallEnd() {
|
|
14858
14869
|
if (this._logOpen) {
|
|
14859
14870
|
const shaderLayoutTable = getDebugTableForShaderLayout(this.pipeline.shaderLayout, this.id);
|
|
14860
|
-
|
|
14871
|
+
import_core13.log.table(LOG_DRAW_PRIORITY, shaderLayoutTable)();
|
|
14861
14872
|
const uniformTable = this.shaderInputs.getDebugTable();
|
|
14862
|
-
|
|
14873
|
+
import_core13.log.table(LOG_DRAW_PRIORITY, uniformTable)();
|
|
14863
14874
|
const attributeTable = this._getAttributeDebugTable();
|
|
14864
|
-
|
|
14865
|
-
|
|
14866
|
-
|
|
14875
|
+
import_core13.log.table(LOG_DRAW_PRIORITY, this._attributeInfos)();
|
|
14876
|
+
import_core13.log.table(LOG_DRAW_PRIORITY, attributeTable)();
|
|
14877
|
+
import_core13.log.groupEnd(LOG_DRAW_PRIORITY)();
|
|
14867
14878
|
this._logOpen = false;
|
|
14868
14879
|
}
|
|
14869
14880
|
}
|
|
@@ -14903,8 +14914,8 @@ ${declarations.join("\n")}`).match(
|
|
|
14903
14914
|
}
|
|
14904
14915
|
// TODO - fix typing of luma data types
|
|
14905
14916
|
_getBufferOrConstantValues(attribute, dataType) {
|
|
14906
|
-
const TypedArrayConstructor =
|
|
14907
|
-
const typedArray = attribute instanceof
|
|
14917
|
+
const TypedArrayConstructor = import_core13.dataTypeDecoder.getTypedArrayConstructor(dataType);
|
|
14918
|
+
const typedArray = attribute instanceof import_core13.Buffer ? new TypedArrayConstructor(attribute.debugData) : attribute;
|
|
14908
14919
|
return typedArray.toString();
|
|
14909
14920
|
}
|
|
14910
14921
|
/** Returns the current reflected shader layout or the pre-reflection empty layout. */
|
|
@@ -14988,7 +14999,7 @@ ${declarations.join("\n")}`).match(
|
|
|
14988
14999
|
}
|
|
14989
15000
|
|
|
14990
15001
|
// src/geometry/gpu-geometry.ts
|
|
14991
|
-
var
|
|
15002
|
+
var import_core14 = __toESM(require_core(), 1);
|
|
14992
15003
|
var GPUGeometry = class {
|
|
14993
15004
|
/** Application-provided or generated identifier. */
|
|
14994
15005
|
id;
|
|
@@ -15013,7 +15024,7 @@ ${declarations.join("\n")}`).match(
|
|
|
15013
15024
|
this.vertexCount = props.vertexCount;
|
|
15014
15025
|
this.bufferLayout = props.bufferLayout || [];
|
|
15015
15026
|
if (this.indices) {
|
|
15016
|
-
if (!(this.indices.usage &
|
|
15027
|
+
if (!(this.indices.usage & import_core14.Buffer.INDEX)) {
|
|
15017
15028
|
throw new Error("Index buffer must have INDEX usage");
|
|
15018
15029
|
}
|
|
15019
15030
|
}
|
|
@@ -15062,7 +15073,7 @@ ${declarations.join("\n")}`).match(
|
|
|
15062
15073
|
return void 0;
|
|
15063
15074
|
}
|
|
15064
15075
|
const data = geometry.indices.value;
|
|
15065
|
-
return device.createBuffer({ usage:
|
|
15076
|
+
return device.createBuffer({ usage: import_core14.Buffer.INDEX, data });
|
|
15066
15077
|
}
|
|
15067
15078
|
function getAttributeBuffersFromGeometry(device, geometry) {
|
|
15068
15079
|
const attributes = {};
|
|
@@ -15102,7 +15113,7 @@ ${declarations.join("\n")}`).match(
|
|
|
15102
15113
|
};
|
|
15103
15114
|
|
|
15104
15115
|
// src/geometry/gpu-vector-geometry-adapter.ts
|
|
15105
|
-
var
|
|
15116
|
+
var import_core15 = __toESM(require_core(), 1);
|
|
15106
15117
|
function makeGPUVectorGeometry(device, geometry) {
|
|
15107
15118
|
const gpuGeometry = makeGPUGeometry(device, geometry);
|
|
15108
15119
|
try {
|
|
@@ -15119,7 +15130,7 @@ ${declarations.join("\n")}`).match(
|
|
|
15119
15130
|
for (const [name, buffer2] of Object.entries(geometry.attributes)) {
|
|
15120
15131
|
const bufferLayout = geometry.bufferLayout.find((layout) => layout.name === name);
|
|
15121
15132
|
const format = bufferLayout?.format;
|
|
15122
|
-
const byteStride2 = bufferLayout?.byteStride ?? (format ?
|
|
15133
|
+
const byteStride2 = bufferLayout?.byteStride ?? (format ? import_core15.vertexFormatDecoder.getVertexFormatInfo(format).byteLength : 0);
|
|
15123
15134
|
const length5 = geometry.indices && byteStride2 ? Math.floor(buffer2.byteLength / byteStride2) : geometry.vertexCount;
|
|
15124
15135
|
attributes[name] = {
|
|
15125
15136
|
name,
|
|
@@ -15282,7 +15293,7 @@ ${declarations.join("\n")}`).match(
|
|
|
15282
15293
|
};
|
|
15283
15294
|
|
|
15284
15295
|
// src/material/material.ts
|
|
15285
|
-
var
|
|
15296
|
+
var import_core16 = __toESM(require_core(), 1);
|
|
15286
15297
|
|
|
15287
15298
|
// src/material/material-factory.ts
|
|
15288
15299
|
var MATERIAL_BIND_GROUP = 3;
|
|
@@ -15386,7 +15397,7 @@ ${declarations.join("\n")}`).match(
|
|
|
15386
15397
|
])
|
|
15387
15398
|
);
|
|
15388
15399
|
this.shaderInputs = props.shaderInputs || new ShaderInputs(moduleMap);
|
|
15389
|
-
this._uniformStore = new
|
|
15400
|
+
this._uniformStore = new import_core16.UniformStore(this.device, this.shaderInputs.modules);
|
|
15390
15401
|
for (const [moduleName, module] of Object.entries(this.shaderInputs.modules)) {
|
|
15391
15402
|
if (this.ownsModule(moduleName) && shaderModuleHasUniforms(module)) {
|
|
15392
15403
|
const uniformBuffer = this._uniformStore.getManagedUniformBuffer(moduleName);
|
|
@@ -15501,9 +15512,9 @@ ${declarations.join("\n")}`).match(
|
|
|
15501
15512
|
getBindingsUpdateTimestamp() {
|
|
15502
15513
|
let timestamp = 0;
|
|
15503
15514
|
for (const binding of Object.values(this.bindings)) {
|
|
15504
|
-
if (binding instanceof
|
|
15515
|
+
if (binding instanceof import_core16.TextureView) {
|
|
15505
15516
|
timestamp = Math.max(timestamp, binding.texture.updateTimestamp);
|
|
15506
|
-
} else if (binding instanceof
|
|
15517
|
+
} else if (binding instanceof import_core16.Buffer || binding instanceof import_core16.Texture || binding instanceof import_core16.ExternalTexture) {
|
|
15507
15518
|
timestamp = Math.max(timestamp, binding.updateTimestamp);
|
|
15508
15519
|
} else if (binding instanceof DynamicBuffer) {
|
|
15509
15520
|
timestamp = Math.max(timestamp, binding.updateTimestamp);
|
|
@@ -15571,7 +15582,7 @@ ${declarations.join("\n")}`).match(
|
|
|
15571
15582
|
}
|
|
15572
15583
|
|
|
15573
15584
|
// src/compute/buffer-transform.ts
|
|
15574
|
-
var
|
|
15585
|
+
var import_core17 = __toESM(require_core(), 1);
|
|
15575
15586
|
var import_shaders4 = __toESM(require_shaders(), 1);
|
|
15576
15587
|
var GL_INTERLEAVED_ATTRIBS = 35980;
|
|
15577
15588
|
var GL_SEPARATE_ATTRIBS = 35981;
|
|
@@ -15645,14 +15656,14 @@ ${declarations.join("\n")}`).match(
|
|
|
15645
15656
|
/** Binds borrowed output ranges without taking ownership or repacking vector chunks. */
|
|
15646
15657
|
setOutputVectors(vectors) {
|
|
15647
15658
|
const batches = getGPUVectorModelBatches(this.model.id, vectors);
|
|
15648
|
-
(0,
|
|
15649
|
-
(0,
|
|
15659
|
+
(0, import_core17.assert)(batches.length === 0 || this.model.pipeline.props.bufferMode !== GL_INTERLEAVED_ATTRIBS);
|
|
15660
|
+
(0, import_core17.assert)(batches.length <= 1);
|
|
15650
15661
|
this.outputVectorBindings = vectors;
|
|
15651
15662
|
this.transformFeedback.setBuffers({
|
|
15652
15663
|
...this.outputBuffers,
|
|
15653
15664
|
...Object.fromEntries(
|
|
15654
15665
|
Object.entries(batches[0]?.data ?? {}).map(([name, data]) => {
|
|
15655
|
-
(0,
|
|
15666
|
+
(0, import_core17.assert)(data.byteStride === data.rowByteLength);
|
|
15656
15667
|
return [
|
|
15657
15668
|
name,
|
|
15658
15669
|
{
|
|
@@ -15676,7 +15687,7 @@ ${declarations.join("\n")}`).match(
|
|
|
15676
15687
|
if (!result) {
|
|
15677
15688
|
throw new Error("BufferTransform#getBuffer");
|
|
15678
15689
|
}
|
|
15679
|
-
if (result instanceof
|
|
15690
|
+
if (result instanceof import_core17.Buffer) {
|
|
15680
15691
|
return result.readAsync();
|
|
15681
15692
|
}
|
|
15682
15693
|
const { buffer, byteOffset = 0, byteLength = buffer.byteLength } = result;
|
|
@@ -16873,7 +16884,7 @@ void main(void) {
|
|
|
16873
16884
|
};
|
|
16874
16885
|
|
|
16875
16886
|
// src/scenegraph/group-node.ts
|
|
16876
|
-
var
|
|
16887
|
+
var import_core18 = __toESM(require_core(), 1);
|
|
16877
16888
|
|
|
16878
16889
|
// src/scenegraph/scenegraph-bounds.ts
|
|
16879
16890
|
function makeEmptyScenegraphBounds() {
|
|
@@ -16915,7 +16926,7 @@ void main(void) {
|
|
|
16915
16926
|
constructor(props = {}) {
|
|
16916
16927
|
props = Array.isArray(props) ? { children: props } : props;
|
|
16917
16928
|
const { children = [] } = props;
|
|
16918
|
-
|
|
16929
|
+
import_core18.log.assert(
|
|
16919
16930
|
children.every((child) => child instanceof ScenegraphNode),
|
|
16920
16931
|
"every child must an instance of ScenegraphNode"
|
|
16921
16932
|
);
|
|
@@ -16986,7 +16997,7 @@ void main(void) {
|
|
|
16986
16997
|
const pending = [{ node: this, depth: 0 }];
|
|
16987
16998
|
while (pending.length) {
|
|
16988
16999
|
const { node, depth } = pending.pop();
|
|
16989
|
-
(0,
|
|
17000
|
+
(0, import_core18.assert)(!visited.has(node));
|
|
16990
17001
|
visited.add(node);
|
|
16991
17002
|
ancestors.length = depth;
|
|
16992
17003
|
ancestors.push(node.id);
|
|
@@ -17122,12 +17133,12 @@ void main(void) {
|
|
|
17122
17133
|
}
|
|
17123
17134
|
|
|
17124
17135
|
// src/geometry/edge-geometry.ts
|
|
17125
|
-
var
|
|
17136
|
+
var import_core19 = __toESM(require_core(), 1);
|
|
17126
17137
|
function makeEdgeGeometry(geometry, options = {}) {
|
|
17127
17138
|
const { angleThreshold = 30, weldTolerance = 0, positionAttribute = "POSITION" } = options;
|
|
17128
17139
|
const positions = getTrianglePositions(geometry, positionAttribute);
|
|
17129
|
-
(0,
|
|
17130
|
-
(0,
|
|
17140
|
+
(0, import_core19.assert)(Number.isFinite(weldTolerance) && weldTolerance >= 0);
|
|
17141
|
+
(0, import_core19.assert)(Number.isFinite(angleThreshold) && angleThreshold >= 0 && angleThreshold <= 180);
|
|
17131
17142
|
const sourceIndices = geometry.indices?.value;
|
|
17132
17143
|
const sourceCount = positions.value.length / 3;
|
|
17133
17144
|
const representatives = /* @__PURE__ */ new Map();
|
|
@@ -17146,9 +17157,9 @@ void main(void) {
|
|
|
17146
17157
|
function weldPosition(index) {
|
|
17147
17158
|
const cached = representatives.get(index);
|
|
17148
17159
|
if (cached !== void 0) return cached;
|
|
17149
|
-
(0,
|
|
17160
|
+
(0, import_core19.assert)(Number.isInteger(index) && index >= 0 && index < sourceCount);
|
|
17150
17161
|
const position = readPosition(index);
|
|
17151
|
-
(0,
|
|
17162
|
+
(0, import_core19.assert)(position.every(Number.isFinite));
|
|
17152
17163
|
const cell = weldTolerance > 0 ? position.map((value) => Math.floor(value / weldTolerance)) : position;
|
|
17153
17164
|
const radius = weldTolerance > 0 ? 1 : 0;
|
|
17154
17165
|
for (let east = -radius; east <= radius; east++) {
|
|
@@ -17222,11 +17233,11 @@ void main(void) {
|
|
|
17222
17233
|
});
|
|
17223
17234
|
}
|
|
17224
17235
|
function makeEdgeGeometryFromGeometries(geometries, options = {}) {
|
|
17225
|
-
(0,
|
|
17236
|
+
(0, import_core19.assert)(geometries.length > 0);
|
|
17226
17237
|
const positionAttribute = options.positionAttribute ?? "POSITION";
|
|
17227
17238
|
const attributes = geometries.map((geometry) => getTrianglePositions(geometry, positionAttribute));
|
|
17228
17239
|
const firstAttribute = attributes[0];
|
|
17229
|
-
(0,
|
|
17240
|
+
(0, import_core19.assert)(
|
|
17230
17241
|
attributes.every(
|
|
17231
17242
|
(attribute) => attribute.value.constructor === firstAttribute.value.constructor && Boolean(attribute["normalized"]) === Boolean(firstAttribute["normalized"])
|
|
17232
17243
|
)
|
|
@@ -17245,7 +17256,7 @@ void main(void) {
|
|
|
17245
17256
|
positions.set(attribute.value, positionOffset);
|
|
17246
17257
|
for (let offset = 0; offset < geometry.vertexCount; offset++) {
|
|
17247
17258
|
const index = geometry.indices?.value[offset] ?? offset;
|
|
17248
|
-
(0,
|
|
17259
|
+
(0, import_core19.assert)(Number.isInteger(index) && index >= 0 && index < attribute.value.length / 3);
|
|
17249
17260
|
indices[indexOffset++] = index + positionOffset / 3;
|
|
17250
17261
|
}
|
|
17251
17262
|
positionOffset += attribute.value.length;
|
|
@@ -17262,26 +17273,26 @@ void main(void) {
|
|
|
17262
17273
|
}
|
|
17263
17274
|
function getTrianglePositions(geometry, positionAttribute) {
|
|
17264
17275
|
const positions = geometry.attributes[positionAttribute];
|
|
17265
|
-
(0,
|
|
17266
|
-
(0,
|
|
17267
|
-
(0,
|
|
17276
|
+
(0, import_core19.assert)(geometry.topology === "triangle-list" && positions?.size === 3);
|
|
17277
|
+
(0, import_core19.assert)(positions.value.length % 3 === 0 && geometry.vertexCount % 3 === 0);
|
|
17278
|
+
(0, import_core19.assert)(
|
|
17268
17279
|
!positions["byteStride"] || positions["byteStride"] === positions.value.BYTES_PER_ELEMENT * 3
|
|
17269
17280
|
);
|
|
17270
|
-
(0,
|
|
17281
|
+
(0, import_core19.assert)(
|
|
17271
17282
|
geometry.vertexCount >= 0 && geometry.vertexCount <= (geometry.indices?.value.length ?? positions.value.length / 3)
|
|
17272
17283
|
);
|
|
17273
17284
|
return positions;
|
|
17274
17285
|
}
|
|
17275
17286
|
|
|
17276
17287
|
// src/geometry/stroke-geometry.ts
|
|
17277
|
-
var
|
|
17288
|
+
var import_core20 = __toESM(require_core(), 1);
|
|
17278
17289
|
function makeStrokeGeometry(path, options = {}) {
|
|
17279
17290
|
const { width = 1, cap = "butt", join = "miter", miterLimit = 4, roundSegments = 16 } = options;
|
|
17280
|
-
(0,
|
|
17281
|
-
(0,
|
|
17291
|
+
(0, import_core20.assert)(Number.isFinite(width) && width >= 0 && Number.isFinite(miterLimit) && miterLimit >= 1);
|
|
17292
|
+
(0, import_core20.assert)(Number.isInteger(roundSegments) && roundSegments >= 2 && roundSegments <= 256);
|
|
17282
17293
|
const points = [];
|
|
17283
17294
|
for (const position of path) {
|
|
17284
|
-
(0,
|
|
17295
|
+
(0, import_core20.assert)(
|
|
17285
17296
|
Number.isFinite(position[0]) && Number.isFinite(position[1]) && Number.isFinite(position[2] ?? 0)
|
|
17286
17297
|
);
|
|
17287
17298
|
const previous = points.at(-1);
|
|
@@ -17441,12 +17452,12 @@ void main(void) {
|
|
|
17441
17452
|
}
|
|
17442
17453
|
|
|
17443
17454
|
// src/geometry/mesh-simplification.ts
|
|
17444
|
-
var
|
|
17455
|
+
var import_core21 = __toESM(require_core(), 1);
|
|
17445
17456
|
var QUADRIC_COMPONENTS = 10;
|
|
17446
17457
|
var BOUNDARY_COLLINEAR_TOLERANCE = 1e-10;
|
|
17447
17458
|
function simplifyMesh(options) {
|
|
17448
17459
|
const { positions, indices, attributes = [], preserveBoundary = true } = options;
|
|
17449
|
-
(0,
|
|
17460
|
+
(0, import_core21.assert)(indices.length % 3 === 0 && positions.length % 3 === 0);
|
|
17450
17461
|
const targetIndexCount = Math.max(
|
|
17451
17462
|
0,
|
|
17452
17463
|
Math.min(
|
|
@@ -17539,7 +17550,7 @@ void main(void) {
|
|
|
17539
17550
|
const firstVertex = indices[indexOffset2];
|
|
17540
17551
|
const secondVertex = indices[indexOffset2 + 1];
|
|
17541
17552
|
const thirdVertex = indices[indexOffset2 + 2];
|
|
17542
|
-
(0,
|
|
17553
|
+
(0, import_core21.assert)(firstVertex < vertexCount && secondVertex < vertexCount && thirdVertex < vertexCount);
|
|
17543
17554
|
const triangle = {
|
|
17544
17555
|
vertices: [firstVertex, secondVertex, thirdVertex],
|
|
17545
17556
|
active: false
|
|
@@ -17874,7 +17885,7 @@ void main(void) {
|
|
|
17874
17885
|
}
|
|
17875
17886
|
|
|
17876
17887
|
// src/dynamic-texture/video-texture.ts
|
|
17877
|
-
var
|
|
17888
|
+
var import_core22 = __toESM(require_core(), 1);
|
|
17878
17889
|
var VideoTexture = class {
|
|
17879
17890
|
/** Device used to create copied and native external texture bindings. */
|
|
17880
17891
|
device;
|
|
@@ -17923,7 +17934,7 @@ void main(void) {
|
|
|
17923
17934
|
* @param props Live video source and copied texture options.
|
|
17924
17935
|
*/
|
|
17925
17936
|
constructor(device, props) {
|
|
17926
|
-
(0,
|
|
17937
|
+
(0, import_core22.assert)(isHTMLVideoElementSource(props?.source) || isVideoFrameSource(props?.source));
|
|
17927
17938
|
this.device = device;
|
|
17928
17939
|
this.id = props.id || uid("video-texture");
|
|
17929
17940
|
this._source = props.source;
|
|
@@ -17937,7 +17948,7 @@ void main(void) {
|
|
|
17937
17948
|
* @param source Next caller-owned video source to follow.
|
|
17938
17949
|
*/
|
|
17939
17950
|
setSource(source4) {
|
|
17940
|
-
(0,
|
|
17951
|
+
(0, import_core22.assert)(isHTMLVideoElementSource(source4) || isVideoFrameSource(source4));
|
|
17941
17952
|
this._destroyExternalTexture();
|
|
17942
17953
|
this._source = source4;
|
|
17943
17954
|
this._sourceVersion++;
|
|
@@ -18015,7 +18026,7 @@ void main(void) {
|
|
|
18015
18026
|
width: size.width,
|
|
18016
18027
|
height: size.height,
|
|
18017
18028
|
format: "rgba8unorm",
|
|
18018
|
-
usage:
|
|
18029
|
+
usage: import_core22.Texture.SAMPLE | import_core22.Texture.COPY_DST,
|
|
18019
18030
|
mipLevels: 1,
|
|
18020
18031
|
sampler: this._sampler
|
|
18021
18032
|
});
|
|
@@ -18050,7 +18061,7 @@ void main(void) {
|
|
|
18050
18061
|
*/
|
|
18051
18062
|
_getResolvedSize() {
|
|
18052
18063
|
const size = getVideoTextureSourceSize(this._source);
|
|
18053
|
-
(0,
|
|
18064
|
+
(0, import_core22.assert)(size.width > 0 && size.height > 0);
|
|
18054
18065
|
return size;
|
|
18055
18066
|
}
|
|
18056
18067
|
/** Observes current source readiness and frame identity before binding resolution. */
|
|
@@ -18115,11 +18126,11 @@ void main(void) {
|
|
|
18115
18126
|
}
|
|
18116
18127
|
|
|
18117
18128
|
// src/passes/shader-pass-renderer.ts
|
|
18118
|
-
var
|
|
18129
|
+
var import_core25 = __toESM(require_core(), 1);
|
|
18119
18130
|
var import_shaders7 = __toESM(require_shaders(), 1);
|
|
18120
18131
|
|
|
18121
18132
|
// src/compute/swap.ts
|
|
18122
|
-
var
|
|
18133
|
+
var import_core23 = __toESM(require_core(), 1);
|
|
18123
18134
|
var Swap = class {
|
|
18124
18135
|
id;
|
|
18125
18136
|
/** The current resource - usually the source for renders or computations */
|
|
@@ -18151,7 +18162,7 @@ void main(void) {
|
|
|
18151
18162
|
(colorAttachment) => typeof colorAttachment !== "string" ? colorAttachment : device.createTexture({
|
|
18152
18163
|
id: `${props.id}-texture-0`,
|
|
18153
18164
|
format: colorAttachment,
|
|
18154
|
-
usage:
|
|
18165
|
+
usage: import_core23.Texture.SAMPLE | import_core23.Texture.RENDER | import_core23.Texture.COPY_SRC | import_core23.Texture.COPY_DST,
|
|
18155
18166
|
width,
|
|
18156
18167
|
height
|
|
18157
18168
|
})
|
|
@@ -18161,7 +18172,7 @@ void main(void) {
|
|
|
18161
18172
|
(colorAttachment) => typeof colorAttachment !== "string" ? colorAttachment : device.createTexture({
|
|
18162
18173
|
id: `${props.id}-texture-1`,
|
|
18163
18174
|
format: colorAttachment,
|
|
18164
|
-
usage:
|
|
18175
|
+
usage: import_core23.Texture.SAMPLE | import_core23.Texture.RENDER | import_core23.Texture.COPY_SRC | import_core23.Texture.COPY_DST,
|
|
18165
18176
|
width,
|
|
18166
18177
|
height
|
|
18167
18178
|
})
|
|
@@ -18225,7 +18236,7 @@ void main(void) {
|
|
|
18225
18236
|
};
|
|
18226
18237
|
|
|
18227
18238
|
// src/compute/computation.ts
|
|
18228
|
-
var
|
|
18239
|
+
var import_core24 = __toESM(require_core(), 1);
|
|
18229
18240
|
var import_shaders6 = __toESM(require_shaders(), 1);
|
|
18230
18241
|
var LOG_DRAW_PRIORITY2 = 2;
|
|
18231
18242
|
var LOG_DRAW_TIMEOUT2 = 1e4;
|
|
@@ -18237,13 +18248,13 @@ void main(void) {
|
|
|
18237
18248
|
* constructor remains the synchronous compatibility path.
|
|
18238
18249
|
*/
|
|
18239
18250
|
static async createAsync(device, props) {
|
|
18240
|
-
const ownsCompilation = !
|
|
18241
|
-
const asyncCompilation = ownsCompilation ?
|
|
18251
|
+
const ownsCompilation = !import_core24.PipelineFactory.getAsyncCompilation(device);
|
|
18252
|
+
const asyncCompilation = ownsCompilation ? import_core24.PipelineFactory.beginAsyncCompilation(device) : import_core24.PipelineFactory.getAsyncCompilation(device);
|
|
18242
18253
|
let computation;
|
|
18243
18254
|
try {
|
|
18244
18255
|
computation = new _Computation(device, props);
|
|
18245
18256
|
} finally {
|
|
18246
|
-
if (ownsCompilation)
|
|
18257
|
+
if (ownsCompilation) import_core24.PipelineFactory.endAsyncCompilation(device, asyncCompilation);
|
|
18247
18258
|
}
|
|
18248
18259
|
try {
|
|
18249
18260
|
if (ownsCompilation) {
|
|
@@ -18258,7 +18269,7 @@ void main(void) {
|
|
|
18258
18269
|
}
|
|
18259
18270
|
}
|
|
18260
18271
|
static defaultProps = {
|
|
18261
|
-
...
|
|
18272
|
+
...import_core24.ComputePipeline.defaultProps,
|
|
18262
18273
|
id: "unnamed",
|
|
18263
18274
|
handle: void 0,
|
|
18264
18275
|
userData: {},
|
|
@@ -18333,10 +18344,10 @@ void main(void) {
|
|
|
18333
18344
|
const modules = mergeShaderModules(this.props.modules, this.shaderInputs?.getModules());
|
|
18334
18345
|
const defines = { ...resolvedPlugins.defines, ...this.props.defines };
|
|
18335
18346
|
this.props.shaderLayout = mergeShaderModuleBindingsIntoLayout(this.props.shaderLayout, modules) || null;
|
|
18336
|
-
this.pipelineFactory = props.pipelineFactory ||
|
|
18337
|
-
this.shaderFactory = props.shaderFactory ||
|
|
18347
|
+
this.pipelineFactory = props.pipelineFactory || import_core24.PipelineFactory.getDefaultPipelineFactory(this.device);
|
|
18348
|
+
this.shaderFactory = props.shaderFactory || import_core24.ShaderFactory.getDefaultShaderFactory(this.device);
|
|
18338
18349
|
const shaderAssembler = this.props.shaderAssembler;
|
|
18339
|
-
(0,
|
|
18350
|
+
(0, import_core24.assert)(shaderAssembler instanceof WGSLShaderAssembler);
|
|
18340
18351
|
const {
|
|
18341
18352
|
source: source4,
|
|
18342
18353
|
getUniforms: getUniforms2,
|
|
@@ -18360,7 +18371,7 @@ void main(void) {
|
|
|
18360
18371
|
this.props.shaderLayout || inferredShaderLayout || null,
|
|
18361
18372
|
modules
|
|
18362
18373
|
) || null;
|
|
18363
|
-
const asyncCompilation =
|
|
18374
|
+
const asyncCompilation = import_core24.PipelineFactory.getAsyncCompilation(this.device);
|
|
18364
18375
|
if (asyncCompilation) {
|
|
18365
18376
|
this._pipelineInitialization = this._updatePipelineAsync();
|
|
18366
18377
|
asyncCompilation.push(this._pipelineInitialization);
|
|
@@ -18427,7 +18438,7 @@ void main(void) {
|
|
|
18427
18438
|
}
|
|
18428
18439
|
setShaderInputs(shaderInputs) {
|
|
18429
18440
|
this.shaderInputs = shaderInputs;
|
|
18430
|
-
this._uniformStore = new
|
|
18441
|
+
this._uniformStore = new import_core24.UniformStore(this.device, this.shaderInputs.modules);
|
|
18431
18442
|
for (const [moduleName, module] of Object.entries(this.shaderInputs.modules)) {
|
|
18432
18443
|
if (shaderModuleHasUniforms(module)) {
|
|
18433
18444
|
const uniformBuffer = this._uniformStore.getManagedUniformBuffer(moduleName);
|
|
@@ -18496,7 +18507,7 @@ void main(void) {
|
|
|
18496
18507
|
if (!this._pipelineNeedsUpdate) return null;
|
|
18497
18508
|
const previousShader = this.pipeline ? this.shader : null;
|
|
18498
18509
|
if (this.pipeline) {
|
|
18499
|
-
|
|
18510
|
+
import_core24.log.log(1, `Model ${this.id}: Recreating pipeline because "${this._pipelineNeedsUpdate}".`)();
|
|
18500
18511
|
}
|
|
18501
18512
|
this._pipelineNeedsUpdate = false;
|
|
18502
18513
|
this.shader = this.shaderFactory.createShader({
|
|
@@ -18514,27 +18525,27 @@ void main(void) {
|
|
|
18514
18525
|
_lastLogTime = 0;
|
|
18515
18526
|
_logOpen = false;
|
|
18516
18527
|
_logDrawCallStart() {
|
|
18517
|
-
const logDrawTimeout =
|
|
18518
|
-
if (
|
|
18528
|
+
const logDrawTimeout = import_core24.log.level > 3 ? 0 : LOG_DRAW_TIMEOUT2;
|
|
18529
|
+
if (import_core24.log.level < 2 || Date.now() - this._lastLogTime < logDrawTimeout) {
|
|
18519
18530
|
return;
|
|
18520
18531
|
}
|
|
18521
18532
|
this._lastLogTime = Date.now();
|
|
18522
18533
|
this._logOpen = true;
|
|
18523
|
-
|
|
18534
|
+
import_core24.log.group(LOG_DRAW_PRIORITY2, `>>> DRAWING MODEL ${this.id}`, { collapsed: import_core24.log.level <= 2 })();
|
|
18524
18535
|
}
|
|
18525
18536
|
_logDrawCallEnd() {
|
|
18526
18537
|
if (this._logOpen) {
|
|
18527
18538
|
const uniformTable = this.shaderInputs.getDebugTable();
|
|
18528
|
-
|
|
18529
|
-
|
|
18539
|
+
import_core24.log.table(LOG_DRAW_PRIORITY2, uniformTable)();
|
|
18540
|
+
import_core24.log.groupEnd(LOG_DRAW_PRIORITY2)();
|
|
18530
18541
|
this._logOpen = false;
|
|
18531
18542
|
}
|
|
18532
18543
|
}
|
|
18533
18544
|
_drawCount = 0;
|
|
18534
18545
|
// TODO - fix typing of luma data types
|
|
18535
18546
|
_getBufferOrConstantValues(attribute, dataType) {
|
|
18536
|
-
const TypedArrayConstructor =
|
|
18537
|
-
const typedArray = attribute instanceof
|
|
18547
|
+
const TypedArrayConstructor = import_core24.dataTypeDecoder.getTypedArrayConstructor(dataType);
|
|
18548
|
+
const typedArray = attribute instanceof import_core24.Buffer ? new TypedArrayConstructor(attribute.debugData) : attribute;
|
|
18538
18549
|
return typedArray.toString();
|
|
18539
18550
|
}
|
|
18540
18551
|
};
|
|
@@ -19091,7 +19102,7 @@ vec2 shaderPassRenderer_getRenderTargetUV(vec2 textureUV) {
|
|
|
19091
19102
|
this.parameterBuffer = device.createBuffer({
|
|
19092
19103
|
id: `${optimization.name}-parameters`,
|
|
19093
19104
|
byteLength: Math.max(Math.ceil(optimization.uniformNames.length / 4) * 16, 16),
|
|
19094
|
-
usage:
|
|
19105
|
+
usage: import_core25.Buffer.UNIFORM | import_core25.Buffer.COPY_DST
|
|
19095
19106
|
});
|
|
19096
19107
|
const outputBindings = Object.entries(optimization.outputs).map(
|
|
19097
19108
|
([bindingName, targetName], outputIndex) => ({
|
|
@@ -19376,7 +19387,7 @@ vec2 shaderPassRenderer_getRenderTargetUV(vec2 textureUV) {
|
|
|
19376
19387
|
width: targetSize[0],
|
|
19377
19388
|
height: targetSize[1],
|
|
19378
19389
|
format: spec.format || device.preferredColorFormat,
|
|
19379
|
-
usage:
|
|
19390
|
+
usage: import_core25.Texture.SAMPLE | import_core25.Texture.RENDER | import_core25.Texture.COPY_SRC | import_core25.Texture.COPY_DST | (spec.storage && device.type === "webgpu" && device.getTextureFormatCapabilities(spec.format || device.preferredColorFormat).store ? import_core25.Texture.STORAGE : 0),
|
|
19380
19391
|
...spec.sampler ? { sampler: spec.sampler } : {}
|
|
19381
19392
|
});
|
|
19382
19393
|
const framebuffer = device.createFramebuffer({
|
|
@@ -19431,7 +19442,7 @@ vec2 shaderPassRenderer_getRenderTargetUV(vec2 textureUV) {
|
|
|
19431
19442
|
}
|
|
19432
19443
|
|
|
19433
19444
|
// src/modules/picking/picking-manager.ts
|
|
19434
|
-
var
|
|
19445
|
+
var import_core26 = __toESM(require_core(), 1);
|
|
19435
19446
|
|
|
19436
19447
|
// src/modules/picking/picking-uniforms.ts
|
|
19437
19448
|
var DEFAULT_HIGHLIGHT_COLOR = [0, 1, 1, 1];
|
|
@@ -19695,13 +19706,13 @@ layout(std140) uniform pickingUniforms {
|
|
|
19695
19706
|
format: "rgba8unorm",
|
|
19696
19707
|
width: 1,
|
|
19697
19708
|
height: 1,
|
|
19698
|
-
usage:
|
|
19709
|
+
usage: import_core26.Texture.RENDER_ATTACHMENT
|
|
19699
19710
|
});
|
|
19700
19711
|
const pickingTexture = this.device.createTexture({
|
|
19701
19712
|
format: "rg32sint",
|
|
19702
19713
|
width: 1,
|
|
19703
19714
|
height: 1,
|
|
19704
|
-
usage:
|
|
19715
|
+
usage: import_core26.Texture.RENDER_ATTACHMENT | import_core26.Texture.COPY_SRC
|
|
19705
19716
|
});
|
|
19706
19717
|
return this.device.createFramebuffer({
|
|
19707
19718
|
colorAttachments: [colorTexture, pickingTexture],
|
|
@@ -19713,7 +19724,7 @@ layout(std140) uniform pickingUniforms {
|
|
|
19713
19724
|
format: "rgba8unorm",
|
|
19714
19725
|
width: 1,
|
|
19715
19726
|
height: 1,
|
|
19716
|
-
usage:
|
|
19727
|
+
usage: import_core26.Texture.RENDER_ATTACHMENT | import_core26.Texture.COPY_SRC
|
|
19717
19728
|
});
|
|
19718
19729
|
return this.device.createFramebuffer({
|
|
19719
19730
|
colorAttachments: [pickingTexture],
|
|
@@ -19735,7 +19746,7 @@ layout(std140) uniform pickingUniforms {
|
|
|
19735
19746
|
const layout = pickTexture.computeMemoryLayout({ width: 1, height: 1 });
|
|
19736
19747
|
const readBuffer = this.device.createBuffer({
|
|
19737
19748
|
byteLength: layout.byteLength,
|
|
19738
|
-
usage:
|
|
19749
|
+
usage: import_core26.Buffer.COPY_DST | import_core26.Buffer.MAP_READ
|
|
19739
19750
|
});
|
|
19740
19751
|
try {
|
|
19741
19752
|
pickTexture.readBuffer(
|
|
@@ -19771,7 +19782,7 @@ layout(std140) uniform pickingUniforms {
|
|
|
19771
19782
|
const layout = pickTexture.computeMemoryLayout({ width: 1, height: 1 });
|
|
19772
19783
|
const readBuffer = this.device.createBuffer({
|
|
19773
19784
|
byteLength: layout.byteLength,
|
|
19774
|
-
usage:
|
|
19785
|
+
usage: import_core26.Buffer.COPY_DST | import_core26.Buffer.MAP_READ
|
|
19775
19786
|
});
|
|
19776
19787
|
try {
|
|
19777
19788
|
pickTexture.readBuffer(
|
|
@@ -20453,7 +20464,7 @@ vec4 picking_filterColor(vec4 color) {
|
|
|
20453
20464
|
}
|
|
20454
20465
|
|
|
20455
20466
|
// src/scenegraph/controllers/skin-controller.ts
|
|
20456
|
-
var
|
|
20467
|
+
var import_core27 = __toESM(require_core(), 1);
|
|
20457
20468
|
var SkinController = class {
|
|
20458
20469
|
bindings;
|
|
20459
20470
|
scenes;
|
|
@@ -20484,7 +20495,7 @@ vec4 picking_filterColor(vec4 color) {
|
|
|
20484
20495
|
target: binding.jointMatrices
|
|
20485
20496
|
});
|
|
20486
20497
|
if (binding.skinJointMatrices) {
|
|
20487
|
-
if (binding.skinJointMatrices instanceof
|
|
20498
|
+
if (binding.skinJointMatrices instanceof import_core27.Buffer) {
|
|
20488
20499
|
binding.skinJointMatrices.write(binding.jointMatrices);
|
|
20489
20500
|
} else {
|
|
20490
20501
|
binding.skinJointMatrices.writeData(binding.jointMatrices, {
|
|
@@ -20516,7 +20527,7 @@ vec4 picking_filterColor(vec4 color) {
|
|
|
20516
20527
|
return device.createBuffer({
|
|
20517
20528
|
id: `${id}-skin-joint-matrices`,
|
|
20518
20529
|
byteLength: jointMatrices.byteLength,
|
|
20519
|
-
usage:
|
|
20530
|
+
usage: import_core27.Buffer.STORAGE | import_core27.Buffer.COPY_DST
|
|
20520
20531
|
});
|
|
20521
20532
|
}
|
|
20522
20533
|
const width = jointMatrices.length / 4;
|
|
@@ -20528,7 +20539,7 @@ vec4 picking_filterColor(vec4 color) {
|
|
|
20528
20539
|
format: "rgba32float",
|
|
20529
20540
|
width,
|
|
20530
20541
|
height: 1,
|
|
20531
|
-
usage:
|
|
20542
|
+
usage: import_core27.Texture.SAMPLE | import_core27.Texture.COPY_DST,
|
|
20532
20543
|
sampler: { minFilter: "nearest", magFilter: "nearest", mipmapFilter: "nearest" }
|
|
20533
20544
|
});
|
|
20534
20545
|
}
|
|
@@ -20571,7 +20582,7 @@ vec4 picking_filterColor(vec4 color) {
|
|
|
20571
20582
|
};
|
|
20572
20583
|
|
|
20573
20584
|
// src/scenegraph/controllers/billboard-controller.ts
|
|
20574
|
-
var
|
|
20585
|
+
var import_core28 = __toESM(require_core(), 1);
|
|
20575
20586
|
var BillboardController = class {
|
|
20576
20587
|
scenes;
|
|
20577
20588
|
bindings = /* @__PURE__ */ new Map();
|
|
@@ -20582,8 +20593,8 @@ vec4 picking_filterColor(vec4 color) {
|
|
|
20582
20593
|
const { definition } = binding;
|
|
20583
20594
|
const forward = new Vector3(definition.viewDirection || [0, 0, 1]);
|
|
20584
20595
|
const up = new Vector3(definition.up || [0, 1, 0]);
|
|
20585
|
-
(0,
|
|
20586
|
-
(0,
|
|
20596
|
+
(0, import_core28.assert)(forward.magnitude() > 0 && up.magnitude() > 0);
|
|
20597
|
+
(0, import_core28.assert)(
|
|
20587
20598
|
new Vector3(forward).normalize().cross(new Vector3(up).normalize()).magnitude() > 1e-6
|
|
20588
20599
|
);
|
|
20589
20600
|
this.bindings.set(binding.node, binding);
|
|
@@ -20593,7 +20604,7 @@ vec4 picking_filterColor(vec4 color) {
|
|
|
20593
20604
|
getDrawEntries(options) {
|
|
20594
20605
|
const { sceneIndex = 0, cameraId = "default" } = options;
|
|
20595
20606
|
const scene = this.scenes[sceneIndex];
|
|
20596
|
-
(0,
|
|
20607
|
+
(0, import_core28.assert)(scene);
|
|
20597
20608
|
const viewMatrix = new Matrix4(options.viewMatrix);
|
|
20598
20609
|
const cameraMatrix = new Matrix4(viewMatrix).invert();
|
|
20599
20610
|
const cameraPosition = new Vector3(cameraMatrix.getTranslation());
|
|
@@ -20793,7 +20804,7 @@ vec4 picking_filterColor(vec4 color) {
|
|
|
20793
20804
|
}
|
|
20794
20805
|
|
|
20795
20806
|
// src/scenegraph/controllers/area-light-controller.ts
|
|
20796
|
-
var
|
|
20807
|
+
var import_core29 = __toESM(require_core(), 1);
|
|
20797
20808
|
var AreaLightController = class {
|
|
20798
20809
|
scenes;
|
|
20799
20810
|
matrixAuthoredNodes = /* @__PURE__ */ new Set();
|
|
@@ -20803,11 +20814,11 @@ vec4 picking_filterColor(vec4 color) {
|
|
|
20803
20814
|
for (const node of matrixNodes) this.matrixAuthoredNodes.add(node);
|
|
20804
20815
|
for (const { node, definition, matrixAuthored } of bindings) {
|
|
20805
20816
|
if (matrixAuthored) this.matrixAuthoredNodes.add(node);
|
|
20806
|
-
(0,
|
|
20807
|
-
(0,
|
|
20808
|
-
(0,
|
|
20809
|
-
(0,
|
|
20810
|
-
(0,
|
|
20817
|
+
(0, import_core29.assert)(definition && (definition.type === "rect" || definition.type === "disk"));
|
|
20818
|
+
(0, import_core29.assert)(Number.isFinite(definition.height ?? 1) && (definition.height ?? 1) > 0);
|
|
20819
|
+
(0, import_core29.assert)(Number.isFinite(definition.intensity ?? 1e3) && (definition.intensity ?? 1e3) > 0);
|
|
20820
|
+
(0, import_core29.assert)(Number.isFinite(definition.width ?? 1) && (definition.width ?? 1) > 0);
|
|
20821
|
+
(0, import_core29.assert)(
|
|
20811
20822
|
(definition.color || [1, 1, 1]).every(
|
|
20812
20823
|
(component) => Number.isFinite(component) && component >= 0
|
|
20813
20824
|
)
|
|
@@ -20873,17 +20884,17 @@ vec4 picking_filterColor(vec4 color) {
|
|
|
20873
20884
|
function getMatrixRotation(matrix) {
|
|
20874
20885
|
const horizontal = new Vector3(matrix[0], matrix[1], matrix[2]);
|
|
20875
20886
|
const vertical = new Vector3(matrix[4], matrix[5], matrix[6]);
|
|
20876
|
-
(0,
|
|
20887
|
+
(0, import_core29.assert)(horizontal.magnitude() > 0 && vertical.magnitude() > 0);
|
|
20877
20888
|
horizontal.normalize();
|
|
20878
20889
|
vertical.normalize();
|
|
20879
20890
|
vertical.subtract(new Vector3(horizontal).scale(vertical.dot(horizontal)));
|
|
20880
|
-
(0,
|
|
20891
|
+
(0, import_core29.assert)(vertical.magnitude() > 1e-8);
|
|
20881
20892
|
vertical.normalize();
|
|
20882
20893
|
const forward = new Vector3(horizontal).cross(vertical).normalize();
|
|
20883
20894
|
const authoredForward = new Vector3(matrix[8], matrix[9], matrix[10]);
|
|
20884
|
-
(0,
|
|
20895
|
+
(0, import_core29.assert)(authoredForward.magnitude() > 0);
|
|
20885
20896
|
authoredForward.normalize();
|
|
20886
|
-
(0,
|
|
20897
|
+
(0, import_core29.assert)(Math.abs(forward.dot(authoredForward)) > 1e-8);
|
|
20887
20898
|
if (forward.dot(authoredForward) < 0) forward.negate();
|
|
20888
20899
|
return new Matrix4([
|
|
20889
20900
|
horizontal[0],
|
|
@@ -21441,15 +21452,15 @@ vec4 picking_filterColor(vec4 color) {
|
|
|
21441
21452
|
};
|
|
21442
21453
|
|
|
21443
21454
|
// src/audio/audio-graph.ts
|
|
21444
|
-
var
|
|
21455
|
+
var import_core30 = __toESM(require_core(), 1);
|
|
21445
21456
|
var AudioGraph = class {
|
|
21446
21457
|
constructor(definition, context, destination, getEmitterInputs) {
|
|
21447
21458
|
this.definition = definition;
|
|
21448
21459
|
for (const node of definition.nodes)
|
|
21449
|
-
(0,
|
|
21460
|
+
(0, import_core30.assert)(!node.bypass || node.kind !== "splitter" && node.kind !== "channelmerger");
|
|
21450
21461
|
const validateEndpoint = (index, port = 0) => {
|
|
21451
|
-
(0,
|
|
21452
|
-
(0,
|
|
21462
|
+
(0, import_core30.assert)(Number.isInteger(index) && Boolean(definition.nodes[index]));
|
|
21463
|
+
(0, import_core30.assert)(Number.isInteger(port) && port >= 0);
|
|
21453
21464
|
};
|
|
21454
21465
|
for (const edge of definition.connections) {
|
|
21455
21466
|
validateEndpoint(edge.from.node, edge.from.output);
|
|
@@ -21457,16 +21468,16 @@ vec4 picking_filterColor(vec4 color) {
|
|
|
21457
21468
|
}
|
|
21458
21469
|
for (const input of definition.inputs || []) {
|
|
21459
21470
|
validateEndpoint(input.node, input.input);
|
|
21460
|
-
(0,
|
|
21471
|
+
(0, import_core30.assert)(Number.isInteger(input.source) && input.source >= 0);
|
|
21461
21472
|
}
|
|
21462
21473
|
for (const output of definition.outputs || []) {
|
|
21463
21474
|
validateEndpoint(output.node, output.output);
|
|
21464
|
-
(0,
|
|
21475
|
+
(0, import_core30.assert)(Number.isInteger(output.emitter) && output.emitter >= 0);
|
|
21465
21476
|
}
|
|
21466
21477
|
const visiting = /* @__PURE__ */ new Set();
|
|
21467
21478
|
const visited = /* @__PURE__ */ new Set();
|
|
21468
21479
|
const visit = (index) => {
|
|
21469
|
-
(0,
|
|
21480
|
+
(0, import_core30.assert)(definition.nodes[index] && !visiting.has(index));
|
|
21470
21481
|
if (visited.has(index)) return;
|
|
21471
21482
|
visiting.add(index);
|
|
21472
21483
|
for (const edge of definition.connections) if (edge.from.node === index) visit(edge.to.node);
|
|
@@ -21527,7 +21538,7 @@ vec4 picking_filterColor(vec4 color) {
|
|
|
21527
21538
|
/** Apply a scene-driven gain change using the authored transition shape. */
|
|
21528
21539
|
setGain(index, gain, time = this.nodes[index].context.currentTime) {
|
|
21529
21540
|
const definition = this.definition.nodes[index];
|
|
21530
|
-
(0,
|
|
21541
|
+
(0, import_core30.assert)(definition.kind === "gain" && !definition.bypass && gain >= 0);
|
|
21531
21542
|
const parameter = this.nodes[index].gain;
|
|
21532
21543
|
const duration = definition.params.duration ?? 0;
|
|
21533
21544
|
const initialGain = parameter.value;
|
|
@@ -21537,7 +21548,7 @@ vec4 picking_filterColor(vec4 color) {
|
|
|
21537
21548
|
parameter.setValueAtTime(gain, time);
|
|
21538
21549
|
} else if (definition.params.interpolation === "custom") {
|
|
21539
21550
|
const curve = definition.params.curve;
|
|
21540
|
-
(0,
|
|
21551
|
+
(0, import_core30.assert)(curve && curve.length >= 2 && curve.every((value) => value >= 0 && value <= 1));
|
|
21541
21552
|
parameter.setValueCurveAtTime(
|
|
21542
21553
|
Float32Array.from(curve, (value) => value * gain),
|
|
21543
21554
|
time,
|
|
@@ -21622,7 +21633,7 @@ vec4 picking_filterColor(vec4 color) {
|
|
|
21622
21633
|
}
|
|
21623
21634
|
|
|
21624
21635
|
// src/audio/audio-environment.ts
|
|
21625
|
-
var
|
|
21636
|
+
var import_core31 = __toESM(require_core(), 1);
|
|
21626
21637
|
function selectAudioEnvironmentZone(zones, position) {
|
|
21627
21638
|
let selected;
|
|
21628
21639
|
for (const zone of zones) {
|
|
@@ -21715,7 +21726,7 @@ vec4 picking_filterColor(vec4 color) {
|
|
|
21715
21726
|
}
|
|
21716
21727
|
};
|
|
21717
21728
|
function createParametricAudioResponse(context, parameters) {
|
|
21718
|
-
(0,
|
|
21729
|
+
(0, import_core31.assert)((parameters.density ?? 1) === 1 && (parameters.diffusion ?? 1) === 1);
|
|
21719
21730
|
const presets = {
|
|
21720
21731
|
generic: [1.49, 0.83, 7e-3, 0.011],
|
|
21721
21732
|
smallRoom: [0.4, 0.83, 2e-3, 3e-3],
|
|
@@ -21732,12 +21743,12 @@ vec4 picking_filterColor(vec4 color) {
|
|
|
21732
21743
|
underwater: [1.49, 0.1, 7e-3, 0.011]
|
|
21733
21744
|
};
|
|
21734
21745
|
const preset = parameters.preset ? presets[parameters.preset] : void 0;
|
|
21735
|
-
(0,
|
|
21746
|
+
(0, import_core31.assert)(!parameters.preset || preset);
|
|
21736
21747
|
const decay = parameters.decayTime ?? preset?.[0] ?? 1.5;
|
|
21737
21748
|
const highFrequencyDecay = decay * (parameters.decayHFRatio ?? preset?.[1] ?? 0.83);
|
|
21738
21749
|
const earlyDelay = parameters.reflectionsDelay ?? preset?.[2] ?? 0.02;
|
|
21739
21750
|
const tailDelay = earlyDelay + (parameters.reverbDelay ?? preset?.[3] ?? 0.04);
|
|
21740
|
-
(0,
|
|
21751
|
+
(0, import_core31.assert)(decay > 0 && highFrequencyDecay > 0 && earlyDelay >= 0 && tailDelay >= earlyDelay);
|
|
21741
21752
|
const response = context.createBuffer(
|
|
21742
21753
|
2,
|
|
21743
21754
|
Math.ceil((tailDelay + Math.max(decay, highFrequencyDecay)) * context.sampleRate),
|
|
@@ -21761,7 +21772,7 @@ vec4 picking_filterColor(vec4 color) {
|
|
|
21761
21772
|
}
|
|
21762
21773
|
|
|
21763
21774
|
// src/audio/audio-controller.ts
|
|
21764
|
-
var
|
|
21775
|
+
var import_core32 = __toESM(require_core(), 1);
|
|
21765
21776
|
var AudioController = class {
|
|
21766
21777
|
gain;
|
|
21767
21778
|
definition;
|
|
@@ -21871,25 +21882,25 @@ vec4 picking_filterColor(vec4 color) {
|
|
|
21871
21882
|
/** Change a graph gain using its authored interpolation and duration. */
|
|
21872
21883
|
setGraphGain(graphIndex, nodeIndex, gain) {
|
|
21873
21884
|
const graph = this.graphs.get(graphIndex);
|
|
21874
|
-
(0,
|
|
21885
|
+
(0, import_core32.assert)(!this.destroyed && graph);
|
|
21875
21886
|
graph.setGain(nodeIndex, gain);
|
|
21876
21887
|
}
|
|
21877
21888
|
startSource(sourceIndex, startTime, autoplayOnly, connect) {
|
|
21878
21889
|
const definition = this.definition.sources[sourceIndex];
|
|
21879
|
-
(0,
|
|
21890
|
+
(0, import_core32.assert)(definition);
|
|
21880
21891
|
if (autoplayOnly && !definition.autoPlay) return;
|
|
21881
21892
|
const context = this.options.audioContext;
|
|
21882
21893
|
const extended = definition.graph;
|
|
21883
21894
|
const oscillator = extended?.oscillator;
|
|
21884
|
-
(0,
|
|
21895
|
+
(0, import_core32.assert)(!(definition.audio !== void 0 && oscillator));
|
|
21885
21896
|
let source4;
|
|
21886
21897
|
if (oscillator) {
|
|
21887
21898
|
const node = context.createOscillator();
|
|
21888
21899
|
node.frequency.value = oscillator.frequency ?? 440;
|
|
21889
21900
|
node.detune.value = oscillator.detune ?? 0;
|
|
21890
|
-
(0,
|
|
21901
|
+
(0, import_core32.assert)(oscillator.pulseWidth === void 0 || oscillator.pulseWidth === 0.5);
|
|
21891
21902
|
if (oscillator.type === "custom") {
|
|
21892
|
-
(0,
|
|
21903
|
+
(0, import_core32.assert)(oscillator.periodicWave);
|
|
21893
21904
|
node.setPeriodicWave(
|
|
21894
21905
|
context.createPeriodicWave(
|
|
21895
21906
|
new Float32Array(oscillator.periodicWave.real),
|
|
@@ -21900,7 +21911,7 @@ vec4 picking_filterColor(vec4 color) {
|
|
|
21900
21911
|
source4 = node;
|
|
21901
21912
|
} else {
|
|
21902
21913
|
const node = context.createBufferSource();
|
|
21903
|
-
(0,
|
|
21914
|
+
(0, import_core32.assert)(definition.audio !== void 0);
|
|
21904
21915
|
node.buffer = this.buffers.get(definition.audio);
|
|
21905
21916
|
node.loop = definition.loop ?? false;
|
|
21906
21917
|
node.loopStart = extended?.loopStart ?? 0;
|
|
@@ -22045,15 +22056,15 @@ vec4 picking_filterColor(vec4 color) {
|
|
|
22045
22056
|
}
|
|
22046
22057
|
addEmitter(index, node) {
|
|
22047
22058
|
const definition = this.definition.emitters[index];
|
|
22048
|
-
(0,
|
|
22059
|
+
(0, import_core32.assert)(
|
|
22049
22060
|
definition && (definition.type === "global" || definition.type === "positional" && node)
|
|
22050
22061
|
);
|
|
22051
|
-
(0,
|
|
22062
|
+
(0, import_core32.assert)(
|
|
22052
22063
|
!definition.positional?.shapeType || ["cone", "omnidirectional"].includes(definition.positional.shapeType)
|
|
22053
22064
|
);
|
|
22054
22065
|
for (const sourceIndex of this.graphEmitters.has(index) ? [] : definition.sources || []) {
|
|
22055
22066
|
const source4 = this.definition.sources[sourceIndex];
|
|
22056
|
-
(0,
|
|
22067
|
+
(0, import_core32.assert)(
|
|
22057
22068
|
source4 && (source4.audio !== void 0 ? this.definition.audio[source4.audio] : source4.graph?.oscillator)
|
|
22058
22069
|
);
|
|
22059
22070
|
}
|
|
@@ -22098,7 +22109,7 @@ vec4 picking_filterColor(vec4 color) {
|
|
|
22098
22109
|
const audioIndices = new Set(
|
|
22099
22110
|
[...sourceIndices].map((index) => {
|
|
22100
22111
|
const source4 = this.definition.sources[index];
|
|
22101
|
-
(0,
|
|
22112
|
+
(0, import_core32.assert)(
|
|
22102
22113
|
source4 && (source4.audio !== void 0 ? this.definition.audio[source4.audio] : source4.graph?.oscillator)
|
|
22103
22114
|
);
|
|
22104
22115
|
return source4.audio;
|
|
@@ -22135,7 +22146,7 @@ vec4 picking_filterColor(vec4 color) {
|
|
|
22135
22146
|
const reverb = environment.reverb;
|
|
22136
22147
|
if (!reverb) return;
|
|
22137
22148
|
const response = reverb.type === "impulseResponse" ? this.buffers.get(reverb.audio) : createParametricAudioResponse(audioContext, reverb);
|
|
22138
|
-
(0,
|
|
22149
|
+
(0, import_core32.assert)(response);
|
|
22139
22150
|
const bus = new AudioReverbBus(audioContext, response, this.gain, {
|
|
22140
22151
|
...reverb,
|
|
22141
22152
|
normalize: reverb.type === "impulseResponse" ? reverb.normalize : false
|
|
@@ -22244,7 +22255,7 @@ vec4 picking_filterColor(vec4 color) {
|
|
|
22244
22255
|
var legacyColorPicking = import_shaders9.picking;
|
|
22245
22256
|
|
|
22246
22257
|
// src/geometry/ring-geometry.ts
|
|
22247
|
-
var
|
|
22258
|
+
var import_core33 = __toESM(require_core(), 1);
|
|
22248
22259
|
var RingGeometry = class extends Geometry2 {
|
|
22249
22260
|
constructor(props = {}) {
|
|
22250
22261
|
const {
|
|
@@ -22255,7 +22266,7 @@ vec4 picking_filterColor(vec4 color) {
|
|
|
22255
22266
|
startAngle = 0,
|
|
22256
22267
|
angle: angle2 = Math.PI * 2
|
|
22257
22268
|
} = props;
|
|
22258
|
-
(0,
|
|
22269
|
+
(0, import_core33.assert)(
|
|
22259
22270
|
Number.isFinite(innerRadius) && innerRadius >= 0 && Number.isFinite(outerRadius) && outerRadius > innerRadius && Number.isFinite(height) && height > 0 && Number.isFinite(startAngle) && Number.isFinite(angle2) && angle2 > 0 && angle2 <= Math.PI * 2 && Number.isInteger(segments) && segments >= 3
|
|
22260
22271
|
);
|
|
22261
22272
|
const halfHeight = height / 2;
|
|
@@ -22439,7 +22450,7 @@ struct PublishedTransforms {bodyIndex:i32,viewProjection:mat4x4f}
|
|
|
22439
22450
|
};
|
|
22440
22451
|
|
|
22441
22452
|
// src/scenegraph/controllers/morph-controller.ts
|
|
22442
|
-
var
|
|
22453
|
+
var import_core34 = __toESM(require_core(), 1);
|
|
22443
22454
|
function setMorphWeights(node, weights) {
|
|
22444
22455
|
node.userData["morphWeights"] = [...weights];
|
|
22445
22456
|
const meshes = node.userData["morphMeshes"] || [];
|
|
@@ -22466,7 +22477,7 @@ struct PublishedTransforms {bodyIndex:i32,viewProjection:mat4x4f}
|
|
|
22466
22477
|
function updateMorphWeights(state, weights) {
|
|
22467
22478
|
state.values.fill(0);
|
|
22468
22479
|
state.values.set(weights.slice(0, state.values.length));
|
|
22469
|
-
if (state.data instanceof
|
|
22480
|
+
if (state.data instanceof import_core34.Buffer) {
|
|
22470
22481
|
state.data.write(state.values);
|
|
22471
22482
|
} else {
|
|
22472
22483
|
state.data.writeData(state.values, { width: state.packedTargetCount, height: 1 });
|