@luma.gl/engine 10.0.0-alpha.9 → 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/LICENSE +4 -4
- package/THIRD-PARTY-NOTICES.md +185 -0
- package/dist/animation/deform-positions.d.ts +1 -1
- package/dist/animation/deform-positions.d.ts.map +1 -1
- package/dist/animation/node-animation-binding.cjs +10 -0
- package/dist/animation/node-animation-binding.d.ts +1 -1
- package/dist/animation/node-animation-binding.d.ts.map +1 -1
- package/dist/animation/node-animation-binding.js +10 -0
- package/dist/animation/node-animation-binding.js.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 +14 -15
- package/dist/arrow/renderers/splats/conversion/make-gpu-splat-data-from-gltf.d.ts.map +1 -1
- package/dist/arrow/renderers/splats/conversion/make-gpu-splat-data-from-gltf.js +23 -18
- package/dist/arrow/renderers/splats/conversion/make-gpu-splat-data-from-gltf.js.map +1 -1
- package/dist/arrow/renderers/text/renderers/arrow-text-shaders.cjs +1 -1
- package/dist/arrow/renderers/text/renderers/arrow-text-shaders.js +1 -1
- package/dist/arrow/renderers/text/renderers/arrow-text-shaders.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.cjs +1 -1
- package/dist/compute/computation.d.ts +1 -1
- package/dist/compute/computation.d.ts.map +1 -1
- package/dist/compute/computation.js +1 -1
- package/dist/compute/computation.js.map +1 -1
- package/dist/compute/swap.d.ts +2 -2
- package/dist/compute/swap.d.ts.map +1 -1
- package/dist/compute/swap.js.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 +1087 -570
- package/dist/dist.min.js +74 -67
- package/dist/dynamic-texture/video-texture.cjs +1 -1
- package/dist/dynamic-texture/video-texture.d.ts +3 -3
- package/dist/dynamic-texture/video-texture.d.ts.map +1 -1
- package/dist/dynamic-texture/video-texture.js +1 -1
- package/dist/dynamic-texture/video-texture.js.map +1 -1
- package/dist/effects/index.cjs.map +1 -1
- package/dist/effects/passes/postprocessing/fxaa/fxaa.d.ts.map +1 -1
- package/dist/effects/passes/postprocessing/fxaa/fxaa.js +2 -1
- package/dist/effects/passes/postprocessing/fxaa/fxaa.js.map +1 -1
- package/dist/effects/passes/postprocessing/image-adjust-filters/brightnesscontrast.d.ts.map +1 -1
- package/dist/effects/passes/postprocessing/image-adjust-filters/brightnesscontrast.js +2 -0
- package/dist/effects/passes/postprocessing/image-adjust-filters/brightnesscontrast.js.map +1 -1
- package/dist/effects/passes/postprocessing/image-adjust-filters/denoise.d.ts.map +1 -1
- package/dist/effects/passes/postprocessing/image-adjust-filters/denoise.js +2 -0
- package/dist/effects/passes/postprocessing/image-adjust-filters/denoise.js.map +1 -1
- package/dist/effects/passes/postprocessing/image-adjust-filters/huesaturation.d.ts.map +1 -1
- package/dist/effects/passes/postprocessing/image-adjust-filters/huesaturation.js +2 -0
- package/dist/effects/passes/postprocessing/image-adjust-filters/huesaturation.js.map +1 -1
- package/dist/effects/passes/postprocessing/image-adjust-filters/noise.d.ts.map +1 -1
- package/dist/effects/passes/postprocessing/image-adjust-filters/noise.js +2 -0
- package/dist/effects/passes/postprocessing/image-adjust-filters/noise.js.map +1 -1
- package/dist/effects/passes/postprocessing/image-adjust-filters/sepia.d.ts.map +1 -1
- package/dist/effects/passes/postprocessing/image-adjust-filters/sepia.js +2 -0
- package/dist/effects/passes/postprocessing/image-adjust-filters/sepia.js.map +1 -1
- package/dist/effects/passes/postprocessing/image-adjust-filters/vibrance.d.ts.map +1 -1
- package/dist/effects/passes/postprocessing/image-adjust-filters/vibrance.js +2 -0
- package/dist/effects/passes/postprocessing/image-adjust-filters/vibrance.js.map +1 -1
- package/dist/effects/passes/postprocessing/image-adjust-filters/vignette.d.ts.map +1 -1
- package/dist/effects/passes/postprocessing/image-adjust-filters/vignette.js +2 -0
- package/dist/effects/passes/postprocessing/image-adjust-filters/vignette.js.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/animations/animations.d.ts +1 -1
- package/dist/gltf/gltf/animations/animations.d.ts.map +1 -1
- package/dist/gltf/gltf/create-gltf-model.cjs +3 -0
- 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/create-gltf-model.js +4 -0
- package/dist/gltf/gltf/create-gltf-model.js.map +1 -1
- package/dist/gltf/gltf/create-scenegraph-from-gltf.cjs +80 -12
- package/dist/gltf/gltf/create-scenegraph-from-gltf.d.ts +8 -1
- package/dist/gltf/gltf/create-scenegraph-from-gltf.d.ts.map +1 -1
- package/dist/gltf/gltf/create-scenegraph-from-gltf.js +82 -14
- package/dist/gltf/gltf/create-scenegraph-from-gltf.js.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-billboard.cjs +6 -1
- package/dist/gltf/gltf/gltf-billboard.d.ts.map +1 -1
- package/dist/gltf/gltf/gltf-billboard.js +6 -1
- package/dist/gltf/gltf/gltf-billboard.js.map +1 -1
- package/dist/gltf/gltf/gltf-extension-support.cjs +2 -2
- package/dist/gltf/gltf/gltf-extension-support.js +2 -2
- package/dist/gltf/gltf/gltf-extension-support.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 +2 -0
- package/dist/gltf/index.cjs.map +3 -3
- package/dist/gltf/index.d.ts +1 -1
- package/dist/gltf/index.d.ts.map +1 -1
- package/dist/gltf/index.js +1 -1
- package/dist/gltf/index.js.map +1 -1
- package/dist/gltf/parsers/parse-gltf-animations.cjs +8 -5
- package/dist/gltf/parsers/parse-gltf-animations.js +20 -5
- package/dist/gltf/parsers/parse-gltf-animations.js.map +1 -1
- package/dist/gltf/parsers/parse-gltf-lights.cjs +41 -77
- package/dist/gltf/parsers/parse-gltf-lights.d.ts +6 -2
- package/dist/gltf/parsers/parse-gltf-lights.d.ts.map +1 -1
- package/dist/gltf/parsers/parse-gltf-lights.js +35 -92
- package/dist/gltf/parsers/parse-gltf-lights.js.map +1 -1
- package/dist/gltf/parsers/parse-gltf-metadata.cjs +60 -0
- package/dist/gltf/parsers/parse-gltf-metadata.d.ts +5 -0
- package/dist/gltf/parsers/parse-gltf-metadata.d.ts.map +1 -0
- package/dist/gltf/parsers/parse-gltf-metadata.js +39 -0
- package/dist/gltf/parsers/parse-gltf-metadata.js.map +1 -0
- package/dist/gltf/parsers/parse-gltf.cjs +4 -1
- package/dist/gltf/parsers/parse-gltf.d.ts +10 -2
- package/dist/gltf/parsers/parse-gltf.d.ts.map +1 -1
- package/dist/gltf/parsers/parse-gltf.js +3 -0
- package/dist/gltf/parsers/parse-gltf.js.map +1 -1
- package/dist/gltf/parsers/parse-pbr-material.cjs +40 -30
- package/dist/gltf/parsers/parse-pbr-material.d.ts +7 -2
- package/dist/gltf/parsers/parse-pbr-material.d.ts.map +1 -1
- package/dist/gltf/parsers/parse-pbr-material.js +18 -6
- package/dist/gltf/parsers/parse-pbr-material.js.map +1 -1
- package/dist/gltf/pbr/pbr-environment.cjs +21 -3
- package/dist/gltf/pbr/pbr-environment.d.ts +3 -0
- package/dist/gltf/pbr/pbr-environment.d.ts.map +1 -1
- package/dist/gltf/pbr/pbr-environment.js +19 -1
- package/dist/gltf/pbr/pbr-environment.js.map +1 -1
- package/dist/gltf/pbr/pbr-material.d.ts +3 -3
- package/dist/gltf/pbr/pbr-material.d.ts.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/gltf/types/gltf-json-schema.d.ts.map +1 -1
- package/dist/gltf/types/gltf-json-schema.js +1 -0
- package/dist/gltf/types/gltf-json-schema.js.map +1 -1
- package/dist/gltf/types/gltf-postprocessed-schema.d.ts.map +1 -1
- package/dist/gltf/types/gltf-postprocessed-schema.js +1 -0
- package/dist/gltf/types/gltf-postprocessed-schema.js.map +1 -1
- package/dist/graph/models/index.cjs.map +2 -2
- package/dist/graph/models/path/path-attribute-model.cjs +4 -1
- package/dist/graph/models/path/path-attribute-model.d.ts +3 -1
- package/dist/graph/models/path/path-attribute-model.d.ts.map +1 -1
- package/dist/graph/models/path/path-attribute-model.js +6 -1
- package/dist/graph/models/path/path-attribute-model.js.map +1 -1
- package/dist/graph/models/path/path-storage-model.cjs +12 -9
- package/dist/graph/models/path/path-storage-model.d.ts +4 -2
- package/dist/graph/models/path/path-storage-model.d.ts.map +1 -1
- package/dist/graph/models/path/path-storage-model.js +8 -3
- package/dist/graph/models/path/path-storage-model.js.map +1 -1
- 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 +106 -0
- package/dist/graph/physics/physics-controller.d.ts +41 -3
- package/dist/graph/physics/physics-controller.d.ts.map +1 -1
- package/dist/graph/physics/physics-controller.js +106 -0
- 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 +16 -2
- package/dist/graph/physics/scenegraph-instance.d.ts.map +1 -1
- package/dist/graph/physics/scenegraph-instance.js +17 -1
- 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/gpu-table-model.cjs +2 -2
- package/dist/graph/tables/gpu-table-model.d.ts +2 -1
- package/dist/graph/tables/gpu-table-model.d.ts.map +1 -1
- package/dist/graph/tables/gpu-table-model.js +2 -2
- package/dist/graph/tables/gpu-table-model.js.map +1 -1
- package/dist/graph/tables/index.cjs.map +2 -2
- package/dist/index.cjs +13 -0
- package/dist/index.cjs.map +3 -3
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/lighting/ambient-occlusion-pass.cjs +126 -0
- package/dist/lighting/ambient-occlusion-pass.d.ts +32 -0
- package/dist/lighting/ambient-occlusion-pass.d.ts.map +1 -0
- package/dist/lighting/ambient-occlusion-pass.js +108 -0
- package/dist/lighting/ambient-occlusion-pass.js.map +1 -0
- package/dist/lighting/clustered-light-grid.cjs +378 -0
- package/dist/lighting/clustered-light-grid.d.ts +94 -0
- package/dist/lighting/clustered-light-grid.d.ts.map +1 -0
- package/dist/lighting/clustered-light-grid.js +370 -0
- package/dist/lighting/clustered-light-grid.js.map +1 -0
- package/dist/lighting/contact-shadow-composite.cjs +80 -0
- package/dist/lighting/contact-shadow-composite.d.ts +6 -0
- package/dist/lighting/contact-shadow-composite.d.ts.map +1 -0
- package/dist/lighting/contact-shadow-composite.js +59 -0
- package/dist/lighting/contact-shadow-composite.js.map +1 -0
- package/dist/lighting/contact-shadow-pass.cjs +102 -0
- package/dist/lighting/contact-shadow-pass.d.ts +24 -0
- package/dist/lighting/contact-shadow-pass.d.ts.map +1 -0
- package/dist/lighting/contact-shadow-pass.js +85 -0
- package/dist/lighting/contact-shadow-pass.js.map +1 -0
- package/dist/lighting/index.cjs +128 -0
- package/dist/lighting/index.cjs.map +6 -0
- package/dist/lighting/index.d.ts +35 -0
- package/dist/lighting/index.d.ts.map +1 -0
- package/dist/lighting/index.js +22 -0
- package/dist/lighting/index.js.map +1 -0
- package/dist/lighting/lightmap-atlas.cjs +246 -0
- package/dist/lighting/lightmap-atlas.d.ts +53 -0
- package/dist/lighting/lightmap-atlas.d.ts.map +1 -0
- package/dist/lighting/lightmap-atlas.js +279 -0
- package/dist/lighting/lightmap-atlas.js.map +1 -0
- package/dist/lighting/lightmap-baker.cjs +238 -0
- package/dist/lighting/lightmap-baker.d.ts +62 -0
- package/dist/lighting/lightmap-baker.d.ts.map +1 -0
- package/dist/lighting/lightmap-baker.js +236 -0
- package/dist/lighting/lightmap-baker.js.map +1 -0
- package/dist/lighting/lightmap-data.cjs +117 -0
- package/dist/lighting/lightmap-data.d.ts +20 -0
- package/dist/lighting/lightmap-data.d.ts.map +1 -0
- package/dist/lighting/lightmap-data.js +110 -0
- package/dist/lighting/lightmap-data.js.map +1 -0
- package/dist/lighting/lightmap-environment.cjs +61 -0
- package/dist/lighting/lightmap-environment.d.ts +18 -0
- package/dist/lighting/lightmap-environment.d.ts.map +1 -0
- package/dist/lighting/lightmap-environment.js +46 -0
- package/dist/lighting/lightmap-environment.js.map +1 -0
- package/dist/lighting/pbr-environment.cjs +45 -0
- package/dist/lighting/pbr-environment.d.ts +25 -0
- package/dist/lighting/pbr-environment.d.ts.map +1 -0
- package/dist/lighting/pbr-environment.js +30 -0
- package/dist/lighting/pbr-environment.js.map +1 -0
- package/dist/lighting/pbr-material.cjs +75 -0
- package/dist/lighting/pbr-material.d.ts +33 -0
- package/dist/lighting/pbr-material.d.ts.map +1 -0
- package/dist/lighting/pbr-material.js +52 -0
- package/dist/lighting/pbr-material.js.map +1 -0
- package/dist/lighting/pbr-model.cjs +579 -0
- package/dist/lighting/pbr-model.d.ts +45 -0
- package/dist/lighting/pbr-model.d.ts.map +1 -0
- package/dist/lighting/pbr-model.js +545 -0
- package/dist/lighting/pbr-model.js.map +1 -0
- package/dist/lighting/pbr-surface-pass.cjs +116 -0
- package/dist/lighting/pbr-surface-pass.d.ts +35 -0
- package/dist/lighting/pbr-surface-pass.d.ts.map +1 -0
- package/dist/lighting/pbr-surface-pass.js +98 -0
- package/dist/lighting/pbr-surface-pass.js.map +1 -0
- package/dist/lighting/prefiltered-environment.cjs +275 -0
- package/dist/lighting/prefiltered-environment.d.ts +56 -0
- package/dist/lighting/prefiltered-environment.d.ts.map +1 -0
- package/dist/lighting/prefiltered-environment.js +264 -0
- package/dist/lighting/prefiltered-environment.js.map +1 -0
- package/dist/lighting/reflection-probe.cjs +321 -0
- package/dist/lighting/reflection-probe.d.ts +78 -0
- package/dist/lighting/reflection-probe.d.ts.map +1 -0
- package/dist/lighting/reflection-probe.js +298 -0
- package/dist/lighting/reflection-probe.js.map +1 -0
- package/dist/lighting/shadow-map-renderer.cjs +631 -0
- package/dist/lighting/shadow-map-renderer.d.ts +92 -0
- package/dist/lighting/shadow-map-renderer.d.ts.map +1 -0
- package/dist/lighting/shadow-map-renderer.js +622 -0
- package/dist/lighting/shadow-map-renderer.js.map +1 -0
- package/dist/lighting/shadow-quality.cjs +58 -0
- package/dist/lighting/shadow-quality.d.ts +13 -0
- package/dist/lighting/shadow-quality.d.ts.map +1 -0
- package/dist/lighting/shadow-quality.js +37 -0
- package/dist/lighting/shadow-quality.js.map +1 -0
- package/dist/material/material.cjs +3 -0
- package/dist/material/material.d.ts +2 -0
- package/dist/material/material.d.ts.map +1 -1
- package/dist/material/material.js +3 -0
- package/dist/material/material.js.map +1 -1
- package/dist/model/gpu-vector-model.cjs +20 -3
- package/dist/model/gpu-vector-model.d.ts +20 -2
- package/dist/model/gpu-vector-model.d.ts.map +1 -1
- package/dist/model/gpu-vector-model.js +21 -3
- package/dist/model/gpu-vector-model.js.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 +4 -4
- package/dist/models/light-model-utils.d.ts +3 -2
- package/dist/models/light-model-utils.d.ts.map +1 -1
- package/dist/models/light-model-utils.js +3 -3
- 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 +121 -0
- package/dist/scenegraph/controllers/punctual-light-controller.d.ts +31 -0
- package/dist/scenegraph/controllers/punctual-light-controller.d.ts.map +1 -0
- package/dist/scenegraph/controllers/punctual-light-controller.js +117 -0
- package/dist/scenegraph/controllers/punctual-light-controller.js.map +1 -0
- 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/scene-metadata.cjs +43 -0
- package/dist/scenegraph/scene-metadata.d.ts +9 -0
- package/dist/scenegraph/scene-metadata.d.ts.map +1 -0
- package/dist/scenegraph/scene-metadata.js +21 -0
- package/dist/scenegraph/scene-metadata.js.map +1 -0
- 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-interaction.cjs +99 -0
- package/dist/scenegraph/scenegraph-interaction.d.ts +47 -0
- package/dist/scenegraph/scenegraph-interaction.d.ts.map +1 -0
- package/dist/scenegraph/scenegraph-interaction.js +79 -0
- package/dist/scenegraph/scenegraph-interaction.js.map +1 -0
- package/dist/scenegraph/scenegraph-node.cjs +17 -7
- package/dist/scenegraph/scenegraph-node.d.ts +12 -1
- package/dist/scenegraph/scenegraph-node.d.ts.map +1 -1
- package/dist/scenegraph/scenegraph-node.js +11 -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/experimental.cjs.map +1 -1
- package/dist/text/fonts/atlas/text-utils.cjs +1 -1
- package/dist/text/fonts/atlas/text-utils.js +1 -1
- package/dist/text/fonts/atlas/text-utils.js.map +1 -1
- package/dist/text/fonts/index.cjs.map +1 -1
- package/dist/text/index.cjs +2 -0
- package/dist/text/index.cjs.map +2 -2
- package/dist/text/index.d.ts +1 -1
- package/dist/text/index.d.ts.map +1 -1
- package/dist/text/index.js +1 -1
- package/dist/text/index.js.map +1 -1
- package/dist/text/text-2d/index.cjs +3 -0
- package/dist/text/text-2d/index.d.ts +1 -0
- package/dist/text/text-2d/index.d.ts.map +1 -1
- package/dist/text/text-2d/index.js +1 -0
- package/dist/text/text-2d/index.js.map +1 -1
- package/dist/text/text-2d/model-utils/text-code-point-source.cjs +41 -0
- package/dist/text/text-2d/model-utils/text-code-point-source.d.ts +8 -0
- package/dist/text/text-2d/model-utils/text-code-point-source.d.ts.map +1 -0
- package/dist/text/text-2d/model-utils/text-code-point-source.js +23 -0
- package/dist/text/text-2d/model-utils/text-code-point-source.js.map +1 -0
- package/dist/text/text-2d/models/text-attribute-model.cjs +4 -1
- package/dist/text/text-2d/models/text-attribute-model.d.ts +3 -1
- package/dist/text/text-2d/models/text-attribute-model.d.ts.map +1 -1
- package/dist/text/text-2d/models/text-attribute-model.js +6 -1
- package/dist/text/text-2d/models/text-attribute-model.js.map +1 -1
- package/dist/text/text-2d/models/text-dictionary-model.cjs +4 -1
- package/dist/text/text-2d/models/text-dictionary-model.d.ts +3 -1
- package/dist/text/text-2d/models/text-dictionary-model.d.ts.map +1 -1
- package/dist/text/text-2d/models/text-dictionary-model.js +6 -1
- package/dist/text/text-2d/models/text-dictionary-model.js.map +1 -1
- package/dist/text/text-2d/models/text-storage-model.cjs +4 -1
- package/dist/text/text-2d/models/text-storage-model.d.ts +3 -1
- package/dist/text/text-2d/models/text-storage-model.d.ts.map +1 -1
- package/dist/text/text-2d/models/text-storage-model.js +6 -1
- package/dist/text/text-2d/models/text-storage-model.js.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/licenses/cesium.txt +207 -0
- package/licenses/deck-community.txt +19 -0
- package/licenses/deck.txt +19 -0
- package/licenses/glfx.txt +19 -0
- package/licenses/gltf-loader-ts.txt +21 -0
- package/licenses/magenta-font.txt +13 -0
- package/licenses/nvidia-fxaa.txt +25 -0
- package/licenses/philogl.txt +19 -0
- package/licenses/spark.txt +21 -0
- package/licenses/three.txt +21 -0
- package/package.json +21 -13
- package/src/animation/deform-positions.ts +1 -1
- package/src/animation/node-animation-binding.ts +18 -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 +24 -20
- package/src/arrow/renderers/text/renderers/arrow-text-shaders.ts +1 -1
- package/src/audio/audio-controller.ts +1 -1
- package/src/audio/audio-environment.ts +1 -1
- package/src/compute/computation.ts +2 -2
- package/src/compute/swap.ts +2 -2
- package/src/debug/pixel-data-utils.ts +1 -1
- package/src/dynamic-texture/video-texture.ts +9 -3
- package/src/effects/passes/postprocessing/fxaa/fxaa.ts +2 -1
- package/src/effects/passes/postprocessing/image-adjust-filters/brightnesscontrast.ts +2 -0
- package/src/effects/passes/postprocessing/image-adjust-filters/denoise.ts +2 -0
- package/src/effects/passes/postprocessing/image-adjust-filters/huesaturation.ts +2 -0
- package/src/effects/passes/postprocessing/image-adjust-filters/noise.ts +2 -0
- package/src/effects/passes/postprocessing/image-adjust-filters/sepia.ts +2 -0
- package/src/effects/passes/postprocessing/image-adjust-filters/vibrance.ts +2 -0
- package/src/effects/passes/postprocessing/image-adjust-filters/vignette.ts +2 -0
- 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/animations/animations.ts +8 -1
- package/src/gltf/gltf/create-gltf-model.ts +5 -1
- package/src/gltf/gltf/create-scenegraph-from-gltf.ts +98 -17
- package/src/gltf/gltf/gltf-animated-crowd.ts +2 -1
- package/src/gltf/gltf/gltf-billboard.ts +6 -1
- package/src/gltf/gltf/gltf-extension-support.ts +2 -2
- package/src/gltf/gltf/gltf-instancing.ts +1 -1
- package/src/gltf/gltf/gltf-lightmap.ts +1 -1
- package/src/gltf/index.ts +1 -0
- package/src/gltf/parsers/parse-gltf-animations.ts +22 -8
- package/src/gltf/parsers/parse-gltf-lights.ts +43 -131
- package/src/gltf/parsers/parse-gltf-metadata.ts +40 -0
- package/src/gltf/parsers/parse-gltf.ts +11 -2
- package/src/gltf/parsers/parse-pbr-material.ts +36 -8
- package/src/gltf/pbr/pbr-environment.ts +27 -1
- package/src/gltf/pbr/pbr-material.ts +8 -3
- 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/gltf/types/gltf-json-schema.ts +1 -0
- package/src/gltf/types/gltf-postprocessed-schema.ts +1 -0
- package/src/graph/models/path/path-attribute-model.ts +10 -1
- package/src/graph/models/path/path-storage-model.ts +13 -4
- 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 +155 -2
- package/src/graph/physics/physics-scenegraph.ts +1 -1
- package/src/graph/physics/scenegraph-instance.ts +27 -1
- 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/graph/tables/gpu-table-model.ts +3 -2
- package/src/index.ts +17 -0
- package/src/lighting/ambient-occlusion-pass.ts +131 -0
- package/src/lighting/clustered-light-grid.ts +481 -0
- package/src/lighting/contact-shadow-composite.ts +67 -0
- package/src/lighting/contact-shadow-pass.ts +108 -0
- package/src/lighting/index.ts +125 -0
- package/src/lighting/lightmap-atlas.ts +348 -0
- package/src/lighting/lightmap-baker.ts +306 -0
- package/src/lighting/lightmap-data.ts +138 -0
- package/src/lighting/lightmap-environment.ts +70 -0
- package/src/lighting/pbr-environment.ts +55 -0
- package/src/lighting/pbr-material.ts +85 -0
- package/src/lighting/pbr-model.ts +608 -0
- package/src/lighting/pbr-surface-pass.ts +122 -0
- package/src/lighting/prefiltered-environment.ts +354 -0
- package/src/lighting/reflection-probe.ts +361 -0
- package/src/lighting/shadow-map-renderer.ts +918 -0
- package/src/lighting/shadow-quality.ts +50 -0
- package/src/material/material.ts +3 -0
- package/src/model/gpu-vector-model.ts +42 -4
- package/src/model/model.ts +1 -1
- package/src/models/light-model-utils.ts +5 -3
- 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 +172 -0
- 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/scene-metadata.ts +23 -0
- package/src/scenegraph/scenegraph-bounds.ts +2 -2
- package/src/scenegraph/scenegraph-interaction.ts +131 -0
- package/src/scenegraph/scenegraph-node.ts +14 -1
- package/src/scenegraph/transform-source.ts +1 -1
- package/src/splats/README.md +1 -1
- package/src/text/fonts/atlas/text-utils.ts +1 -1
- package/src/text/index.ts +1 -0
- package/src/text/text-2d/index.ts +1 -0
- package/src/text/text-2d/model-utils/text-code-point-source.ts +34 -0
- package/src/text/text-2d/models/text-attribute-model.ts +10 -1
- package/src/text/text-2d/models/text-dictionary-model.ts +10 -1
- package/src/text/text-2d/models/text-storage-model.ts +10 -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
|
@@ -15,10 +15,15 @@ export type {
|
|
|
15
15
|
CompressedImageMipmapArray,
|
|
16
16
|
CompressedMipLevel
|
|
17
17
|
} from '../types/gltf-types';
|
|
18
|
-
import {Matrix3} from '@math.gl/core';
|
|
18
|
+
import {Matrix3} from '@math.gl/core/matrix';
|
|
19
19
|
import type {Device, ExternalImage, SamplerProps, TextureFormat} from '@luma.gl/core';
|
|
20
20
|
import {assert, log, Texture, textureFormatDecoder} from '@luma.gl/core';
|
|
21
21
|
import {type PBRMaterialBindings} from '@luma.gl/shaders';
|
|
22
|
+
import {
|
|
23
|
+
getPBREnvironmentBindings,
|
|
24
|
+
getPBREnvironmentUniforms,
|
|
25
|
+
type PBRLightingEnvironment
|
|
26
|
+
} from '../../lighting/pbr-environment';
|
|
22
27
|
import {type PBREnvironment} from '../pbr/pbr-environment';
|
|
23
28
|
import {type ParsedPBRMaterial} from '../pbr/pbr-material';
|
|
24
29
|
import {
|
|
@@ -238,8 +243,12 @@ export type ParsePBRMaterialOptions = {
|
|
|
238
243
|
lights?: any;
|
|
239
244
|
/** Use tangents */
|
|
240
245
|
useTangents?: boolean;
|
|
241
|
-
/**
|
|
242
|
-
|
|
246
|
+
/**
|
|
247
|
+
* Image-based lighting environment. A `PBREnvironment` keeps the legacy sRGB decode and
|
|
248
|
+
* fixed mip range. A `PBRLightingEnvironment` is sampled as linear light and also supplies
|
|
249
|
+
* the `pbrScene` environment intensity, rotation and mip count.
|
|
250
|
+
*/
|
|
251
|
+
imageBasedLightingEnvironment?: PBREnvironment | PBRLightingEnvironment;
|
|
243
252
|
/** parent post-processed glTF, used to resolve extension texture infos */
|
|
244
253
|
gltf?: GLTFPostprocessed;
|
|
245
254
|
/** run primitive-attribute diagnostics such as missing TEXCOORD_0 / NORMAL */
|
|
@@ -250,6 +259,13 @@ export type ParsePBRMaterialOptions = {
|
|
|
250
259
|
validateLightmapAttributes?: boolean;
|
|
251
260
|
};
|
|
252
261
|
|
|
262
|
+
/** Distinguishes borrowed linear-light textures from the legacy dynamic-texture environment. */
|
|
263
|
+
function isPBRLightingEnvironment(
|
|
264
|
+
environment: PBREnvironment | PBRLightingEnvironment
|
|
265
|
+
): environment is PBRLightingEnvironment {
|
|
266
|
+
return 'specularTexture' in environment;
|
|
267
|
+
}
|
|
268
|
+
|
|
253
269
|
/**
|
|
254
270
|
* Parses a GLTF material definition into uniforms and parameters for the PBR shader module
|
|
255
271
|
*/
|
|
@@ -281,11 +297,23 @@ export function parsePBRMaterial(
|
|
|
281
297
|
|
|
282
298
|
const {imageBasedLightingEnvironment} = options;
|
|
283
299
|
if (imageBasedLightingEnvironment) {
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
300
|
+
if (isPBRLightingEnvironment(imageBasedLightingEnvironment)) {
|
|
301
|
+
Object.assign(
|
|
302
|
+
parsedMaterial.bindings,
|
|
303
|
+
getPBREnvironmentBindings(imageBasedLightingEnvironment)
|
|
304
|
+
);
|
|
305
|
+
Object.assign(
|
|
306
|
+
parsedMaterial.uniforms,
|
|
307
|
+
getPBREnvironmentUniforms(imageBasedLightingEnvironment)
|
|
308
|
+
);
|
|
309
|
+
parsedMaterial.defines['USE_SCENE_ENVIRONMENT'] = true;
|
|
310
|
+
} else {
|
|
311
|
+
parsedMaterial.bindings.pbr_diffuseEnvSampler =
|
|
312
|
+
imageBasedLightingEnvironment.diffuseEnvSampler.texture;
|
|
313
|
+
parsedMaterial.bindings.pbr_specularEnvSampler =
|
|
314
|
+
imageBasedLightingEnvironment.specularEnvSampler.texture;
|
|
315
|
+
parsedMaterial.bindings.pbr_brdfLUT = imageBasedLightingEnvironment.brdfLutTexture.texture;
|
|
316
|
+
}
|
|
289
317
|
parsedMaterial.uniforms.IBLenabled = true;
|
|
290
318
|
parsedMaterial.uniforms.scaleIBLAmbient = [1, 1];
|
|
291
319
|
}
|
|
@@ -3,6 +3,11 @@
|
|
|
3
3
|
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
4
|
|
|
5
5
|
import {Device, SamplerProps} from '@luma.gl/core';
|
|
6
|
+
import {
|
|
7
|
+
getPBREnvironmentBindings,
|
|
8
|
+
type PBRLightingEnvironment,
|
|
9
|
+
type PBRLightingEnvironmentOptions
|
|
10
|
+
} from '../../lighting/pbr-environment';
|
|
6
11
|
import {
|
|
7
12
|
DynamicTexture,
|
|
8
13
|
type Texture2DData,
|
|
@@ -75,7 +80,8 @@ export function loadPBREnvironment(device: Device, props: PBREnvironmentProps):
|
|
|
75
80
|
sampler: {
|
|
76
81
|
addressModeU: 'clamp-to-edge',
|
|
77
82
|
addressModeV: 'clamp-to-edge',
|
|
78
|
-
minFilter: 'linear',
|
|
83
|
+
minFilter: 'linear',
|
|
84
|
+
mipmapFilter: 'linear',
|
|
79
85
|
magFilter: 'linear'
|
|
80
86
|
} as const satisfies SamplerProps
|
|
81
87
|
});
|
|
@@ -128,3 +134,23 @@ function makeCube(
|
|
|
128
134
|
data
|
|
129
135
|
});
|
|
130
136
|
}
|
|
137
|
+
|
|
138
|
+
/** Resolves a loaded environment into borrowed lighting resources after every upload completes. */
|
|
139
|
+
export async function resolveLoadedPBREnvironment(
|
|
140
|
+
environment: PBREnvironment,
|
|
141
|
+
options: PBRLightingEnvironmentOptions = {}
|
|
142
|
+
): Promise<PBRLightingEnvironment> {
|
|
143
|
+
await Promise.all([
|
|
144
|
+
environment.diffuseEnvSampler.ready,
|
|
145
|
+
environment.specularEnvSampler.ready,
|
|
146
|
+
environment.brdfLutTexture.ready
|
|
147
|
+
]);
|
|
148
|
+
const lightingEnvironment = {
|
|
149
|
+
diffuseTexture: environment.diffuseEnvSampler.texture,
|
|
150
|
+
specularTexture: environment.specularEnvSampler.texture,
|
|
151
|
+
brdfLUTTexture: environment.brdfLutTexture.texture,
|
|
152
|
+
...options
|
|
153
|
+
};
|
|
154
|
+
getPBREnvironmentBindings(lightingEnvironment);
|
|
155
|
+
return lightingEnvironment;
|
|
156
|
+
}
|
|
@@ -7,10 +7,15 @@ import {
|
|
|
7
7
|
IBLBindings,
|
|
8
8
|
PBRMaterialBindings,
|
|
9
9
|
PBRMaterialUniforms,
|
|
10
|
-
PBRProjectionProps
|
|
10
|
+
PBRProjectionProps,
|
|
11
|
+
PBRSceneUniforms
|
|
11
12
|
} from '@luma.gl/shaders';
|
|
12
13
|
|
|
13
|
-
type ParsedPBRMaterialUniforms = Partial<
|
|
14
|
+
type ParsedPBRMaterialUniforms = Partial<
|
|
15
|
+
PBRProjectionProps &
|
|
16
|
+
PBRMaterialUniforms &
|
|
17
|
+
Pick<PBRSceneUniforms, 'environmentIntensity' | 'environmentRotation' | 'environmentMipCount'>
|
|
18
|
+
> & {
|
|
14
19
|
clearcoatRoughnessMapEnabled?: boolean;
|
|
15
20
|
sheenRoughnessMapEnabled?: boolean;
|
|
16
21
|
};
|
|
@@ -21,7 +26,7 @@ export type ParsedPBRMaterial = {
|
|
|
21
26
|
readonly defines: Record<string, boolean>;
|
|
22
27
|
/** Texture and sampler bindings for the PBR shader module. */
|
|
23
28
|
readonly bindings: Partial<PBRMaterialBindings<Texture> & IBLBindings<Texture>>;
|
|
24
|
-
/** Uniform values for the projection and PBR shader modules. */
|
|
29
|
+
/** Uniform values for the projection, PBR material and PBR scene shader modules. */
|
|
25
30
|
readonly uniforms: ParsedPBRMaterialUniforms;
|
|
26
31
|
/** Render pipeline parameters derived from the glTF material. */
|
|
27
32
|
readonly parameters: Parameters;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
4
|
|
|
5
|
-
import {Matrix4} from '@math.gl/core';
|
|
5
|
+
import {Matrix4} from '@math.gl/core/matrix';
|
|
6
6
|
import {decomposePhysicsTransform} from '@luma.gl/engine';
|
|
7
7
|
import {ScenegraphPhysicsProperties} from '@luma.gl/engine/physics';
|
|
8
8
|
import {type GPURigidBodyWorld} from '@luma.gl/graph/gpu-physics';
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
4
|
|
|
5
|
-
import {Matrix4} from '@math.gl/core';
|
|
5
|
+
import {Matrix4} from '@math.gl/core/matrix';
|
|
6
6
|
import {deformPositions, type ScenegraphNode} from '@luma.gl/engine';
|
|
7
7
|
import type {
|
|
8
8
|
GLTF,
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
4
|
|
|
5
|
-
import {Matrix4} from '@math.gl/core';
|
|
5
|
+
import {Matrix4} from '@math.gl/core/matrix';
|
|
6
6
|
import type {GLTFPhysicsDocument, ParseGLTFPhysicsOptions} from './physics-types';
|
|
7
7
|
import {readPhysicsRotation, readPhysicsVector} from './physics-transforms';
|
|
8
8
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import {isGLTFPhysicsPropertyPointer} from '../parsers/parse-gltf-physics-pointer';
|
|
6
6
|
import {parsePhysicsJoints} from './parse-physics-joints';
|
|
7
|
-
import {Matrix4, Quaternion} from '@math.gl/core';
|
|
7
|
+
import {Matrix4, Quaternion} from '@math.gl/core/matrix';
|
|
8
8
|
import {collectNodeCollisionGeometry} from './node-collision-geometry';
|
|
9
9
|
import {getMeshBoxBounds} from './mesh-box-shape';
|
|
10
10
|
import {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
4
|
|
|
5
5
|
import {parseGLTFJointDeclarations} from '../parsers/parse-gltf-joints';
|
|
6
|
-
import {Matrix4} from '@math.gl/core';
|
|
6
|
+
import {Matrix4} from '@math.gl/core/matrix';
|
|
7
7
|
import {makeRigidBodyJointsFromScenegraph} from '@luma.gl/engine/physics';
|
|
8
8
|
import {GroupNode, JointController} from '@luma.gl/engine';
|
|
9
9
|
import {readPhysicsRotation, readPhysicsVector} from './physics-transforms';
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
4
|
|
|
5
|
-
import {Matrix4} from '@math.gl/core';
|
|
5
|
+
import {Matrix4} from '@math.gl/core/matrix';
|
|
6
6
|
import {decomposePhysicsTransform} from '@luma.gl/engine';
|
|
7
7
|
import {ScenegraphPhysicsProperties, type PhysicsPropertyTarget} from '@luma.gl/engine/physics';
|
|
8
8
|
import {type GPURigidBodyWorld} from '@luma.gl/graph/gpu-physics';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// SPDX-License-Identifier: MIT
|
|
2
2
|
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
3
|
+
// SPDX-FileCopyrightText: Copyright (c) 2018 Benjamin Wasty
|
|
3
4
|
|
|
4
5
|
// Types forked from https://github.com/bwasty/gltf-loader-ts under MIT license
|
|
5
6
|
// Generated from official JSON schema using `npm run generate-interface` on 2018-02-24
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// SPDX-License-Identifier: MIT
|
|
2
2
|
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
3
|
+
// SPDX-FileCopyrightText: Copyright (c) 2018 Benjamin Wasty
|
|
3
4
|
|
|
4
5
|
// Types forked from https://github.com/bwasty/gltf-loader-ts under MIT license
|
|
5
6
|
// Generated from official JSON schema using `npm run generate-type` = on 2018-02-24
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
4
|
|
|
5
|
+
import type {ModelDrawOptions} from '../../../model/gpu-vector-model';
|
|
5
6
|
import {
|
|
6
7
|
type Buffer,
|
|
7
8
|
type BufferLayout,
|
|
@@ -251,7 +252,15 @@ export class PathAttributeModel extends GPUTableModel {
|
|
|
251
252
|
}
|
|
252
253
|
|
|
253
254
|
/** Draws each generated path render batch against the supplied render pass. */
|
|
254
|
-
override draw(renderPass: RenderPass): boolean {
|
|
255
|
+
override draw(renderPass: RenderPass, options?: ModelDrawOptions): boolean {
|
|
256
|
+
return options?.parameters
|
|
257
|
+
? this._withDrawParameters(renderPass, options.parameters, () =>
|
|
258
|
+
this.drawPathAttributeModelBatches(renderPass)
|
|
259
|
+
)
|
|
260
|
+
: this.drawPathAttributeModelBatches(renderPass);
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
private drawPathAttributeModelBatches(renderPass: RenderPass): boolean {
|
|
255
264
|
const tableBatches = this.table?.batches || [];
|
|
256
265
|
if (tableBatches.length > 0 && tableBatches.length !== this.renderBatches.length) {
|
|
257
266
|
throw new Error(
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
4
|
|
|
5
|
-
import type {
|
|
5
|
+
import type {ModelDrawOptions} from '../../../model/gpu-vector-model';
|
|
6
|
+
import type {GPUPathStorageInputProps} from '@luma.gl/graph/experimental-models';
|
|
6
7
|
|
|
7
8
|
import {
|
|
8
9
|
Buffer,
|
|
@@ -22,11 +23,11 @@ import {
|
|
|
22
23
|
createGpuPathGeneratedState,
|
|
23
24
|
createGpuPathRangeState,
|
|
24
25
|
dispatchGpuPathExpansionCompute
|
|
25
|
-
} from '@luma.gl/graph/experimental
|
|
26
|
+
} from '@luma.gl/graph/experimental-models';
|
|
26
27
|
import {
|
|
27
28
|
resolvePathStorageInputs,
|
|
28
29
|
type PathStorageBatchInputs
|
|
29
|
-
} from '@luma.gl/graph/experimental
|
|
30
|
+
} from '@luma.gl/graph/experimental-models';
|
|
30
31
|
import type {GPUInputSchema} from '@luma.gl/graph/gpu-tables';
|
|
31
32
|
|
|
32
33
|
const SEGMENT_START_POINT_INDICES_COLUMN = 'segmentStartPointIndices';
|
|
@@ -432,7 +433,15 @@ export class PathStorageModel extends Model {
|
|
|
432
433
|
}
|
|
433
434
|
|
|
434
435
|
/** Draws each generated storage path render batch against the supplied render pass. */
|
|
435
|
-
override draw(renderPass: RenderPass): boolean {
|
|
436
|
+
override draw(renderPass: RenderPass, options?: ModelDrawOptions): boolean {
|
|
437
|
+
return options?.parameters
|
|
438
|
+
? this._withDrawParameters(renderPass, options.parameters, () =>
|
|
439
|
+
this.drawPathStorageModelBatches(renderPass)
|
|
440
|
+
)
|
|
441
|
+
: this.drawPathStorageModelBatches(renderPass);
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
private drawPathStorageModelBatches(renderPass: RenderPass): boolean {
|
|
436
445
|
let drawSuccess = true;
|
|
437
446
|
for (const renderBatch of this.storageState.renderBatches) {
|
|
438
447
|
if (renderBatch.segmentCount === 0) {
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
POLYGON_GPU_INPUT_SCHEMA,
|
|
16
16
|
type PolygonBatchProps,
|
|
17
17
|
type PolygonGPUVectors
|
|
18
|
-
} from '@luma.gl/graph/experimental
|
|
18
|
+
} from '@luma.gl/graph/experimental-models';
|
|
19
19
|
import {
|
|
20
20
|
POLYGON_ATTRIBUTE_SHADER_LAYOUT,
|
|
21
21
|
POLYGON_ATTRIBUTE_VS_GLSL,
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
assertPolygonGPUVectorInputs,
|
|
15
15
|
POLYGON_GPU_INPUT_SCHEMA,
|
|
16
16
|
type PolygonBatchProps
|
|
17
|
-
} from '@luma.gl/graph/experimental
|
|
17
|
+
} from '@luma.gl/graph/experimental-models';
|
|
18
18
|
import {
|
|
19
19
|
getPolygonPickingParameters,
|
|
20
20
|
mergePolygonShaderModules,
|
|
@@ -25,6 +25,7 @@ export type {ScenegraphPhysicsScene, ScenegraphPhysicsSessionCapture} from './sc
|
|
|
25
25
|
export {PhysicsController} from './physics-controller';
|
|
26
26
|
export type {
|
|
27
27
|
PhysicsNodeReference,
|
|
28
|
+
PhysicsVehicleOptions,
|
|
28
29
|
PhysicsJointOptions,
|
|
29
30
|
PhysicsBodyOptions,
|
|
30
31
|
PhysicsControllerProps,
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
4
|
|
|
5
5
|
import {assert} from '@luma.gl/core';
|
|
6
|
-
import {Geometry} from '@math.gl/geometry';
|
|
7
|
-
import {Matrix4} from '@math.gl/core';
|
|
6
|
+
import {Geometry} from '@math.gl/geometry/primitives';
|
|
7
|
+
import {Matrix4} from '@math.gl/core/matrix';
|
|
8
8
|
import {
|
|
9
9
|
CubeGeometry,
|
|
10
10
|
GroupNode,
|
|
@@ -3,10 +3,11 @@
|
|
|
3
3
|
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
4
|
|
|
5
5
|
import {assert, type Device} from '@luma.gl/core';
|
|
6
|
-
import type {Geometry} from '@math.gl/geometry';
|
|
6
|
+
import type {Geometry} from '@math.gl/geometry/primitives';
|
|
7
7
|
import type {
|
|
8
8
|
GPURigidBody,
|
|
9
9
|
GPURigidBodyShape,
|
|
10
|
+
GPURigidBodyVehicle,
|
|
10
11
|
GPURigidBodyWorldProps
|
|
11
12
|
} from '@luma.gl/graph/gpu-physics';
|
|
12
13
|
import {rotateRigidBodyVector} from '@luma.gl/graph/gpu-physics';
|
|
@@ -46,12 +47,26 @@ export type PhysicsBodyOptions = Pick<
|
|
|
46
47
|
};
|
|
47
48
|
export type PhysicsControllerProps = Omit<
|
|
48
49
|
GPURigidBodyWorldProps,
|
|
49
|
-
'bodies' | 'publicationBounds' | 'publishPoses' | 'joints'
|
|
50
|
+
'bodies' | 'publicationBounds' | 'publishPoses' | 'joints' | 'vehicle' | 'vehicles'
|
|
50
51
|
> & {
|
|
51
52
|
scene: GroupNode;
|
|
52
53
|
/** Bound catch-up work; excess elapsed time is reported, not silently simulated. */
|
|
53
54
|
maximumSubsteps?: number;
|
|
54
55
|
};
|
|
56
|
+
/** Vehicle tuning for a chassis and terrain identified by scenegraph references. */
|
|
57
|
+
export type PhysicsVehicleOptions = Omit<
|
|
58
|
+
GPURigidBodyVehicle,
|
|
59
|
+
'chassis' | 'terrainCollider' | 'additionalTerrainColliders'
|
|
60
|
+
>;
|
|
61
|
+
|
|
62
|
+
/** Authored terrain and tuning retained under the chassis node's identity. */
|
|
63
|
+
type PhysicsVehicleAttachment = {
|
|
64
|
+
/** One to four static nodes, in contact preference order. */
|
|
65
|
+
terrain: readonly ScenegraphNode[];
|
|
66
|
+
/** Wheel geometry and force settings. */
|
|
67
|
+
options: PhysicsVehicleOptions;
|
|
68
|
+
};
|
|
69
|
+
|
|
55
70
|
export type PhysicsBodyPose = {
|
|
56
71
|
/** World-space scene-node origin, rather than the internal center of mass. */
|
|
57
72
|
position: readonly [number, number, number];
|
|
@@ -80,6 +95,10 @@ export class PhysicsController {
|
|
|
80
95
|
private readonly definitions = new Map<ScenegraphNode, PhysicsBodyOptions>();
|
|
81
96
|
private readonly handles = new Map<ScenegraphNode, PhysicsBody>();
|
|
82
97
|
private readonly manualTargets = new Set<ScenegraphNode>();
|
|
98
|
+
/** Attachments in stable insertion order for unqualified legacy controls. */
|
|
99
|
+
private readonly vehicleAttachments = new Map<ScenegraphNode, PhysicsVehicleAttachment>();
|
|
100
|
+
/** Indices for the current compiled revision. */
|
|
101
|
+
private vehicleIndices = new Map<ScenegraphNode, number>();
|
|
83
102
|
private readonly joints: ScenegraphJoint[] = [];
|
|
84
103
|
private indices: ReadonlyMap<ScenegraphNode, number> = new Map();
|
|
85
104
|
private session?: ScenegraphPhysicsSession;
|
|
@@ -195,12 +214,112 @@ export class PhysicsController {
|
|
|
195
214
|
this.assertEditable();
|
|
196
215
|
const node = this.resolveNode(reference);
|
|
197
216
|
if (!node || !this.definitions.delete(node)) return false;
|
|
217
|
+
for (const [chassis, attachment] of this.vehicleAttachments) {
|
|
218
|
+
if (chassis === node || attachment.terrain.includes(node))
|
|
219
|
+
this.vehicleAttachments.delete(chassis);
|
|
220
|
+
}
|
|
198
221
|
this.handles.delete(node);
|
|
199
222
|
this.manualTargets.delete(node);
|
|
200
223
|
this.dirty = true;
|
|
201
224
|
return true;
|
|
202
225
|
}
|
|
203
226
|
|
|
227
|
+
/** Replace the fleet with one chassis using a single terrain node, for legacy callers. */
|
|
228
|
+
setVehicle(
|
|
229
|
+
chassis: PhysicsNodeReference,
|
|
230
|
+
terrain: PhysicsNodeReference,
|
|
231
|
+
options: PhysicsVehicleOptions
|
|
232
|
+
): void {
|
|
233
|
+
this.setVehicleAttachment(chassis, [terrain], options, true);
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
/** Attach another independently controlled chassis to one to four static terrain nodes. */
|
|
237
|
+
addVehicle(
|
|
238
|
+
chassis: PhysicsNodeReference,
|
|
239
|
+
terrain: readonly PhysicsNodeReference[],
|
|
240
|
+
options: PhysicsVehicleOptions
|
|
241
|
+
): void {
|
|
242
|
+
this.setVehicleAttachment(chassis, terrain, options, false);
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
/** Remove one chassis's suspension on the next preparation without removing its rigid body. */
|
|
246
|
+
removeVehicle(chassis: PhysicsNodeReference): boolean {
|
|
247
|
+
this.assertEditable();
|
|
248
|
+
const node = this.resolveNode(chassis);
|
|
249
|
+
if (!node || !this.vehicleAttachments.delete(node)) return false;
|
|
250
|
+
this.dirty = true;
|
|
251
|
+
return true;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
/** Borrow the first registered vehicle's wheel poses after preparation. */
|
|
255
|
+
get vehicleWheelPoses() {
|
|
256
|
+
return this.requireReady().world.vehicleWheelPoses;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
/** Borrow a registered chassis's wheel transforms after preparation. */
|
|
260
|
+
getVehicleWheelPoses(chassis: PhysicsNodeReference) {
|
|
261
|
+
return this.requireReady().world.getVehicleWheelPoses(this.getVehicleIndex(chassis));
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
/** Read wheel telemetry for the selected chassis, or for the first chassis by default. */
|
|
265
|
+
readVehicleWheels(chassis?: PhysicsNodeReference) {
|
|
266
|
+
const session = this.requireReady();
|
|
267
|
+
const vehicleIndex = this.getVehicleIndex(chassis);
|
|
268
|
+
return this.exclusive(() => session.withWorld(world => world.readVehicleWheels(vehicleIndex)));
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
/** Set controls for the selected chassis, or for the first chassis by default. */
|
|
272
|
+
setVehicleControls(
|
|
273
|
+
throttle: number,
|
|
274
|
+
steering: number,
|
|
275
|
+
brake: number,
|
|
276
|
+
chassis?: PhysicsNodeReference
|
|
277
|
+
): void {
|
|
278
|
+
this.requireReady().world.setVehicleControls(
|
|
279
|
+
throttle,
|
|
280
|
+
steering,
|
|
281
|
+
brake,
|
|
282
|
+
this.getVehicleIndex(chassis)
|
|
283
|
+
);
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
/** Validate path references before replacing or appending an attachment. */
|
|
287
|
+
private setVehicleAttachment(
|
|
288
|
+
chassis: PhysicsNodeReference,
|
|
289
|
+
terrain: readonly PhysicsNodeReference[],
|
|
290
|
+
options: PhysicsVehicleOptions,
|
|
291
|
+
replace: boolean
|
|
292
|
+
): void {
|
|
293
|
+
this.assertEditable();
|
|
294
|
+
const chassisNode = this.resolveNode(chassis);
|
|
295
|
+
if (!chassisNode || (!replace && this.vehicleAttachments.has(chassisNode)))
|
|
296
|
+
throw new Error('Missing or duplicate vehicle chassis');
|
|
297
|
+
const terrainNodes = terrain.map(reference => {
|
|
298
|
+
const terrainNode = this.resolveNode(reference);
|
|
299
|
+
if (!terrainNode) throw new Error('Missing vehicle terrain');
|
|
300
|
+
return terrainNode;
|
|
301
|
+
});
|
|
302
|
+
if (
|
|
303
|
+
!terrainNodes.length ||
|
|
304
|
+
terrainNodes.length > 4 ||
|
|
305
|
+
new Set(terrainNodes).size !== terrainNodes.length
|
|
306
|
+
)
|
|
307
|
+
throw new Error('Vehicle requires one to four distinct terrain nodes');
|
|
308
|
+
const tuning = structuredClone(options);
|
|
309
|
+
if (replace) this.vehicleAttachments.clear();
|
|
310
|
+
this.vehicleAttachments.set(chassisNode, {terrain: terrainNodes, options: tuning});
|
|
311
|
+
this.dirty = true;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
/** Resolve a chassis to the vehicle slot of the compiled world. */
|
|
315
|
+
private getVehicleIndex(reference?: PhysicsNodeReference): number {
|
|
316
|
+
if (reference === undefined) return 0;
|
|
317
|
+
const node = this.resolveNode(reference);
|
|
318
|
+
const vehicleIndex = node && this.vehicleIndices.get(node);
|
|
319
|
+
if (vehicleIndex === undefined) throw new Error('Vehicle chassis is not attached');
|
|
320
|
+
return vehicleIndex;
|
|
321
|
+
}
|
|
322
|
+
|
|
204
323
|
addJoint(options: PhysicsJointOptions): ScenegraphJoint {
|
|
205
324
|
this.assertEditable();
|
|
206
325
|
const {first, second, ...properties} = options;
|
|
@@ -239,9 +358,41 @@ export class PhysicsController {
|
|
|
239
358
|
this.worldOptions,
|
|
240
359
|
this.joints
|
|
241
360
|
);
|
|
361
|
+
const vehicleIndices = new Map<ScenegraphNode, number>();
|
|
362
|
+
if (this.vehicleAttachments.size) {
|
|
363
|
+
const bodies = scene.definition.world.bodies;
|
|
364
|
+
const colliderOffsets: number[] = [];
|
|
365
|
+
let offset = 0;
|
|
366
|
+
for (const body of bodies) {
|
|
367
|
+
colliderOffsets.push(offset);
|
|
368
|
+
offset += body.colliders?.length ?? 1;
|
|
369
|
+
}
|
|
370
|
+
scene.definition.world.vehicles = Array.from(
|
|
371
|
+
this.vehicleAttachments,
|
|
372
|
+
([node, attachment], index) => {
|
|
373
|
+
const chassis = scene.definition.bodies.get(node);
|
|
374
|
+
if (chassis === undefined)
|
|
375
|
+
throw new Error('Vehicle chassis requires a registered body');
|
|
376
|
+
const terrainColliders = attachment.terrain.map(terrainNode => {
|
|
377
|
+
const terrain = scene.definition.bodies.get(terrainNode);
|
|
378
|
+
if (terrain === undefined || (bodies[terrain].colliders?.length ?? 1) !== 1)
|
|
379
|
+
throw new Error('Vehicle terrain nodes require one registered collider each');
|
|
380
|
+
return colliderOffsets[terrain];
|
|
381
|
+
});
|
|
382
|
+
vehicleIndices.set(node, index);
|
|
383
|
+
return {
|
|
384
|
+
...attachment.options,
|
|
385
|
+
chassis,
|
|
386
|
+
terrainCollider: terrainColliders[0],
|
|
387
|
+
additionalTerrainColliders: terrainColliders.slice(1)
|
|
388
|
+
};
|
|
389
|
+
}
|
|
390
|
+
);
|
|
391
|
+
}
|
|
242
392
|
if (this.session) await this.session.rebuild(async () => scene, preserveState);
|
|
243
393
|
else this.session = await ScenegraphPhysicsSession.create(this.device, scene);
|
|
244
394
|
this.indices = scene.definition.bodies;
|
|
395
|
+
this.vehicleIndices = vehicleIndices;
|
|
245
396
|
this.manualTargets.clear();
|
|
246
397
|
this.accumulator = 0;
|
|
247
398
|
this.dirty = false;
|
|
@@ -316,6 +467,8 @@ export class PhysicsController {
|
|
|
316
467
|
this.session = undefined;
|
|
317
468
|
this.handles.clear();
|
|
318
469
|
this.definitions.clear();
|
|
470
|
+
this.vehicleAttachments.clear();
|
|
471
|
+
this.vehicleIndices.clear();
|
|
319
472
|
this.manualTargets.clear();
|
|
320
473
|
this.joints.length = 0;
|
|
321
474
|
this.indices = new Map();
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
4
|
import {CubeGeometry, GroupNode, ScenegraphNode, type Geometry} from '../../index';
|
|
5
|
-
import {Matrix4} from '@math.gl/core';
|
|
5
|
+
import {Matrix4} from '@math.gl/core/matrix';
|
|
6
6
|
import {makeConvexHullGeometry, makeTriangleMeshGeometry} from '@luma.gl/graph/gpu-physics';
|
|
7
7
|
import {normalizeRigidBodyRotation, type GPURigidBody} from '@luma.gl/graph/gpu-physics';
|
|
8
8
|
import type {GPURigidBodyBounds} from '@luma.gl/graph/gpu-physics';
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
4
|
|
|
5
5
|
import {assert, type Device, type CommandEncoder} from '@luma.gl/core';
|
|
6
|
-
import {Vector3} from '@math.gl/core';
|
|
6
|
+
import {Vector3} from '@math.gl/core/matrix';
|
|
7
7
|
import type {ScenegraphNode} from '../../index';
|
|
8
8
|
import {GPUCommandGraph} from '@luma.gl/graph/gpu-core';
|
|
9
9
|
import {
|
|
@@ -227,6 +227,32 @@ export class ScenegraphPhysicsInstance {
|
|
|
227
227
|
}
|
|
228
228
|
const replacement = await compile(this.device, props);
|
|
229
229
|
try {
|
|
230
|
+
if (preserveState) {
|
|
231
|
+
const previousProps = this.definition.world;
|
|
232
|
+
const previousVehicles =
|
|
233
|
+
previousProps.vehicles ?? (previousProps.vehicle ? [previousProps.vehicle] : []);
|
|
234
|
+
const vehicles = props.vehicles ?? (props.vehicle ? [props.vehicle] : []);
|
|
235
|
+
const previousVehicleIndices = new Map(
|
|
236
|
+
previousVehicles.map((vehicle, index) => [vehicle.chassis, index])
|
|
237
|
+
);
|
|
238
|
+
const vehicleIndices = new Map(
|
|
239
|
+
vehicles.map((vehicle, index) => [vehicle.chassis, index])
|
|
240
|
+
);
|
|
241
|
+
for (const [node, bodyIndex] of authored.bodies) {
|
|
242
|
+
const previousBodyIndex = this.definition.bodies.get(node);
|
|
243
|
+
const vehicleIndex = vehicleIndices.get(bodyIndex);
|
|
244
|
+
const previousVehicleIndex =
|
|
245
|
+
previousBodyIndex === undefined
|
|
246
|
+
? undefined
|
|
247
|
+
: previousVehicleIndices.get(previousBodyIndex);
|
|
248
|
+
if (vehicleIndex !== undefined && previousVehicleIndex !== undefined)
|
|
249
|
+
replacement.world.copyVehicleMotionFrom(
|
|
250
|
+
this.world,
|
|
251
|
+
vehicleIndex,
|
|
252
|
+
previousVehicleIndex
|
|
253
|
+
);
|
|
254
|
+
}
|
|
255
|
+
}
|
|
230
256
|
prepare?.(replacement.world);
|
|
231
257
|
replacement.world.publishPoses();
|
|
232
258
|
await this.finishSubmission();
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
4
|
|
|
5
|
-
import {Matrix4} from '@math.gl/core';
|
|
5
|
+
import {Matrix4} from '@math.gl/core/matrix';
|
|
6
6
|
import {GroupNode, decomposePhysicsTransform, type ScenegraphNode} from '../../index';
|
|
7
7
|
import {scaleRigidBodyShape} from '@luma.gl/graph/gpu-physics';
|
|
8
8
|
import type {GPURigidBodyWorld} from '@luma.gl/graph/gpu-physics';
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
4
|
|
|
5
|
-
import {Matrix4} from '@math.gl/core';
|
|
5
|
+
import {Matrix4} from '@math.gl/core/matrix';
|
|
6
6
|
import type {InteractivityPropertyAdapter} from '../../index';
|
|
7
7
|
import type {GPURigidBodyWorld, GPURigidBodyParameters} from '@luma.gl/graph/gpu-physics';
|
|
8
8
|
import type {GPURigidBodyGeneralConstraint} from '@luma.gl/graph/gpu-physics';
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
4
|
|
|
5
|
+
import type {ModelDrawOptions} from '../../model/gpu-vector-model';
|
|
5
6
|
import {
|
|
6
7
|
Buffer,
|
|
7
8
|
Device,
|
|
@@ -119,7 +120,7 @@ export class GPUTableModel extends Model {
|
|
|
119
120
|
}
|
|
120
121
|
|
|
121
122
|
/** Skips a direct draw while an empty prepared storage range is still bound. */
|
|
122
|
-
override draw(renderPass: RenderPass): boolean {
|
|
123
|
+
override draw(renderPass: RenderPass, options?: ModelDrawOptions): boolean {
|
|
123
124
|
const firstBatch = this.tableShaderBindings?.batches[0];
|
|
124
125
|
if (
|
|
125
126
|
firstBatch?.numRows === 0 &&
|
|
@@ -130,7 +131,7 @@ export class GPUTableModel extends Model {
|
|
|
130
131
|
) {
|
|
131
132
|
return true;
|
|
132
133
|
}
|
|
133
|
-
return super.draw(renderPass);
|
|
134
|
+
return super.draw(renderPass, options);
|
|
134
135
|
}
|
|
135
136
|
|
|
136
137
|
/** Replaces the bound GPU table when one is supplied. */
|