@luma.gl/engine 10.0.0-alpha.8 → 10.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +4 -4
- package/THIRD-PARTY-NOTICES.md +185 -0
- 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/arrow/index.cjs +5 -0
- package/dist/arrow/index.cjs.map +3 -3
- package/dist/arrow/index.d.ts +1 -0
- package/dist/arrow/index.d.ts.map +1 -1
- package/dist/arrow/index.js +1 -0
- package/dist/arrow/index.js.map +1 -1
- package/dist/arrow/renderers/splats/conversion/make-gpu-splat-data-from-gltf.cjs +161 -0
- package/dist/arrow/renderers/splats/conversion/make-gpu-splat-data-from-gltf.d.ts +34 -0
- package/dist/arrow/renderers/splats/conversion/make-gpu-splat-data-from-gltf.d.ts.map +1 -0
- package/dist/arrow/renderers/splats/conversion/make-gpu-splat-data-from-gltf.js +164 -0
- package/dist/arrow/renderers/splats/conversion/make-gpu-splat-data-from-gltf.js.map +1 -0
- package/dist/arrow/renderers/text/renderers/arrow-text-renderer.d.ts +1 -1
- package/dist/arrow/renderers/text/renderers/arrow-text-renderer.d.ts.map +1 -1
- package/dist/arrow/renderers/text/renderers/arrow-text-renderer.js.map +1 -1
- package/dist/arrow/renderers/text/renderers/arrow-text-shaders.cjs +10 -1
- package/dist/arrow/renderers/text/renderers/arrow-text-shaders.d.ts.map +1 -1
- package/dist/arrow/renderers/text/renderers/arrow-text-shaders.js +10 -3
- package/dist/arrow/renderers/text/renderers/arrow-text-shaders.js.map +1 -1
- package/dist/compute/computation.cjs +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/dist.dev.js +1149 -657
- package/dist/dist.min.js +76 -69
- 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/geometry/gpu-vector-geometry-adapter.cjs +14 -0
- package/dist/geometry/gpu-vector-geometry-adapter.d.ts +7 -0
- package/dist/geometry/gpu-vector-geometry-adapter.d.ts.map +1 -1
- package/dist/geometry/gpu-vector-geometry-adapter.js +17 -0
- package/dist/geometry/gpu-vector-geometry-adapter.js.map +1 -1
- package/dist/geometry/gpu-vector-geometry.cjs +3 -0
- package/dist/geometry/gpu-vector-geometry.d.ts +2 -0
- package/dist/geometry/gpu-vector-geometry.d.ts.map +1 -1
- package/dist/geometry/gpu-vector-geometry.js +2 -0
- package/dist/geometry/gpu-vector-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.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-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/index.cjs +2 -0
- package/dist/gltf/index.cjs.map +3 -3
- package/dist/gltf/index.d.ts +2 -2
- 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 +36 -72
- 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 +34 -91
- 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 +23 -14
- package/dist/gltf/parsers/parse-gltf.d.ts +12 -2
- package/dist/gltf/parsers/parse-gltf.d.ts.map +1 -1
- package/dist/gltf/parsers/parse-gltf.js +21 -13
- package/dist/gltf/parsers/parse-gltf.js.map +1 -1
- package/dist/gltf/parsers/parse-pbr-material.cjs +13 -3
- 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 +17 -5
- package/dist/gltf/parsers/parse-pbr-material.js.map +1 -1
- package/dist/gltf/parsers/post-process-gltf.cjs +1 -0
- package/dist/gltf/parsers/post-process-gltf.d.ts.map +1 -1
- package/dist/gltf/parsers/post-process-gltf.js +1 -0
- package/dist/gltf/parsers/post-process-gltf.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/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 +2 -0
- 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/gltf/types/gltf-types.d.ts +19 -0
- package/dist/gltf/types/gltf-types.d.ts.map +1 -1
- package/dist/graph/models/index.cjs.map +1 -1
- 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 +4 -1
- package/dist/graph/models/path/path-storage-model.d.ts +3 -1
- package/dist/graph/models/path/path-storage-model.d.ts.map +1 -1
- package/dist/graph/models/path/path-storage-model.js +6 -1
- package/dist/graph/models/path/path-storage-model.js.map +1 -1
- package/dist/graph/physics/index.cjs.map +2 -2
- package/dist/graph/physics/physics-controller.cjs +42 -0
- package/dist/graph/physics/physics-controller.d.ts +12 -1
- package/dist/graph/physics/physics-controller.d.ts.map +1 -1
- package/dist/graph/physics/physics-controller.js +41 -0
- package/dist/graph/physics/physics-controller.js.map +1 -1
- package/dist/graph/physics/scenegraph-instance.cjs +7 -0
- package/dist/graph/physics/scenegraph-instance.d.ts.map +1 -1
- package/dist/graph/physics/scenegraph-instance.js +8 -0
- package/dist/graph/physics/scenegraph-instance.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 +1 -1
- package/dist/index.cjs +16 -0
- package/dist/index.cjs.map +3 -3
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -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 +31 -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 +23 -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 +77 -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-bindings.cjs +10 -3
- package/dist/model/gpu-vector-bindings.d.ts +1 -1
- package/dist/model/gpu-vector-bindings.d.ts.map +1 -1
- package/dist/model/gpu-vector-bindings.js +12 -3
- package/dist/model/gpu-vector-bindings.js.map +1 -1
- package/dist/model/gpu-vector-draw-batches.cjs +4 -3
- package/dist/model/gpu-vector-draw-batches.d.ts +1 -1
- package/dist/model/gpu-vector-draw-batches.d.ts.map +1 -1
- package/dist/model/gpu-vector-draw-batches.js +4 -3
- package/dist/model/gpu-vector-draw-batches.js.map +1 -1
- package/dist/model/gpu-vector-model.cjs +42 -17
- package/dist/model/gpu-vector-model.d.ts +28 -4
- package/dist/model/gpu-vector-model.d.ts.map +1 -1
- package/dist/model/gpu-vector-model.js +49 -17
- 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 +2 -2
- package/dist/models/light-model-utils.d.ts +2 -1
- package/dist/models/light-model-utils.d.ts.map +1 -1
- package/dist/models/light-model-utils.js +2 -2
- package/dist/models/light-model-utils.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/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-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 +10 -0
- package/dist/scenegraph/scenegraph-node.d.ts +10 -0
- package/dist/scenegraph/scenegraph-node.d.ts.map +1 -1
- package/dist/scenegraph/scenegraph-node.js +10 -0
- package/dist/scenegraph/scenegraph-node.js.map +1 -1
- package/dist/splats/index.cjs.map +1 -1
- package/dist/splats/splat-data.cjs +34 -23
- package/dist/splats/splat-data.d.ts.map +1 -1
- package/dist/splats/splat-data.js +34 -22
- package/dist/splats/splat-data.js.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/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 +17 -9
- package/src/animation/node-animation-binding.ts +18 -1
- package/src/arrow/index.ts +6 -0
- package/src/arrow/renderers/splats/conversion/make-gpu-splat-data-from-gltf.ts +224 -0
- package/src/arrow/renderers/text/renderers/arrow-text-renderer.ts +1 -0
- package/src/arrow/renderers/text/renderers/arrow-text-shaders.ts +12 -5
- package/src/compute/computation.ts +1 -1
- package/src/compute/swap.ts +2 -2
- 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/geometry/gpu-vector-geometry-adapter.ts +19 -1
- package/src/geometry/gpu-vector-geometry.ts +3 -0
- package/src/gltf/gltf/animations/animations.ts +8 -1
- package/src/gltf/gltf/create-gltf-model.ts +4 -0
- package/src/gltf/gltf/create-scenegraph-from-gltf.ts +98 -17
- package/src/gltf/gltf/gltf-billboard.ts +6 -1
- package/src/gltf/gltf/gltf-extension-support.ts +2 -2
- package/src/gltf/index.ts +2 -0
- package/src/gltf/parsers/parse-gltf-animations.ts +22 -8
- package/src/gltf/parsers/parse-gltf-lights.ts +42 -130
- package/src/gltf/parsers/parse-gltf-metadata.ts +40 -0
- package/src/gltf/parsers/parse-gltf.ts +32 -16
- package/src/gltf/parsers/parse-pbr-material.ts +35 -7
- package/src/gltf/parsers/post-process-gltf.ts +1 -0
- package/src/gltf/pbr/pbr-environment.ts +27 -1
- package/src/gltf/pbr/pbr-material.ts +8 -3
- package/src/gltf/types/gltf-json-schema.ts +1 -0
- package/src/gltf/types/gltf-postprocessed-schema.ts +3 -0
- package/src/gltf/types/gltf-types.ts +20 -0
- package/src/graph/models/path/path-attribute-model.ts +10 -1
- package/src/graph/models/path/path-storage-model.ts +10 -1
- package/src/graph/physics/physics-controller.ts +55 -1
- package/src/graph/physics/scenegraph-instance.ts +10 -0
- package/src/graph/tables/gpu-table-model.ts +3 -2
- package/src/index.ts +19 -0
- package/src/lighting/ambient-occlusion-pass.ts +130 -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 +107 -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 +360 -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-bindings.ts +11 -3
- package/src/model/gpu-vector-draw-batches.ts +12 -10
- package/src/model/gpu-vector-model.ts +96 -20
- package/src/model/model.ts +1 -1
- package/src/models/light-model-utils.ts +3 -2
- package/src/scenegraph/controllers/punctual-light-controller.ts +172 -0
- package/src/scenegraph/scene-metadata.ts +23 -0
- package/src/scenegraph/scenegraph-interaction.ts +131 -0
- package/src/scenegraph/scenegraph-node.ts +12 -0
- package/src/splats/README.md +46 -0
- package/src/splats/splat-data.ts +53 -45
- 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
|
@@ -19,6 +19,11 @@ import {Matrix3} from '@math.gl/core';
|
|
|
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;
|
|
@@ -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
|
|
@@ -746,6 +747,8 @@ export type GLTFTexturePostprocessed = {
|
|
|
746
747
|
*/
|
|
747
748
|
export type GLTFPostprocessed = {
|
|
748
749
|
id?: string;
|
|
750
|
+
/** Loader-supplied Gaussian descriptors, retaining source primitive identity. */
|
|
751
|
+
gaussianSplatPrimitives?: import('./gltf-types').GLTFGaussianSplatDescriptor[];
|
|
749
752
|
|
|
750
753
|
// GLTF attributes (possibly overridden)
|
|
751
754
|
/** Names of glTF extensions used somewhere in this asset. */
|
|
@@ -93,6 +93,26 @@ export type GLTFWithBuffers = {
|
|
|
93
93
|
images?: (GLTFImageData | null)[];
|
|
94
94
|
binary?: ArrayBuffer;
|
|
95
95
|
baseUri?: string;
|
|
96
|
+
/** Gaussian primitive descriptors supplied by the loader. */
|
|
97
|
+
gaussianSplatPrimitives?: GLTFGaussianSplatDescriptor[];
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
/** Loader-supplied Gaussian primitive identity and optional decoded payload. */
|
|
101
|
+
export type GLTFGaussianSplatDescriptor = {
|
|
102
|
+
/** Index of the source mesh. */
|
|
103
|
+
meshIndex: number;
|
|
104
|
+
/** Index of the source primitive within its mesh. */
|
|
105
|
+
primitiveIndex: number;
|
|
106
|
+
/** Source accessor indices for the primitive's Gaussian and feature attributes. */
|
|
107
|
+
attributes?: Readonly<Record<string, number>>;
|
|
108
|
+
/** Original Gaussian extension declaration, including its compression metadata. */
|
|
109
|
+
extension?: Readonly<Record<string, unknown>>;
|
|
110
|
+
/** Source buffer view containing the compressed payload. */
|
|
111
|
+
compressedBufferView?: number;
|
|
112
|
+
/** Decoder-specific result, such as a loaders.gl Mesh Arrow table. */
|
|
113
|
+
decoded?: unknown;
|
|
114
|
+
/** Copied compressed bytes retained by the loader, when available. */
|
|
115
|
+
compressedBytes?: Uint8Array;
|
|
96
116
|
};
|
|
97
117
|
|
|
98
118
|
/** Loader-derived index runs for KHR_mesh_primitive_restart. */
|
|
@@ -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,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 type {GPUPathStorageInputProps} from '@luma.gl/graph/experimental/models';
|
|
6
7
|
|
|
7
8
|
import {
|
|
@@ -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) {
|
|
@@ -46,7 +46,7 @@ export type PhysicsBodyOptions = Pick<
|
|
|
46
46
|
};
|
|
47
47
|
export type PhysicsControllerProps = Omit<
|
|
48
48
|
GPURigidBodyWorldProps,
|
|
49
|
-
'bodies' | 'publicationBounds' | 'publishPoses' | 'joints'
|
|
49
|
+
'bodies' | 'publicationBounds' | 'publishPoses' | 'joints' | 'vehicle'
|
|
50
50
|
> & {
|
|
51
51
|
scene: GroupNode;
|
|
52
52
|
/** Bound catch-up work; excess elapsed time is reported, not silently simulated. */
|
|
@@ -80,6 +80,11 @@ export class PhysicsController {
|
|
|
80
80
|
private readonly definitions = new Map<ScenegraphNode, PhysicsBodyOptions>();
|
|
81
81
|
private readonly handles = new Map<ScenegraphNode, PhysicsBody>();
|
|
82
82
|
private readonly manualTargets = new Set<ScenegraphNode>();
|
|
83
|
+
private vehicleAttachment?: {
|
|
84
|
+
chassis: ScenegraphNode;
|
|
85
|
+
terrain: ScenegraphNode;
|
|
86
|
+
options: Omit<NonNullable<GPURigidBodyWorldProps['vehicle']>, 'chassis' | 'terrainCollider'>;
|
|
87
|
+
};
|
|
83
88
|
private readonly joints: ScenegraphJoint[] = [];
|
|
84
89
|
private indices: ReadonlyMap<ScenegraphNode, number> = new Map();
|
|
85
90
|
private session?: ScenegraphPhysicsSession;
|
|
@@ -195,12 +200,42 @@ export class PhysicsController {
|
|
|
195
200
|
this.assertEditable();
|
|
196
201
|
const node = this.resolveNode(reference);
|
|
197
202
|
if (!node || !this.definitions.delete(node)) return false;
|
|
203
|
+
if (this.vehicleAttachment?.chassis === node || this.vehicleAttachment?.terrain === node)
|
|
204
|
+
this.vehicleAttachment = undefined;
|
|
198
205
|
this.handles.delete(node);
|
|
199
206
|
this.manualTargets.delete(node);
|
|
200
207
|
this.dirty = true;
|
|
201
208
|
return true;
|
|
202
209
|
}
|
|
203
210
|
|
|
211
|
+
/** Attach a four-wheel suspension to two registered body nodes or scene paths. */
|
|
212
|
+
setVehicle(
|
|
213
|
+
chassis: PhysicsNodeReference,
|
|
214
|
+
terrain: PhysicsNodeReference,
|
|
215
|
+
options: Omit<NonNullable<GPURigidBodyWorldProps['vehicle']>, 'chassis' | 'terrainCollider'>
|
|
216
|
+
): void {
|
|
217
|
+
this.assertEditable();
|
|
218
|
+
const chassisNode = this.resolveNode(chassis),
|
|
219
|
+
terrainNode = this.resolveNode(terrain);
|
|
220
|
+
if (!chassisNode || !terrainNode) throw new Error('Missing vehicle attachment');
|
|
221
|
+
this.vehicleAttachment = {
|
|
222
|
+
chassis: chassisNode,
|
|
223
|
+
terrain: terrainNode,
|
|
224
|
+
options: structuredClone(options)
|
|
225
|
+
};
|
|
226
|
+
this.dirty = true;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
/** Borrow wheel transforms relative to the registered chassis after preparation. */
|
|
230
|
+
get vehicleWheelPoses() {
|
|
231
|
+
return this.requireReady().world.vehicleWheelPoses;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
/** Update controls for subsequent fixed steps. */
|
|
235
|
+
setVehicleControls(throttle: number, steering: number, brake: number): void {
|
|
236
|
+
this.requireReady().world.setVehicleControls(throttle, steering, brake);
|
|
237
|
+
}
|
|
238
|
+
|
|
204
239
|
addJoint(options: PhysicsJointOptions): ScenegraphJoint {
|
|
205
240
|
this.assertEditable();
|
|
206
241
|
const {first, second, ...properties} = options;
|
|
@@ -239,6 +274,25 @@ export class PhysicsController {
|
|
|
239
274
|
this.worldOptions,
|
|
240
275
|
this.joints
|
|
241
276
|
);
|
|
277
|
+
if (this.vehicleAttachment) {
|
|
278
|
+
const chassis = scene.definition.bodies.get(this.vehicleAttachment.chassis);
|
|
279
|
+
const terrain = scene.definition.bodies.get(this.vehicleAttachment.terrain);
|
|
280
|
+
const bodies = scene.definition.world.bodies;
|
|
281
|
+
if (
|
|
282
|
+
chassis === undefined ||
|
|
283
|
+
terrain === undefined ||
|
|
284
|
+
(bodies[terrain].colliders?.length ?? 1) !== 1
|
|
285
|
+
)
|
|
286
|
+
throw new Error('Vehicle requires attached chassis and single-collider terrain');
|
|
287
|
+
const terrainCollider = bodies
|
|
288
|
+
.slice(0, terrain)
|
|
289
|
+
.reduce((count, body) => count + (body.colliders?.length ?? 1), 0);
|
|
290
|
+
scene.definition.world.vehicle = {
|
|
291
|
+
...this.vehicleAttachment.options,
|
|
292
|
+
chassis,
|
|
293
|
+
terrainCollider
|
|
294
|
+
};
|
|
295
|
+
}
|
|
242
296
|
if (this.session) await this.session.rebuild(async () => scene, preserveState);
|
|
243
297
|
else this.session = await ScenegraphPhysicsSession.create(this.device, scene);
|
|
244
298
|
this.indices = scene.definition.bodies;
|
|
@@ -227,6 +227,16 @@ export class ScenegraphPhysicsInstance {
|
|
|
227
227
|
}
|
|
228
228
|
const replacement = await compile(this.device, props);
|
|
229
229
|
try {
|
|
230
|
+
if (preserveState && props.vehicle && this.definition.world.vehicle) {
|
|
231
|
+
const previousChassis = this.definition.world.vehicle.chassis;
|
|
232
|
+
for (const [node, index] of authored.bodies) {
|
|
233
|
+
if (
|
|
234
|
+
index === props.vehicle.chassis &&
|
|
235
|
+
this.definition.bodies.get(node) === previousChassis
|
|
236
|
+
)
|
|
237
|
+
replacement.world.copyVehicleMotionFrom(this.world);
|
|
238
|
+
}
|
|
239
|
+
}
|
|
230
240
|
prepare?.(replacement.world);
|
|
231
241
|
replacement.world.publishPoses();
|
|
232
242
|
await this.finishSubmission();
|
|
@@ -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. */
|
package/src/index.ts
CHANGED
|
@@ -48,6 +48,7 @@ export {makeAnimationLoop} from './animation-loop/make-animation-loop';
|
|
|
48
48
|
export type {OrbitControlsProps, OrbitPosition} from './controls/orbit-controls';
|
|
49
49
|
export {OrbitControls} from './controls/orbit-controls';
|
|
50
50
|
|
|
51
|
+
export type {ModelDrawOptions} from './model/gpu-vector-model';
|
|
51
52
|
export type {ModelProps} from './model/model';
|
|
52
53
|
export {Model} from './model/model';
|
|
53
54
|
export type {MaterialProps} from './material/material';
|
|
@@ -78,6 +79,17 @@ export {DirectionalLightModel} from './models/directional-light-model';
|
|
|
78
79
|
|
|
79
80
|
// Scenegraph Core nodes
|
|
80
81
|
export {ScenegraphNode} from './scenegraph/scenegraph-node';
|
|
82
|
+
export {
|
|
83
|
+
isScenegraphInteractionEnabled,
|
|
84
|
+
getFirstScenegraphInteractionHit,
|
|
85
|
+
ScenegraphInteractionManager
|
|
86
|
+
} from './scenegraph/scenegraph-interaction';
|
|
87
|
+
export type {
|
|
88
|
+
ScenegraphInteractionKind,
|
|
89
|
+
ScenegraphInteractionHit,
|
|
90
|
+
ScenegraphInteractionEvent
|
|
91
|
+
} from './scenegraph/scenegraph-interaction';
|
|
92
|
+
export {SceneMetadata} from './scenegraph/scene-metadata';
|
|
81
93
|
export type {ScenegraphBounds} from './scenegraph/scenegraph-bounds';
|
|
82
94
|
export type {
|
|
83
95
|
DepthSortedTraversalContext,
|
|
@@ -237,6 +249,11 @@ export {
|
|
|
237
249
|
type BillboardDrawEntry,
|
|
238
250
|
type BillboardControllerProps
|
|
239
251
|
} from './scenegraph/controllers/billboard-controller';
|
|
252
|
+
export {
|
|
253
|
+
PunctualLightController,
|
|
254
|
+
type PunctualLightBinding,
|
|
255
|
+
type PunctualLightDefinition
|
|
256
|
+
} from './scenegraph/controllers/punctual-light-controller';
|
|
240
257
|
export {
|
|
241
258
|
AreaLightController,
|
|
242
259
|
type AreaLightDefinition,
|
|
@@ -354,3 +371,5 @@ export {makeAdapterAnimationBinding} from './animation/property-animation-bindin
|
|
|
354
371
|
export {deformPositions} from './animation/deform-positions';
|
|
355
372
|
|
|
356
373
|
export {createAreaLightLTCTextures} from './lighting/ltc-textures';
|
|
374
|
+
|
|
375
|
+
export {makeGPUVectorGeometry} from './geometry/gpu-vector-geometry-adapter';
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MIT
|
|
2
|
+
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
3
|
+
|
|
4
|
+
import {assert, type Device, type Texture} from '@luma.gl/core';
|
|
5
|
+
import type {CompositeShaderPass} from '@luma.gl/shaders';
|
|
6
|
+
import {Matrix4, type NumberArray16} from '@math.gl/core';
|
|
7
|
+
import {ShaderPassRenderer} from '../passes/shader-pass-renderer';
|
|
8
|
+
import {ssaoEvaluate} from '../effects/passes/screen-space/ssao';
|
|
9
|
+
import {gtaoEvaluate} from '../effects/passes/screen-space/gtao';
|
|
10
|
+
import {depthAwareBlur} from '../effects/passes/screen-space/depth-aware-blur';
|
|
11
|
+
|
|
12
|
+
export type AmbientOcclusionMode = 'none' | 'ssao' | 'gtao';
|
|
13
|
+
export type AmbientOcclusionPassProps = {
|
|
14
|
+
mode?: AmbientOcclusionMode;
|
|
15
|
+
resolutionScale?: number;
|
|
16
|
+
};
|
|
17
|
+
export type AmbientOcclusionRenderOptions = {
|
|
18
|
+
depthTexture: Texture;
|
|
19
|
+
normalTexture: Texture;
|
|
20
|
+
projectionMatrix: Readonly<Matrix4 | NumberArray16>;
|
|
21
|
+
near: number;
|
|
22
|
+
far: number;
|
|
23
|
+
/** SSAO uses pixels; GTAO uses view-space scene units. */
|
|
24
|
+
radius?: number;
|
|
25
|
+
bias?: number;
|
|
26
|
+
intensity?: number;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
/** Reuses the effects evaluators to produce ambient visibility, without color composition or history. */
|
|
30
|
+
export class AmbientOcclusionPass {
|
|
31
|
+
readonly device: Device;
|
|
32
|
+
readonly mode: AmbientOcclusionMode;
|
|
33
|
+
private readonly renderer: ShaderPassRenderer | null;
|
|
34
|
+
private readonly unoccluded: Texture;
|
|
35
|
+
private destroyed = false;
|
|
36
|
+
|
|
37
|
+
constructor(device: Device, props: AmbientOcclusionPassProps = {}) {
|
|
38
|
+
this.device = device;
|
|
39
|
+
this.mode = props.mode ?? 'gtao';
|
|
40
|
+
// Existing SSAO/GTAO evaluators support WebGPU. Callers can explicitly select none elsewhere.
|
|
41
|
+
assert(this.mode === 'none' || device.type === 'webgpu');
|
|
42
|
+
const scale = props.resolutionScale ?? 0.5;
|
|
43
|
+
// Resolution scale must describe a positive fractional input resolution.
|
|
44
|
+
assert(scale > 0 && scale <= 1);
|
|
45
|
+
this.unoccluded = device.createTexture({
|
|
46
|
+
width: 1,
|
|
47
|
+
height: 1,
|
|
48
|
+
data: new Uint8Array([255, 255, 255, 255])
|
|
49
|
+
});
|
|
50
|
+
if (this.mode === 'none') {
|
|
51
|
+
this.renderer = null;
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
const evaluate = this.mode === 'ssao' ? ssaoEvaluate : gtaoEvaluate;
|
|
55
|
+
const shaderPass: CompositeShaderPass<'ambientOcclusionRaw' | 'ambientOcclusionScratch'> = {
|
|
56
|
+
name: 'ambientOcclusionVisibility',
|
|
57
|
+
renderTargets: {
|
|
58
|
+
ambientOcclusionRaw: {scale: [scale, scale], format: 'rgba8unorm'},
|
|
59
|
+
ambientOcclusionScratch: {scale: [scale, scale], format: 'rgba8unorm'}
|
|
60
|
+
},
|
|
61
|
+
steps: [
|
|
62
|
+
{shaderPass: evaluate, inputs: {sourceTexture: 'original'}, output: 'ambientOcclusionRaw'},
|
|
63
|
+
{
|
|
64
|
+
shaderPass: depthAwareBlur,
|
|
65
|
+
inputs: {sourceTexture: 'ambientOcclusionRaw'},
|
|
66
|
+
output: 'ambientOcclusionScratch',
|
|
67
|
+
uniforms: {direction: [1, 0]}
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
shaderPass: depthAwareBlur,
|
|
71
|
+
inputs: {sourceTexture: 'ambientOcclusionScratch'},
|
|
72
|
+
output: 'previous',
|
|
73
|
+
uniforms: {direction: [0, 1]}
|
|
74
|
+
}
|
|
75
|
+
]
|
|
76
|
+
};
|
|
77
|
+
this.renderer = new ShaderPassRenderer(device, {
|
|
78
|
+
shaderPasses: [shaderPass],
|
|
79
|
+
colorFormat: 'rgba8unorm'
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/** Borrows same-camera WebGPU hardware depth and encoded view normals; never submits. */
|
|
84
|
+
render(options: AmbientOcclusionRenderOptions): Texture {
|
|
85
|
+
// Even disabled passes must not be used after destruction.
|
|
86
|
+
assert(!this.destroyed);
|
|
87
|
+
if (!this.renderer) return this.unoccluded;
|
|
88
|
+
const {depthTexture, normalTexture} = options;
|
|
89
|
+
// Inputs must share the device and physical resolution.
|
|
90
|
+
assert(depthTexture.device === this.device && normalTexture.device === this.device);
|
|
91
|
+
assert(
|
|
92
|
+
depthTexture.width === normalTexture.width && depthTexture.height === normalTexture.height
|
|
93
|
+
);
|
|
94
|
+
const projectionMatrix = new Matrix4(options.projectionMatrix);
|
|
95
|
+
this.renderer.resize([normalTexture.width, normalTexture.height]);
|
|
96
|
+
const controls = {
|
|
97
|
+
...(options.radius === undefined ? {} : {radius: options.radius}),
|
|
98
|
+
...(options.bias === undefined ? {} : {bias: options.bias}),
|
|
99
|
+
...(options.intensity === undefined ? {} : {intensity: options.intensity})
|
|
100
|
+
};
|
|
101
|
+
const result = this.renderer.renderToTexture({
|
|
102
|
+
sourceTexture: normalTexture,
|
|
103
|
+
bindings: {depthTexture, normalTexture},
|
|
104
|
+
uniforms: {
|
|
105
|
+
ssaoEvaluate: {
|
|
106
|
+
...controls,
|
|
107
|
+
nearPlane: options.near,
|
|
108
|
+
farPlane: options.far,
|
|
109
|
+
useNormalTexture: 1
|
|
110
|
+
},
|
|
111
|
+
gtaoEvaluate: {
|
|
112
|
+
...controls,
|
|
113
|
+
projectionMatrix,
|
|
114
|
+
inverseProjectionMatrix: new Matrix4(projectionMatrix).invert(),
|
|
115
|
+
frameIndex: 0
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
});
|
|
119
|
+
// Concrete inputs always produce a texture; deferred uploads are not accepted.
|
|
120
|
+
assert(result);
|
|
121
|
+
return result;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
destroy(): void {
|
|
125
|
+
if (this.destroyed) return;
|
|
126
|
+
this.destroyed = true;
|
|
127
|
+
this.renderer?.destroy();
|
|
128
|
+
this.unoccluded.destroy();
|
|
129
|
+
}
|
|
130
|
+
}
|