@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,131 @@
|
|
|
1
|
+
// luma.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
|
+
|
|
5
|
+
import type {ScenegraphNode} from './scenegraph-node';
|
|
6
|
+
|
|
7
|
+
/** Action whose authored subtree eligibility is being evaluated. */
|
|
8
|
+
export type ScenegraphInteractionKind = 'select' | 'hover';
|
|
9
|
+
|
|
10
|
+
/** A hit with its particular root-to-target path, ordered nearest to farthest by the caller. */
|
|
11
|
+
export type ScenegraphInteractionHit = {
|
|
12
|
+
/** Root-to-target path, including the hit node; distinguishes shared instances. */
|
|
13
|
+
path: readonly ScenegraphNode[];
|
|
14
|
+
/** Optional intersection point in world coordinates. */
|
|
15
|
+
point?: readonly [number, number, number];
|
|
16
|
+
/** Optional world-space ray origin. */
|
|
17
|
+
rayOrigin?: readonly [number, number, number];
|
|
18
|
+
/** Application-specific picking information. */
|
|
19
|
+
data?: unknown;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
/** Returns whether all nodes on an instance path permit the specified action. */
|
|
23
|
+
export function isScenegraphInteractionEnabled(
|
|
24
|
+
path: readonly ScenegraphNode[],
|
|
25
|
+
kind: ScenegraphInteractionKind
|
|
26
|
+
): boolean {
|
|
27
|
+
return (
|
|
28
|
+
path.length > 0 && path.every(node => (kind === 'select' ? node.selectable : node.hoverable))
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/** Finds the first eligible hit without letting an ineligible hit occlude later candidates. */
|
|
33
|
+
export function getFirstScenegraphInteractionHit<Hit extends ScenegraphInteractionHit>(
|
|
34
|
+
hits: readonly Hit[],
|
|
35
|
+
kind: ScenegraphInteractionKind
|
|
36
|
+
): Hit | undefined {
|
|
37
|
+
return hits.find(hit => isScenegraphInteractionEnabled(hit.path, kind));
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/** One bubbled host interaction event. */
|
|
41
|
+
export type ScenegraphInteractionEvent = {
|
|
42
|
+
type: 'select' | 'hover-in' | 'hover-out';
|
|
43
|
+
/** Target object where the interaction began or ended. */
|
|
44
|
+
target: ScenegraphNode;
|
|
45
|
+
/** Node receiving this step of the event's upward propagation. */
|
|
46
|
+
currentTarget: ScenegraphNode;
|
|
47
|
+
/** Identifies the pointer or controller. */
|
|
48
|
+
controllerIndex: number;
|
|
49
|
+
/** The original host hit associated with this event. */
|
|
50
|
+
hit: ScenegraphInteractionHit;
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
/** Caller-owned hit testing with per-controller hover tracking and subtree event propagation. */
|
|
54
|
+
export class ScenegraphInteractionManager {
|
|
55
|
+
private readonly hoveredHits = new Map<number, ScenegraphInteractionHit>();
|
|
56
|
+
private readonly pendingHover = new Map<number, (ScenegraphInteractionHit | undefined)[]>();
|
|
57
|
+
private readonly onEvent: (event: ScenegraphInteractionEvent) => void;
|
|
58
|
+
|
|
59
|
+
/** Creates a controller that reports bubbled selection and hover events. */
|
|
60
|
+
constructor(onEvent: (event: ScenegraphInteractionEvent) => void) {
|
|
61
|
+
this.onEvent = onEvent;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/** Selects the first eligible nearest-first hit and bubbles from target to root. */
|
|
65
|
+
select<Hit extends ScenegraphInteractionHit>(
|
|
66
|
+
hits: readonly Hit[],
|
|
67
|
+
controllerIndex = 0
|
|
68
|
+
): Hit | undefined {
|
|
69
|
+
const hit = getFirstScenegraphInteractionHit(hits, 'select');
|
|
70
|
+
if (!hit) return undefined;
|
|
71
|
+
this.emitPath('select', hit, 0, controllerIndex);
|
|
72
|
+
return hit;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/** Updates hover from current hits; call after pointer, camera, object, or flag changes. */
|
|
76
|
+
updateHover<Hit extends ScenegraphInteractionHit>(
|
|
77
|
+
hits: readonly Hit[],
|
|
78
|
+
controllerIndex = 0
|
|
79
|
+
): Hit | undefined {
|
|
80
|
+
const hit = getFirstScenegraphInteractionHit(hits, 'hover');
|
|
81
|
+
const queuedHit = hit ? {...hit, path: [...hit.path]} : undefined;
|
|
82
|
+
const activeQueue = this.pendingHover.get(controllerIndex);
|
|
83
|
+
if (activeQueue) {
|
|
84
|
+
activeQueue.push(queuedHit);
|
|
85
|
+
return hit;
|
|
86
|
+
}
|
|
87
|
+
const queue = [queuedHit];
|
|
88
|
+
this.pendingHover.set(controllerIndex, queue);
|
|
89
|
+
try {
|
|
90
|
+
while (queue.length) {
|
|
91
|
+
const next = queue.shift();
|
|
92
|
+
const previous = this.hoveredHits.get(controllerIndex);
|
|
93
|
+
const previousPath = previous?.path || [];
|
|
94
|
+
const nextPath = next?.path || [];
|
|
95
|
+
let shared = 0;
|
|
96
|
+
while (
|
|
97
|
+
shared < previousPath.length &&
|
|
98
|
+
shared < nextPath.length &&
|
|
99
|
+
previousPath[shared] === nextPath[shared]
|
|
100
|
+
)
|
|
101
|
+
shared++;
|
|
102
|
+
if (next) this.hoveredHits.set(controllerIndex, next);
|
|
103
|
+
else this.hoveredHits.delete(controllerIndex);
|
|
104
|
+
if (previous) this.emitPath('hover-out', previous, shared, controllerIndex);
|
|
105
|
+
if (next) this.emitPath('hover-in', next, shared, controllerIndex);
|
|
106
|
+
}
|
|
107
|
+
} finally {
|
|
108
|
+
this.pendingHover.delete(controllerIndex);
|
|
109
|
+
}
|
|
110
|
+
return hit;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/** Emits exits for one controller and drops its tracked hover path. */
|
|
114
|
+
clearHover(controllerIndex = 0): void {
|
|
115
|
+
this.updateHover([], controllerIndex);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/** Emits events from the target towards the first ancestor outside the shared subtree. */
|
|
119
|
+
private emitPath(
|
|
120
|
+
type: ScenegraphInteractionEvent['type'],
|
|
121
|
+
hit: ScenegraphInteractionHit,
|
|
122
|
+
first: number,
|
|
123
|
+
controllerIndex: number
|
|
124
|
+
): void {
|
|
125
|
+
const {path} = hit;
|
|
126
|
+
const target = path[path.length - 1];
|
|
127
|
+
for (let index = path.length - 1; index >= first; index--) {
|
|
128
|
+
this.onEvent({type, target, currentTarget: path[index], controllerIndex, hit});
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
@@ -14,6 +14,10 @@ function assert(condition: boolean, message?: string): asserts condition {
|
|
|
14
14
|
/** Properties for creating a new Scenegraph */
|
|
15
15
|
export type ScenegraphNodeProps = {
|
|
16
16
|
id?: string;
|
|
17
|
+
/** Local selection eligibility; ancestors can disable their entire subtree. */
|
|
18
|
+
selectable?: boolean;
|
|
19
|
+
/** Local hover eligibility; ancestors can disable their entire subtree. */
|
|
20
|
+
hoverable?: boolean;
|
|
17
21
|
/** whether to display the object at all */
|
|
18
22
|
display?: boolean;
|
|
19
23
|
matrix?: NumericArray;
|
|
@@ -28,9 +32,15 @@ export class ScenegraphNode {
|
|
|
28
32
|
matrix: Matrix4 = new Matrix4();
|
|
29
33
|
|
|
30
34
|
display = true;
|
|
35
|
+
/** Local selection eligibility, independent of visibility. */
|
|
36
|
+
selectable = true;
|
|
37
|
+
/** Local hover eligibility, independent of visibility. */
|
|
38
|
+
hoverable = true;
|
|
31
39
|
position = new Vector3();
|
|
32
40
|
rotation = new Vector3();
|
|
33
41
|
scale = new Vector3(1, 1, 1);
|
|
42
|
+
/** Structured metadata associated with this scene node. */
|
|
43
|
+
metadata: Record<string, unknown> = {};
|
|
34
44
|
userData: Record<string, unknown> = {};
|
|
35
45
|
|
|
36
46
|
props: ScenegraphNodeProps = {};
|
|
@@ -193,6 +203,8 @@ export class ScenegraphNode {
|
|
|
193
203
|
*/
|
|
194
204
|
|
|
195
205
|
_setScenegraphNodeProps(props: ScenegraphNodeProps): void {
|
|
206
|
+
if (props.selectable !== undefined) this.selectable = props.selectable;
|
|
207
|
+
if (props.hoverable !== undefined) this.hoverable = props.hoverable;
|
|
196
208
|
if (props.display !== undefined) {
|
|
197
209
|
this.display = props.display;
|
|
198
210
|
}
|
package/src/splats/README.md
CHANGED
|
@@ -41,3 +41,49 @@ Renderers borrow source batches, preserve HDR colors, and must be destroyed befo
|
|
|
41
41
|
This package is public with experimental APIs. Install it with `yarn add @luma.gl/engine`.
|
|
42
42
|
|
|
43
43
|
See [luma.gl](https://luma.gl/docs/api-reference/splats) for documentation.
|
|
44
|
+
|
|
45
|
+
## Preparing glTF Gaussian primitives
|
|
46
|
+
|
|
47
|
+
When using loaders.gl, provide `SPZLoader` alongside `GLTFLoader` and request Arrow output. Pass
|
|
48
|
+
its result through `postProcessGLTF`, then use the optional Arrow entry to prepare both decoded SPZ
|
|
49
|
+
and uncompressed Gaussian primitives:
|
|
50
|
+
|
|
51
|
+
```typescript
|
|
52
|
+
import {load} from '@loaders.gl/core';
|
|
53
|
+
import {GLTFLoader} from '@loaders.gl/scene/gltf';
|
|
54
|
+
import {SPZLoader} from '@loaders.gl/splats';
|
|
55
|
+
import {createScenegraphsFromGLTF, postProcessGLTF} from '@luma.gl/engine/gltf';
|
|
56
|
+
import type {GLTFWithBuffers} from '@luma.gl/engine/gltf';
|
|
57
|
+
import {getGLTFSplatSceneInstances, makeGPUSplatDataFromGLTFScene} from '@luma.gl/engine/arrow';
|
|
58
|
+
|
|
59
|
+
const loaded = await load('scene.glb', [GLTFLoader, SPZLoader], {
|
|
60
|
+
splats: {shape: 'arrow', targetCoordinateSystem: 'LUF'}
|
|
61
|
+
});
|
|
62
|
+
const gltf = postProcessGLTF(loaded as GLTFWithBuffers);
|
|
63
|
+
const scenegraphs = createScenegraphsFromGLTF(device, gltf, {
|
|
64
|
+
excludeGaussianSplatPrimitives: true
|
|
65
|
+
});
|
|
66
|
+
const splatGroups = await makeGPUSplatDataFromGLTFScene(device, gltf);
|
|
67
|
+
const instances = getGLTFSplatSceneInstances(scenegraphs, splatGroups);
|
|
68
|
+
// Apply each instance's worldMatrix when drawing its batches in the host render pass.
|
|
69
|
+
// Recalculate instances after animation or visibility changes.
|
|
70
|
+
// Destroy the borrowing renderer first, then each batch and scenegraphs.destroy().
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
The bridge preserves the Arrow record-batch boundaries and source mesh/primitive indices.
|
|
74
|
+
Instance discovery expands `EXT_mesh_gpu_instancing` matrices and reports each source instance index. The
|
|
75
|
+
splat upload is caller-owned, and decoded loader data remains borrowed. Quaternion conversion and
|
|
76
|
+
SH layout adaptation occur in the existing upload adapters; no coordinate-system conversion is
|
|
77
|
+
performed by the bridge. If decoding or preparation fails, previously prepared batches are
|
|
78
|
+
released. Cancellation is checked before each primitive and after preparation.
|
|
79
|
+
|
|
80
|
+
`excludeGaussianSplatPrimitives` leaves those primitives out of the mesh scenegraph; it does not
|
|
81
|
+
create or draw splat renderers. Applications must resolve scene-node instances, transforms,
|
|
82
|
+
visibility, and mixed-scene draw ordering. Decoded splats retain glTF feature-ID attributes when their row counts match the decoded table.
|
|
83
|
+
The decoded Arrow path currently accepts linear Rec. 709 display colors; sRGB display colors require
|
|
84
|
+
a separate conversion and are rejected. Strict required-extension
|
|
85
|
+
support remains unchanged until ordinary scene creation can render the extension end to end.
|
|
86
|
+
|
|
87
|
+
The Gaussian splat showcase includes a synthetic embedded-GLB scene. Select **Embedded glTF
|
|
88
|
+
Gaussian splats** in the scene control. The showcase currently accepts one visible Gaussian instance with an invertible node transform;
|
|
89
|
+
applications needing mixed meshes or multiple instances must compose their own render passes.
|
package/src/splats/splat-data.ts
CHANGED
|
@@ -143,54 +143,62 @@ export class GPUSplatData {
|
|
|
143
143
|
rowIndices[rowIndex] = this.sourceInfo.sourceRowIndexOffset + rowIndex;
|
|
144
144
|
}
|
|
145
145
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
this.rotations = createSplatGPUVector(
|
|
155
|
-
device,
|
|
156
|
-
'rotations',
|
|
157
|
-
source.rotations,
|
|
158
|
-
'float32x4',
|
|
159
|
-
length
|
|
160
|
-
);
|
|
161
|
-
const colorFormat = source.colors instanceof Float32Array ? 'float32x4' : 'unorm8x4';
|
|
162
|
-
this.colors = createSplatGPUVector(device, 'colors', source.colors, colorFormat, length);
|
|
163
|
-
this.opacities = createSplatGPUVector(device, 'opacities', source.opacities, 'float32', length);
|
|
164
|
-
this.rowIndices = createSplatGPUVector(device, 'rowIndices', rowIndices, 'uint32', length);
|
|
165
|
-
if (source.semanticIds) {
|
|
166
|
-
this.semanticIds = createSplatGPUVector(
|
|
167
|
-
device,
|
|
168
|
-
'semanticIds',
|
|
169
|
-
source.semanticIds,
|
|
170
|
-
'uint32',
|
|
171
|
-
length
|
|
146
|
+
const allocatedVectors: GPUVector[] = [];
|
|
147
|
+
const track = <VectorT extends GPUVector>(vector: VectorT): VectorT => {
|
|
148
|
+
allocatedVectors.push(vector);
|
|
149
|
+
return vector;
|
|
150
|
+
};
|
|
151
|
+
try {
|
|
152
|
+
this.positions = track(
|
|
153
|
+
createSplatGPUVector(device, 'positions', source.positions, 'float32x3', length)
|
|
172
154
|
);
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
'
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
155
|
+
this.scales = track(
|
|
156
|
+
createSplatGPUVector(device, 'scales', source.scales, 'float32x3', length)
|
|
157
|
+
);
|
|
158
|
+
this.rotations = track(
|
|
159
|
+
createSplatGPUVector(device, 'rotations', source.rotations, 'float32x4', length)
|
|
160
|
+
);
|
|
161
|
+
const colorFormat = source.colors instanceof Float32Array ? 'float32x4' : 'unorm8x4';
|
|
162
|
+
this.colors = track(
|
|
163
|
+
createSplatGPUVector(device, 'colors', source.colors, colorFormat, length)
|
|
181
164
|
);
|
|
165
|
+
this.opacities = track(
|
|
166
|
+
createSplatGPUVector(device, 'opacities', source.opacities, 'float32', length)
|
|
167
|
+
);
|
|
168
|
+
this.rowIndices = track(
|
|
169
|
+
createSplatGPUVector(device, 'rowIndices', rowIndices, 'uint32', length)
|
|
170
|
+
);
|
|
171
|
+
if (source.semanticIds) {
|
|
172
|
+
this.semanticIds = track(
|
|
173
|
+
createSplatGPUVector(device, 'semanticIds', source.semanticIds, 'uint32', length)
|
|
174
|
+
);
|
|
175
|
+
}
|
|
176
|
+
if (source.sphericalHarmonics) {
|
|
177
|
+
this.sphericalHarmonics = track(
|
|
178
|
+
createSplatGPUVector(
|
|
179
|
+
device,
|
|
180
|
+
'sphericalHarmonics',
|
|
181
|
+
source.sphericalHarmonics,
|
|
182
|
+
'float32',
|
|
183
|
+
source.sphericalHarmonics.length
|
|
184
|
+
)
|
|
185
|
+
);
|
|
186
|
+
}
|
|
187
|
+
this.table = new GPUTable({
|
|
188
|
+
vectors: {
|
|
189
|
+
positions: this.positions,
|
|
190
|
+
scales: this.scales,
|
|
191
|
+
rotations: this.rotations,
|
|
192
|
+
colors: this.colors,
|
|
193
|
+
opacities: this.opacities,
|
|
194
|
+
rowIndices: this.rowIndices
|
|
195
|
+
},
|
|
196
|
+
sourceInfo: this.sourceInfo
|
|
197
|
+
});
|
|
198
|
+
} catch (error) {
|
|
199
|
+
for (const vector of allocatedVectors) vector.destroy();
|
|
200
|
+
throw error;
|
|
182
201
|
}
|
|
183
|
-
this.table = new GPUTable({
|
|
184
|
-
vectors: {
|
|
185
|
-
positions: this.positions,
|
|
186
|
-
scales: this.scales,
|
|
187
|
-
rotations: this.rotations,
|
|
188
|
-
colors: this.colors,
|
|
189
|
-
opacities: this.opacities,
|
|
190
|
-
rowIndices: this.rowIndices
|
|
191
|
-
},
|
|
192
|
-
sourceInfo: this.sourceInfo
|
|
193
|
-
});
|
|
194
202
|
}
|
|
195
203
|
|
|
196
204
|
/** Number of logical source rows, matching {@link length}. */
|
package/src/text/index.ts
CHANGED
|
@@ -38,6 +38,7 @@ export {
|
|
|
38
38
|
type TextKerning
|
|
39
39
|
} from '../fonts/atlas/text-utils';
|
|
40
40
|
export {type TextGlyphLayout} from './model-utils/gpu-text-types';
|
|
41
|
+
export {createTextCodePointSource} from './model-utils/text-code-point-source';
|
|
41
42
|
export {
|
|
42
43
|
buildTextGlyphLayout,
|
|
43
44
|
type TextCodePointSource,
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
// luma.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
|
+
|
|
5
|
+
import type {TextCodePointSource} from './text-layout';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Creates a code-point source from one-line text rows. An optional caller-supplied
|
|
9
|
+
* processor converts each row to display order once, before glyph layout.
|
|
10
|
+
* Without it, the input rows must already be in display order.
|
|
11
|
+
*/
|
|
12
|
+
export function createTextCodePointSource(
|
|
13
|
+
rows: readonly string[],
|
|
14
|
+
toDisplayOrder?: (text: string, rowIndex: number) => string
|
|
15
|
+
): TextCodePointSource {
|
|
16
|
+
const codePointRows = rows.map((row, rowIndex) =>
|
|
17
|
+
Uint32Array.from(
|
|
18
|
+
toDisplayOrder ? toDisplayOrder(row, rowIndex) : row,
|
|
19
|
+
character =>
|
|
20
|
+
// String iteration yields a nonempty string for each code point.
|
|
21
|
+
character.codePointAt(0)!
|
|
22
|
+
)
|
|
23
|
+
);
|
|
24
|
+
|
|
25
|
+
return {
|
|
26
|
+
rowCount: codePointRows.length,
|
|
27
|
+
countCodePoints: rowIndex => codePointRows[rowIndex].length,
|
|
28
|
+
visitCodePoints: (rowIndex, visitCodePoint) => {
|
|
29
|
+
for (const codePoint of codePointRows[rowIndex]) {
|
|
30
|
+
visitCodePoint(codePoint);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
}
|
|
@@ -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 Buffer, type Device, type RenderPass} from '@luma.gl/core';
|
|
6
7
|
import type {ModelProps} from '@luma.gl/engine';
|
|
7
8
|
import type {DynamicTexture} from '@luma.gl/core/dynamic';
|
|
@@ -100,7 +101,15 @@ export class TextAttributeModel extends GPUTableModel {
|
|
|
100
101
|
}
|
|
101
102
|
|
|
102
103
|
/** Draws each generated glyph render batch against the supplied render pass. */
|
|
103
|
-
override draw(renderPass: RenderPass): boolean {
|
|
104
|
+
override draw(renderPass: RenderPass, options?: ModelDrawOptions): boolean {
|
|
105
|
+
return options?.parameters
|
|
106
|
+
? this._withDrawParameters(renderPass, options.parameters, () =>
|
|
107
|
+
this.drawTextAttributeModelBatches(renderPass)
|
|
108
|
+
)
|
|
109
|
+
: this.drawTextAttributeModelBatches(renderPass);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
private drawTextAttributeModelBatches(renderPass: RenderPass): boolean {
|
|
104
113
|
let drawSuccess = true;
|
|
105
114
|
try {
|
|
106
115
|
for (const attributeState of this.attributeStates) {
|
|
@@ -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 Device, type RenderPass} from '@luma.gl/core';
|
|
6
7
|
import {Model, type ModelProps} from '@luma.gl/engine';
|
|
7
8
|
import {
|
|
@@ -76,7 +77,15 @@ export class TextDictionaryModel extends Model {
|
|
|
76
77
|
}
|
|
77
78
|
|
|
78
79
|
/** Draws each compressed dictionary text render batch against the supplied render pass. */
|
|
79
|
-
override draw(renderPass: RenderPass): boolean {
|
|
80
|
+
override draw(renderPass: RenderPass, options?: ModelDrawOptions): boolean {
|
|
81
|
+
return options?.parameters
|
|
82
|
+
? this._withDrawParameters(renderPass, options.parameters, () =>
|
|
83
|
+
this.drawTextDictionaryModelBatches(renderPass)
|
|
84
|
+
)
|
|
85
|
+
: this.drawTextDictionaryModelBatches(renderPass);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
private drawTextDictionaryModelBatches(renderPass: RenderPass): boolean {
|
|
80
89
|
let drawSuccess = true;
|
|
81
90
|
for (const storageState of this.storageStates) {
|
|
82
91
|
const stateFirstBatch = getFirstTextDictionaryBatch(storageState);
|
|
@@ -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 Device, type RenderPass} from '@luma.gl/core';
|
|
6
7
|
import {Model, type ModelProps} from '@luma.gl/engine';
|
|
7
8
|
import {
|
|
@@ -83,7 +84,15 @@ export class TextStorageModel extends Model {
|
|
|
83
84
|
}
|
|
84
85
|
|
|
85
86
|
/** Draws each generated storage text render batch against the supplied render pass. */
|
|
86
|
-
override draw(renderPass: RenderPass): boolean {
|
|
87
|
+
override draw(renderPass: RenderPass, options?: ModelDrawOptions): boolean {
|
|
88
|
+
return options?.parameters
|
|
89
|
+
? this._withDrawParameters(renderPass, options.parameters, () =>
|
|
90
|
+
this.drawTextStorageModelBatches(renderPass)
|
|
91
|
+
)
|
|
92
|
+
: this.drawTextStorageModelBatches(renderPass);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
private drawTextStorageModelBatches(renderPass: RenderPass): boolean {
|
|
87
96
|
let drawSuccess = true;
|
|
88
97
|
for (const storageState of this.storageStates) {
|
|
89
98
|
const stateFirstBatch = getFirstTextStorageBatch(storageState);
|