@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
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
// luma.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
|
+
|
|
5
|
+
export type ShadowQualitySettings = {
|
|
6
|
+
cascadeCount: number;
|
|
7
|
+
directionalMapSize: number;
|
|
8
|
+
spotMapSize: number;
|
|
9
|
+
pointMapSize: number;
|
|
10
|
+
blockerSampleCount: number;
|
|
11
|
+
filterSampleCount: number;
|
|
12
|
+
contactScale: number;
|
|
13
|
+
contactStepCount: number;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
/** Fixed quality settings shared by shadow maps, PCSS and contact refinement. */
|
|
17
|
+
export const SHADOW_QUALITY_SETTINGS: Readonly<
|
|
18
|
+
Record<'low' | 'balanced' | 'cinematic', Readonly<ShadowQualitySettings>>
|
|
19
|
+
> = Object.freeze({
|
|
20
|
+
low: Object.freeze({
|
|
21
|
+
cascadeCount: 3,
|
|
22
|
+
directionalMapSize: 1024,
|
|
23
|
+
spotMapSize: 512,
|
|
24
|
+
pointMapSize: 256,
|
|
25
|
+
blockerSampleCount: 8,
|
|
26
|
+
filterSampleCount: 12,
|
|
27
|
+
contactScale: 0.5,
|
|
28
|
+
contactStepCount: 12
|
|
29
|
+
}),
|
|
30
|
+
balanced: Object.freeze({
|
|
31
|
+
cascadeCount: 4,
|
|
32
|
+
directionalMapSize: 1536,
|
|
33
|
+
spotMapSize: 1024,
|
|
34
|
+
pointMapSize: 512,
|
|
35
|
+
blockerSampleCount: 16,
|
|
36
|
+
filterSampleCount: 24,
|
|
37
|
+
contactScale: 0.75,
|
|
38
|
+
contactStepCount: 24
|
|
39
|
+
}),
|
|
40
|
+
cinematic: Object.freeze({
|
|
41
|
+
cascadeCount: 4,
|
|
42
|
+
directionalMapSize: 2048,
|
|
43
|
+
spotMapSize: 2048,
|
|
44
|
+
pointMapSize: 1024,
|
|
45
|
+
blockerSampleCount: 24,
|
|
46
|
+
filterSampleCount: 48,
|
|
47
|
+
contactScale: 1,
|
|
48
|
+
contactStepCount: 40
|
|
49
|
+
})
|
|
50
|
+
});
|
package/src/material/material.ts
CHANGED
|
@@ -87,6 +87,8 @@ export class Material<
|
|
|
87
87
|
> {
|
|
88
88
|
/** Application-provided identifier. */
|
|
89
89
|
readonly id: string;
|
|
90
|
+
/** Structured metadata associated with this material. */
|
|
91
|
+
metadata: Record<string, unknown> = {};
|
|
90
92
|
/** Device that owns the material resources. */
|
|
91
93
|
readonly device: Device;
|
|
92
94
|
/** Factory that defines the material schema. */
|
|
@@ -156,6 +158,7 @@ export class Material<
|
|
|
156
158
|
if (props.moduleProps) {
|
|
157
159
|
material.setProps(props.moduleProps);
|
|
158
160
|
}
|
|
161
|
+
material.metadata = {...this.metadata};
|
|
159
162
|
material.updateShaderInputs();
|
|
160
163
|
return material;
|
|
161
164
|
}
|
|
@@ -51,9 +51,17 @@ export class GPUVectorBindings {
|
|
|
51
51
|
setInputs(
|
|
52
52
|
columns: GPUVectorModelAttributes,
|
|
53
53
|
explicitLayouts: BufferLayout[] | undefined,
|
|
54
|
-
stepMode: 'vertex' | 'instance'
|
|
54
|
+
stepMode: 'vertex' | 'instance',
|
|
55
|
+
enforceMatchingVectorLengths = true
|
|
55
56
|
): void {
|
|
56
|
-
|
|
57
|
+
if (enforceMatchingVectorLengths) {
|
|
58
|
+
validateGPUVectorBatchStructure(columns);
|
|
59
|
+
} else {
|
|
60
|
+
// Independent attributes currently require contiguous storage.
|
|
61
|
+
for (const column of Object.values(columns)) {
|
|
62
|
+
if (column && !isConstant(column)) assert(column.data.length === 1);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
57
65
|
this.claimedNames.clear();
|
|
58
66
|
this.inputs = columns;
|
|
59
67
|
this.sourceLayouts = explicitLayouts;
|
|
@@ -87,7 +95,7 @@ export class GPUVectorBindings {
|
|
|
87
95
|
// Inputs must describe a typed vector or a typed constant, never raw buffers or arrays.
|
|
88
96
|
if (!isConstant(column) && !Array.isArray(column.data))
|
|
89
97
|
throw new TypeError(`Expected a GPU vector or constant for ${name}`);
|
|
90
|
-
if (!isConstant(column)) {
|
|
98
|
+
if (!isConstant(column) && enforceMatchingVectorLengths) {
|
|
91
99
|
const layout = layouts.find(
|
|
92
100
|
layout =>
|
|
93
101
|
layout.name === name ||
|
|
@@ -19,7 +19,8 @@ export function drawGPUVectorGroups(
|
|
|
19
19
|
geometry: GPUVectorBindings,
|
|
20
20
|
attributes: GPUVectorBindings,
|
|
21
21
|
syncBindings: () => void,
|
|
22
|
-
draw: () => boolean
|
|
22
|
+
draw: () => boolean,
|
|
23
|
+
inferDrawCount?: 'instance' | 'vertex' | 'no'
|
|
23
24
|
): boolean {
|
|
24
25
|
const geometryInputs = geometry.inputs;
|
|
25
26
|
const attributeInputs = attributes.inputs;
|
|
@@ -68,16 +69,17 @@ export function drawGPUVectorGroups(
|
|
|
68
69
|
: attributes.vertexCount !== undefined
|
|
69
70
|
? attributeOffsets[attributeBatchIndex]
|
|
70
71
|
: 0;
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
72
|
+
if (inferDrawCount === 'vertex')
|
|
73
|
+
model.setVertexCount(
|
|
74
|
+
Math.max(
|
|
75
|
+
0,
|
|
76
|
+
Math.min(
|
|
77
|
+
geometry.rowCount ?? attributes.vertexCount ?? vertexCount,
|
|
78
|
+
vertexCount - vertexOffset
|
|
79
|
+
)
|
|
77
80
|
)
|
|
78
|
-
)
|
|
79
|
-
)
|
|
80
|
-
if (attributes.instanceCount !== undefined)
|
|
81
|
+
);
|
|
82
|
+
if (inferDrawCount === 'instance' && attributes.instanceCount !== undefined)
|
|
81
83
|
model.setInstanceCount(
|
|
82
84
|
Math.max(
|
|
83
85
|
0,
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
4
|
|
|
5
|
-
import
|
|
5
|
+
import type {NumberArray4, NumberArray6, TypedArray} from '@math.gl/core';
|
|
6
6
|
import {
|
|
7
7
|
type RenderPipelineProps,
|
|
8
8
|
type RenderPipelineParameters,
|
|
@@ -110,13 +110,33 @@ type ModelBuffer = Buffer | DynamicBuffer;
|
|
|
110
110
|
/** Shader layout subset needed while resolving texture binding sources. */
|
|
111
111
|
export type AnyShaderLayout = Pick<ShaderLayout | ComputeShaderLayout, 'bindings'>;
|
|
112
112
|
|
|
113
|
+
/** Per-draw overrides shared by Model and GPUVectorModel. */
|
|
114
|
+
export type ModelDrawOptions = {
|
|
115
|
+
/** Dynamic parameters scoped to this draw, including internal vector batches. */
|
|
116
|
+
parameters?: {
|
|
117
|
+
/** Viewport [x, y, width, height, minDepth?, maxDepth?]. */
|
|
118
|
+
viewport?: NumberArray4 | NumberArray6;
|
|
119
|
+
/** Scissor rectangle [x, y, width, height], or null to disable clipping. */
|
|
120
|
+
scissorRect?: NumberArray4 | null;
|
|
121
|
+
/** Blend color used by constant blend factors. */
|
|
122
|
+
blendConstant?: NumberArray4;
|
|
123
|
+
/** Value used for stencil comparison and replacement. */
|
|
124
|
+
stencilReference?: number;
|
|
125
|
+
};
|
|
126
|
+
};
|
|
127
|
+
|
|
113
128
|
export type GPUVectorModelProps = Omit<RenderPipelineProps, 'vs' | 'fs' | 'bindings'> & {
|
|
114
129
|
/** GPU-only mesh inputs, indices, and topology. */
|
|
115
130
|
geometry?: GPUVectorGeometry | null;
|
|
116
131
|
/** Supplemental vertex or instance vectors and constants. */
|
|
117
132
|
attributeVectors?: GPUVectorModelAttributes;
|
|
118
|
-
/**
|
|
119
|
-
|
|
133
|
+
/**
|
|
134
|
+
* Count inferred from vector rows or each explicit batch. `no` preserves both counts.
|
|
135
|
+
* @default 'no'
|
|
136
|
+
*/
|
|
137
|
+
inferDrawCount?: 'instance' | 'vertex' | 'no';
|
|
138
|
+
/** Require aligned lengths and chunks. False requires inferDrawCount: 'no' and single chunks. */
|
|
139
|
+
enforceMatchingVectorLengths?: boolean;
|
|
120
140
|
source?: string;
|
|
121
141
|
/** Input language compiled by the application-registered shader assembler transpiler. */
|
|
122
142
|
sourceLanguage?: string;
|
|
@@ -228,7 +248,8 @@ export class GPUVectorModel {
|
|
|
228
248
|
|
|
229
249
|
static defaultProps: Required<GPUVectorModelProps> = {
|
|
230
250
|
...RenderPipeline.defaultProps,
|
|
231
|
-
|
|
251
|
+
inferDrawCount: 'no',
|
|
252
|
+
enforceMatchingVectorLengths: true,
|
|
232
253
|
geometry: null,
|
|
233
254
|
attributeVectors: undefined!,
|
|
234
255
|
source: undefined!,
|
|
@@ -478,7 +499,7 @@ export class GPUVectorModel {
|
|
|
478
499
|
...this.props,
|
|
479
500
|
modules,
|
|
480
501
|
defines,
|
|
481
|
-
|
|
502
|
+
pluginInjectionTargets: resolvedPlugins.injectionTargets,
|
|
482
503
|
pluginInjections: resolvedPlugins.injections,
|
|
483
504
|
pluginVertexInputs: resolvedPlugins.vertexInputs,
|
|
484
505
|
pluginInterStageVariables: resolvedPlugins.interStageVariables
|
|
@@ -516,7 +537,7 @@ export class GPUVectorModel {
|
|
|
516
537
|
...this.props,
|
|
517
538
|
modules,
|
|
518
539
|
defines,
|
|
519
|
-
|
|
540
|
+
pluginInjectionTargets: resolvedPlugins.injectionTargets,
|
|
520
541
|
pluginInjections: resolvedPlugins.injections,
|
|
521
542
|
pluginVertexInputs: resolvedPlugins.vertexInputs,
|
|
522
543
|
pluginInterStageVariables: resolvedPlugins.interStageVariables
|
|
@@ -659,9 +680,32 @@ export class GPUVectorModel {
|
|
|
659
680
|
/**
|
|
660
681
|
* Issue one draw call.
|
|
661
682
|
* @param renderPass - render pass to draw into
|
|
683
|
+
* @param options - Optional dynamic parameters restored after drawing, including on errors.
|
|
662
684
|
* @returns `true` if the draw call was executed, `false` if resources were not ready.
|
|
663
685
|
*/
|
|
664
|
-
draw(renderPass: RenderPass): boolean {
|
|
686
|
+
draw(renderPass: RenderPass, options?: ModelDrawOptions): boolean {
|
|
687
|
+
if (options?.parameters) {
|
|
688
|
+
return this._withDrawParameters(renderPass, options.parameters, () => this._draw(renderPass));
|
|
689
|
+
}
|
|
690
|
+
return this._draw(renderPass);
|
|
691
|
+
}
|
|
692
|
+
|
|
693
|
+
/** Applies draw overrides around the complete model batch, including failure paths. */
|
|
694
|
+
protected _withDrawParameters<T>(
|
|
695
|
+
renderPass: RenderPass,
|
|
696
|
+
parameters: NonNullable<ModelDrawOptions['parameters']>,
|
|
697
|
+
draw: () => T
|
|
698
|
+
): T {
|
|
699
|
+
const state = renderPass.getParameters();
|
|
700
|
+
try {
|
|
701
|
+
renderPass.setParameters(parameters);
|
|
702
|
+
return draw();
|
|
703
|
+
} finally {
|
|
704
|
+
renderPass.setParameters(state);
|
|
705
|
+
}
|
|
706
|
+
}
|
|
707
|
+
|
|
708
|
+
private _draw(renderPass: RenderPass): boolean {
|
|
665
709
|
if (this.indexVector?.length === 0) {
|
|
666
710
|
this._lastDrawTimestamp = this.device.timestamp;
|
|
667
711
|
this._needsRedraw = false;
|
|
@@ -800,13 +844,22 @@ export class GPUVectorModel {
|
|
|
800
844
|
bufferLayouts ??=
|
|
801
845
|
this.getExplicitVectorLayouts(vectors) ??
|
|
802
846
|
this.getExplicitVectorLayouts(vectors, this.geometryVectorBindings.sourceLayouts);
|
|
803
|
-
|
|
804
|
-
if (
|
|
847
|
+
this.validateVectorLengthPolicy();
|
|
848
|
+
if (this.props.enforceMatchingVectorLengths) validateGPUVectorBatchStructure(vectors);
|
|
849
|
+
if (
|
|
850
|
+
this.props.enforceMatchingVectorLengths &&
|
|
851
|
+
(!this.isInstanced || this.attributeVectorBindings.vertexCount !== undefined)
|
|
852
|
+
)
|
|
805
853
|
validateGPUVectorBatchStructure([
|
|
806
854
|
...Object.values(vectors),
|
|
807
855
|
...Object.values(this.attributeVectorBindings.inputs)
|
|
808
856
|
]);
|
|
809
|
-
this.geometryVectorBindings.setInputs(
|
|
857
|
+
this.geometryVectorBindings.setInputs(
|
|
858
|
+
vectors,
|
|
859
|
+
bufferLayouts,
|
|
860
|
+
'vertex',
|
|
861
|
+
this.props.enforceMatchingVectorLengths
|
|
862
|
+
);
|
|
810
863
|
this.claimVectorLayouts(this.geometryVectorBindings);
|
|
811
864
|
this.syncVectorBindings();
|
|
812
865
|
const rowCount = this.geometryVectorBindings.rowCount;
|
|
@@ -815,7 +868,8 @@ export class GPUVectorModel {
|
|
|
815
868
|
this.attributeVectorBindings.vertexCount === undefined ||
|
|
816
869
|
rowCount === this.attributeVectorBindings.vertexCount
|
|
817
870
|
);
|
|
818
|
-
|
|
871
|
+
if (this.props.inferDrawCount === 'vertex')
|
|
872
|
+
this.setVertexCount(rowCount ?? this.attributeVectorBindings.vertexCount ?? 0);
|
|
819
873
|
}
|
|
820
874
|
|
|
821
875
|
/** Replaces supplemental vectors; instanced models default these inputs to instance step mode. */
|
|
@@ -843,7 +897,8 @@ export class GPUVectorModel {
|
|
|
843
897
|
layout.attributes?.some(attribute => attribute.attribute === name)
|
|
844
898
|
)?.stepMode ?? vector.bufferLayout?.stepMode) === 'vertex'
|
|
845
899
|
);
|
|
846
|
-
|
|
900
|
+
this.validateVectorLengthPolicy();
|
|
901
|
+
if (usesVertexRows && this.props.enforceMatchingVectorLengths)
|
|
847
902
|
validateGPUVectorBatchStructure([
|
|
848
903
|
...Object.values(this.geometryVectorBindings.inputs),
|
|
849
904
|
...Object.values(vectors)
|
|
@@ -851,14 +906,18 @@ export class GPUVectorModel {
|
|
|
851
906
|
this.attributeVectorBindings.setInputs(
|
|
852
907
|
vectors,
|
|
853
908
|
bufferLayouts,
|
|
854
|
-
this.isInstanced ? 'instance' : 'vertex'
|
|
909
|
+
this.isInstanced ? 'instance' : 'vertex',
|
|
910
|
+
this.props.enforceMatchingVectorLengths
|
|
855
911
|
);
|
|
856
912
|
this.claimVectorLayouts(this.attributeVectorBindings);
|
|
857
913
|
this.syncVectorBindings();
|
|
858
|
-
if (
|
|
914
|
+
if (
|
|
915
|
+
this.props.inferDrawCount === 'instance' &&
|
|
916
|
+
this.attributeVectorBindings.instanceCount !== undefined
|
|
917
|
+
)
|
|
859
918
|
this.setInstanceCount(this.attributeVectorBindings.instanceCount);
|
|
860
919
|
const vertexCount = this.attributeVectorBindings.vertexCount;
|
|
861
|
-
if (vertexCount !== undefined) {
|
|
920
|
+
if (vertexCount !== undefined && this.props.inferDrawCount === 'vertex') {
|
|
862
921
|
const geometryRowCount = this.geometryVectorBindings.rowCount;
|
|
863
922
|
// Supplemental vertex columns describe the same rows as the geometry columns.
|
|
864
923
|
assert(geometryRowCount === undefined || geometryRowCount === vertexCount);
|
|
@@ -999,7 +1058,8 @@ export class GPUVectorModel {
|
|
|
999
1058
|
this.geometryVectorBindings,
|
|
1000
1059
|
this.attributeVectorBindings,
|
|
1001
1060
|
() => this.syncVectorBindings(),
|
|
1002
|
-
() => GPUVectorModel.prototype.draw.call(this, renderPass)
|
|
1061
|
+
() => GPUVectorModel.prototype.draw.call(this, renderPass),
|
|
1062
|
+
this.props.inferDrawCount
|
|
1003
1063
|
);
|
|
1004
1064
|
if (success) {
|
|
1005
1065
|
this._lastDrawTimestamp = this.device.timestamp;
|
|
@@ -1112,9 +1172,16 @@ export class GPUVectorModel {
|
|
|
1112
1172
|
);
|
|
1113
1173
|
}
|
|
1114
1174
|
|
|
1175
|
+
private validateVectorLengthPolicy(): void {
|
|
1176
|
+
// Independent lengths cannot determine a common draw count.
|
|
1177
|
+
assert(this.props.enforceMatchingVectorLengths !== false || this.props.inferDrawCount === 'no');
|
|
1178
|
+
}
|
|
1179
|
+
|
|
1115
1180
|
private setBatchDrawCount(
|
|
1116
1181
|
rowCount: number,
|
|
1117
|
-
count: GPUVectorModelCount = this.props.
|
|
1182
|
+
count: GPUVectorModelCount = this.props.inferDrawCount === 'no'
|
|
1183
|
+
? 'none'
|
|
1184
|
+
: this.props.inferDrawCount
|
|
1118
1185
|
): void {
|
|
1119
1186
|
if (count === 'instance') {
|
|
1120
1187
|
this.setInstanceCount(rowCount);
|
|
@@ -1148,13 +1215,22 @@ export class GPUVectorModel {
|
|
|
1148
1215
|
this.getExplicitVectorLayouts(geometry.inputs) ?? geometry.sourceLayouts;
|
|
1149
1216
|
const attributeLayouts =
|
|
1150
1217
|
this.getExplicitVectorLayouts(attributes.inputs) ?? attributes.sourceLayouts;
|
|
1151
|
-
geometry.setInputs(
|
|
1218
|
+
geometry.setInputs(
|
|
1219
|
+
geometry.inputs,
|
|
1220
|
+
geometryLayouts,
|
|
1221
|
+
'vertex',
|
|
1222
|
+
this.props.enforceMatchingVectorLengths
|
|
1223
|
+
);
|
|
1152
1224
|
attributes.setInputs(
|
|
1153
1225
|
attributes.inputs,
|
|
1154
1226
|
attributeLayouts,
|
|
1155
|
-
this.isInstanced ? 'instance' : 'vertex'
|
|
1227
|
+
this.isInstanced ? 'instance' : 'vertex',
|
|
1228
|
+
this.props.enforceMatchingVectorLengths
|
|
1156
1229
|
);
|
|
1157
|
-
if (
|
|
1230
|
+
if (
|
|
1231
|
+
this.props.enforceMatchingVectorLengths &&
|
|
1232
|
+
(!this.isInstanced || attributes.vertexCount !== undefined)
|
|
1233
|
+
)
|
|
1158
1234
|
validateGPUVectorBatchStructure([
|
|
1159
1235
|
...Object.values(geometry.inputs),
|
|
1160
1236
|
...Object.values(attributes.inputs)
|
package/src/model/model.ts
CHANGED
|
@@ -17,7 +17,7 @@ import {makeGPUVectorGeometryFromGPUGeometry} from '../geometry/gpu-vector-geome
|
|
|
17
17
|
import {isTextureBindingSource} from '@luma.gl/core/dynamic';
|
|
18
18
|
|
|
19
19
|
/** Properties for the high-level rendering model. */
|
|
20
|
-
export type ModelProps = Omit<GPUVectorModelProps, '
|
|
20
|
+
export type ModelProps = Omit<GPUVectorModelProps, 'geometry'> & {
|
|
21
21
|
/** Geometry adapted into GPU attributes, buffer layouts, topology, and draw counts. */
|
|
22
22
|
geometry?: GPUVectorGeometry | GPUGeometry | Geometry | null;
|
|
23
23
|
/** Material-owned group-3 bindings and uniforms. */
|
|
@@ -6,6 +6,7 @@ import {Buffer, Device, type RenderPass, type RenderPipelineParameters} from '@l
|
|
|
6
6
|
import {Matrix4, type NumericArray} from '@math.gl/core';
|
|
7
7
|
import type {DirectionalLight, Light, PointLight, ShaderModule, SpotLight} from '@luma.gl/shaders';
|
|
8
8
|
import {Model, type ModelProps} from '../model/model';
|
|
9
|
+
import type {ModelDrawOptions} from '../model/gpu-vector-model';
|
|
9
10
|
import {ShaderInputs} from '../shader-inputs';
|
|
10
11
|
import type {Geometry} from '../geometry/geometry';
|
|
11
12
|
|
|
@@ -154,11 +155,11 @@ export abstract class BaseLightModel<PropsT extends BaseLightModelProps> extends
|
|
|
154
155
|
this._managedBuffers = {} as ManagedInstanceBuffers;
|
|
155
156
|
}
|
|
156
157
|
|
|
157
|
-
override draw(renderPass: RenderPass): boolean {
|
|
158
|
+
override draw(renderPass: RenderPass, options?: ModelDrawOptions): boolean {
|
|
158
159
|
if (this.instanceCount === 0) {
|
|
159
160
|
return true;
|
|
160
161
|
}
|
|
161
|
-
return super.draw(renderPass);
|
|
162
|
+
return super.draw(renderPass, options);
|
|
162
163
|
}
|
|
163
164
|
|
|
164
165
|
setProps(props: Partial<PropsT>): void {
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
// luma.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
|
+
|
|
5
|
+
import {Matrix4} from '@math.gl/core';
|
|
6
|
+
import {
|
|
7
|
+
normalizeByteColor3,
|
|
8
|
+
type DirectionalLight,
|
|
9
|
+
type Light,
|
|
10
|
+
type PointLight,
|
|
11
|
+
type SpotLight
|
|
12
|
+
} from '@luma.gl/shaders';
|
|
13
|
+
import type {ScenegraphNode} from '../scenegraph-node';
|
|
14
|
+
|
|
15
|
+
/** Light parameters in local space with normalized RGB color. */
|
|
16
|
+
export type PunctualLightDefinition = {
|
|
17
|
+
type: 'directional' | 'point' | 'spot';
|
|
18
|
+
color?: [number, number, number];
|
|
19
|
+
intensity?: number;
|
|
20
|
+
range?: number;
|
|
21
|
+
spot?: {innerConeAngle?: number; outerConeAngle?: number};
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
/** A light and its root-to-light scenegraph path. */
|
|
25
|
+
export type PunctualLightBinding = {
|
|
26
|
+
path: readonly ScenegraphNode[];
|
|
27
|
+
definition: PunctualLightDefinition;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
/** Projects bound lights using live node transforms and inherited visibility. */
|
|
31
|
+
export class PunctualLightController {
|
|
32
|
+
readonly lights: Light[] = [];
|
|
33
|
+
|
|
34
|
+
constructor(
|
|
35
|
+
private readonly bindings: readonly PunctualLightBinding[],
|
|
36
|
+
private readonly useByteColors = true
|
|
37
|
+
) {
|
|
38
|
+
this.update();
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/** Refreshes the stable light array after node or light properties change. */
|
|
42
|
+
update(): void {
|
|
43
|
+
this.lights.length = 0;
|
|
44
|
+
for (const {path, definition} of this.bindings) {
|
|
45
|
+
if (!path.length || path.some(node => !node.display)) continue;
|
|
46
|
+
const worldMatrix = new Matrix4();
|
|
47
|
+
for (const node of path) worldMatrix.multiplyRight(node.matrix);
|
|
48
|
+
const light = makePunctualLight(definition, worldMatrix, this.useByteColors);
|
|
49
|
+
if (light) this.lights.push(light);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/** Projects a local light definition into the shader's world-space light format. */
|
|
55
|
+
export function makePunctualLight(
|
|
56
|
+
definition: PunctualLightDefinition,
|
|
57
|
+
worldMatrix: Matrix4,
|
|
58
|
+
useByteColors: boolean
|
|
59
|
+
): Light | undefined {
|
|
60
|
+
const color = normalizePunctualLightColor(definition.color || [1, 1, 1], useByteColors);
|
|
61
|
+
const intensity = definition.intensity ?? 1;
|
|
62
|
+
switch (definition.type) {
|
|
63
|
+
case 'directional':
|
|
64
|
+
return makeDirectionalLight(worldMatrix, color, intensity);
|
|
65
|
+
case 'point':
|
|
66
|
+
return makePointLight(worldMatrix, color, intensity, definition.range);
|
|
67
|
+
case 'spot':
|
|
68
|
+
return makeSpotLight(worldMatrix, color, intensity, definition.range, definition.spot);
|
|
69
|
+
default:
|
|
70
|
+
return undefined;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Converts normalized colors from the 0-1 spec range to the configured luma light convention.
|
|
76
|
+
*/
|
|
77
|
+
function normalizePunctualLightColor(
|
|
78
|
+
color: [number, number, number],
|
|
79
|
+
useByteColors: boolean
|
|
80
|
+
): [number, number, number] {
|
|
81
|
+
if (useByteColors) {
|
|
82
|
+
return color.map(component => component * 255) as [number, number, number];
|
|
83
|
+
}
|
|
84
|
+
return normalizeByteColor3(color, false) as [number, number, number];
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Converts a punctual light attached to a node into a point light.
|
|
89
|
+
*/
|
|
90
|
+
function makePointLight(
|
|
91
|
+
worldMatrix: Matrix4,
|
|
92
|
+
color: [number, number, number],
|
|
93
|
+
intensity: number,
|
|
94
|
+
range?: number
|
|
95
|
+
): PointLight {
|
|
96
|
+
const position = getLightPosition(worldMatrix);
|
|
97
|
+
|
|
98
|
+
let attenuation: Readonly<[number, number, number]> = [1, 0, 0];
|
|
99
|
+
if (range !== undefined && range > 0) {
|
|
100
|
+
attenuation = [1, 0, 1 / (range * range)] as [number, number, number];
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
return {
|
|
104
|
+
type: 'point',
|
|
105
|
+
position,
|
|
106
|
+
color,
|
|
107
|
+
intensity,
|
|
108
|
+
attenuation
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Converts a punctual light attached to a node into a directional light.
|
|
114
|
+
*/
|
|
115
|
+
function makeDirectionalLight(
|
|
116
|
+
worldMatrix: Matrix4,
|
|
117
|
+
color: [number, number, number],
|
|
118
|
+
intensity: number
|
|
119
|
+
): DirectionalLight {
|
|
120
|
+
const direction = getLightDirection(worldMatrix);
|
|
121
|
+
|
|
122
|
+
return {
|
|
123
|
+
type: 'directional',
|
|
124
|
+
direction,
|
|
125
|
+
color,
|
|
126
|
+
intensity
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* Converts a punctual light attached to a node into a spot light.
|
|
132
|
+
*/
|
|
133
|
+
function makeSpotLight(
|
|
134
|
+
worldMatrix: Matrix4,
|
|
135
|
+
color: [number, number, number],
|
|
136
|
+
intensity: number,
|
|
137
|
+
range?: number,
|
|
138
|
+
spot: {innerConeAngle?: number; outerConeAngle?: number} = {}
|
|
139
|
+
): SpotLight {
|
|
140
|
+
const position = getLightPosition(worldMatrix);
|
|
141
|
+
const direction = getLightDirection(worldMatrix);
|
|
142
|
+
|
|
143
|
+
let attenuation: Readonly<[number, number, number]> = [1, 0, 0];
|
|
144
|
+
if (range !== undefined && range > 0) {
|
|
145
|
+
attenuation = [1, 0, 1 / (range * range)] as [number, number, number];
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
return {
|
|
149
|
+
type: 'spot',
|
|
150
|
+
position,
|
|
151
|
+
direction,
|
|
152
|
+
color,
|
|
153
|
+
intensity,
|
|
154
|
+
attenuation,
|
|
155
|
+
innerConeAngle: spot.innerConeAngle ?? 0,
|
|
156
|
+
outerConeAngle: spot.outerConeAngle ?? Math.PI / 4
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* Resolves the world-space position of a light node.
|
|
162
|
+
*/
|
|
163
|
+
function getLightPosition(worldMatrix: Matrix4): [number, number, number] {
|
|
164
|
+
return worldMatrix.transformAsPoint([0, 0, 0]) as [number, number, number];
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* Resolves the world-space forward direction of a light node.
|
|
169
|
+
*/
|
|
170
|
+
function getLightDirection(worldMatrix: Matrix4): [number, number, number] {
|
|
171
|
+
return worldMatrix.transformAsVector([0, 0, -1]) as [number, number, number];
|
|
172
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// luma.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
|
+
|
|
5
|
+
/** A collection of source metadata associated with indexed scene resources. */
|
|
6
|
+
export class SceneMetadata {
|
|
7
|
+
private readonly entries = new Map<string, Map<number, Readonly<Record<string, unknown>>>>();
|
|
8
|
+
|
|
9
|
+
/** Associates metadata with a resource category and its source index. */
|
|
10
|
+
set(category: string, index: number, metadata: Readonly<Record<string, unknown>>): void {
|
|
11
|
+
let categoryEntries = this.entries.get(category);
|
|
12
|
+
if (!categoryEntries) {
|
|
13
|
+
categoryEntries = new Map();
|
|
14
|
+
this.entries.set(category, categoryEntries);
|
|
15
|
+
}
|
|
16
|
+
categoryEntries.set(index, metadata);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/** Returns metadata for a resource, or undefined when none was supplied. */
|
|
20
|
+
get(category: string, index = 0): Readonly<Record<string, unknown>> | undefined {
|
|
21
|
+
return this.entries.get(category)?.get(index);
|
|
22
|
+
}
|
|
23
|
+
}
|