@luma.gl/engine 10.0.0-alpha.6 → 10.0.0-alpha.8
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/README.md +2 -2
- package/dist/arrow/arrow-geometry.cjs +1 -1
- package/dist/arrow/arrow-geometry.js +1 -1
- package/dist/arrow/arrow-picking.cjs +1 -1
- package/dist/arrow/arrow-picking.d.ts +1 -1
- package/dist/arrow/arrow-picking.js +1 -1
- package/dist/arrow/renderers/path/conversion/arrow-path-gpu-vectors.cjs +5 -5
- package/dist/arrow/renderers/path/conversion/arrow-path-gpu-vectors.d.ts +2 -2
- package/dist/arrow/renderers/path/conversion/arrow-path-gpu-vectors.js +5 -5
- package/dist/arrow/renderers/path/conversion/arrow-path-storage-gpu-vectors.cjs +3 -3
- package/dist/arrow/renderers/path/conversion/arrow-path-storage-gpu-vectors.js +3 -3
- package/dist/arrow/renderers/path/source/arrow-path-source-mapping.cjs +1 -1
- package/dist/arrow/renderers/path/source/arrow-path-source-mapping.js +1 -1
- package/dist/arrow/renderers/path/transforms/close-arrow-paths.cjs +5 -5
- package/dist/arrow/renderers/path/transforms/close-arrow-paths.d.ts +1 -1
- package/dist/arrow/renderers/path/transforms/close-arrow-paths.js +5 -5
- package/dist/arrow/renderers/path/transforms/gpu-path-float64-deltas.cjs +3 -3
- package/dist/arrow/renderers/path/transforms/gpu-path-float64-deltas.d.ts +1 -1
- package/dist/arrow/renderers/path/transforms/gpu-path-float64-deltas.js +3 -3
- package/dist/arrow/renderers/path/transforms/path-view-origins.cjs +1 -1
- package/dist/arrow/renderers/path/transforms/path-view-origins.d.ts +1 -1
- package/dist/arrow/renderers/path/transforms/path-view-origins.js +1 -1
- package/dist/arrow/renderers/polygon/conversion/arrow-polygon-gpu-vectors.cjs +1 -1
- package/dist/arrow/renderers/polygon/conversion/arrow-polygon-gpu-vectors.d.ts +1 -1
- package/dist/arrow/renderers/polygon/conversion/arrow-polygon-gpu-vectors.js +1 -1
- package/dist/arrow/renderers/polygon/renderers/arrow-polygon-renderer.cjs +4 -4
- package/dist/arrow/renderers/polygon/renderers/arrow-polygon-renderer.js +4 -4
- package/dist/arrow/renderers/polygon/source/arrow-polygon-source-mapping.cjs +1 -1
- package/dist/arrow/renderers/polygon/source/arrow-polygon-source-mapping.js +1 -1
- package/dist/arrow/renderers/splats/conversion/make-gpu-splat-data-from-arrow.cjs +1 -1
- package/dist/arrow/renderers/splats/conversion/make-gpu-splat-data-from-arrow.js +1 -1
- package/dist/arrow/renderers/text/conversion/convert-arrow-text-to-attribute.cjs +1 -1
- package/dist/arrow/renderers/text/conversion/convert-arrow-text-to-attribute.d.ts +1 -1
- package/dist/arrow/renderers/text/conversion/convert-arrow-text-to-attribute.js +1 -1
- package/dist/arrow/renderers/text/conversion/convert-arrow-text-vectors.cjs +5 -5
- package/dist/arrow/renderers/text/conversion/convert-arrow-text-vectors.d.ts +1 -1
- package/dist/arrow/renderers/text/conversion/convert-arrow-text-vectors.js +5 -5
- package/dist/arrow/renderers/text/conversion/make-gpu-text-data-from-arrow.cjs +1 -1
- package/dist/arrow/renderers/text/conversion/make-gpu-text-data-from-arrow.js +1 -1
- package/dist/arrow/renderers/text/renderers/arrow-text-picking.cjs +1 -1
- package/dist/arrow/renderers/text/renderers/arrow-text-picking.js +1 -1
- package/dist/arrow/renderers/text/renderers/arrow-text-renderer.cjs +5 -5
- package/dist/arrow/renderers/text/renderers/arrow-text-renderer.js +5 -5
- package/dist/arrow/renderers/text/source/arrow-text-source-mapping.cjs +1 -1
- package/dist/arrow/renderers/text/source/arrow-text-source-mapping.js +1 -1
- package/dist/compute/computation.cjs +5 -2
- package/dist/compute/computation.d.ts +1 -1
- package/dist/compute/computation.d.ts.map +1 -1
- package/dist/compute/computation.js +5 -2
- package/dist/compute/computation.js.map +1 -1
- package/dist/compute/texture-transform.d.ts +2 -2
- package/dist/compute/texture-transform.d.ts.map +1 -1
- package/dist/compute/texture-transform.js.map +1 -1
- package/dist/dist.dev.js +889 -597
- package/dist/dist.min.js +64 -59
- package/dist/experimental/materials/emissive-material.cjs +1 -1
- package/dist/experimental/materials/emissive-material.d.ts +1 -1
- package/dist/experimental/materials/emissive-material.d.ts.map +1 -1
- package/dist/experimental/materials/emissive-material.js +1 -1
- package/dist/experimental/materials/emissive-material.js.map +1 -1
- package/dist/experimental/materials/glass-material.cjs +1 -1
- package/dist/experimental/materials/glass-material.d.ts +1 -1
- package/dist/experimental/materials/glass-material.d.ts.map +1 -1
- package/dist/experimental/materials/glass-material.js +1 -1
- package/dist/experimental/materials/glass-material.js.map +1 -1
- package/dist/experimental/materials/glass-transmission.cjs +1 -1
- package/dist/experimental/materials/glass-transmission.d.ts +1 -1
- package/dist/experimental/materials/glass-transmission.d.ts.map +1 -1
- package/dist/experimental/materials/glass-transmission.js +1 -1
- package/dist/experimental/materials/glass-transmission.js.map +1 -1
- package/dist/experimental/materials/index.cjs.map +1 -1
- package/dist/experimental/materials/optical-caustics.cjs +1 -1
- package/dist/experimental/materials/optical-caustics.d.ts +1 -1
- package/dist/experimental/materials/optical-caustics.d.ts.map +1 -1
- package/dist/experimental/materials/optical-caustics.js +1 -1
- package/dist/experimental/materials/optical-caustics.js.map +1 -1
- package/dist/experimental/materials/optical-point-lights.cjs +1 -1
- package/dist/experimental/materials/optical-point-lights.d.ts +1 -1
- package/dist/experimental/materials/optical-point-lights.d.ts.map +1 -1
- package/dist/experimental/materials/optical-point-lights.js +1 -1
- package/dist/experimental/materials/optical-point-lights.js.map +1 -1
- package/dist/experimental/materials/reflective-material.cjs +1 -1
- package/dist/experimental/materials/reflective-material.d.ts +1 -1
- package/dist/experimental/materials/reflective-material.d.ts.map +1 -1
- package/dist/experimental/materials/reflective-material.js +1 -1
- package/dist/experimental/materials/reflective-material.js.map +1 -1
- package/dist/geometry/gpu-geometry.cjs +1 -1
- package/dist/geometry/gpu-geometry.d.ts.map +1 -1
- package/dist/geometry/gpu-geometry.js +1 -1
- package/dist/geometry/gpu-geometry.js.map +1 -1
- package/dist/gltf/gltf/gltf-extension-support.cjs +25 -5
- package/dist/gltf/gltf/gltf-extension-support.d.ts.map +1 -1
- package/dist/gltf/gltf/gltf-extension-support.js +27 -5
- package/dist/gltf/gltf/gltf-extension-support.js.map +1 -1
- package/dist/gltf/gltf/gltf-lod.cjs +21 -6
- package/dist/gltf/gltf/gltf-lod.d.ts.map +1 -1
- package/dist/gltf/gltf/gltf-lod.js +20 -4
- package/dist/gltf/gltf/gltf-lod.js.map +1 -1
- package/dist/gltf/index.cjs.map +1 -1
- package/dist/gltf/types/gltf-json-schema.d.ts +37 -37
- package/dist/gltf/types/gltf-json-schema.d.ts.map +1 -1
- package/dist/gltf/types/gltf-postprocessed-schema.d.ts +28 -28
- package/dist/gltf/types/gltf-postprocessed-schema.d.ts.map +1 -1
- package/dist/graph/models/index.cjs.map +3 -3
- package/dist/graph/models/path/path-attribute-model.cjs +2 -2
- package/dist/graph/models/path/path-attribute-model.d.ts +2 -2
- package/dist/graph/models/path/path-attribute-model.js +2 -2
- package/dist/graph/models/path/path-storage-model.cjs +1 -1
- package/dist/graph/models/path/path-storage-model.d.ts +1 -1
- package/dist/graph/models/path/path-storage-model.js +1 -1
- package/dist/graph/models/path/path-trips-storage-model.d.ts +2 -2
- package/dist/graph/models/polygon/polygon-attribute-model.cjs +2 -2
- package/dist/graph/models/polygon/polygon-attribute-model.js +2 -2
- package/dist/graph/models/polygon/polygon-storage-model.cjs +2 -2
- package/dist/graph/models/polygon/polygon-storage-model.js +2 -2
- package/dist/graph/physics/index.cjs +3 -0
- package/dist/graph/physics/index.cjs.map +3 -3
- package/dist/graph/physics/index.d.ts +2 -0
- package/dist/graph/physics/index.d.ts.map +1 -1
- package/dist/graph/physics/index.js +1 -0
- package/dist/graph/physics/index.js.map +1 -1
- package/dist/graph/physics/physics-controller-geometry.cjs +203 -0
- package/dist/graph/physics/physics-controller-geometry.d.ts +6 -0
- package/dist/graph/physics/physics-controller-geometry.d.ts.map +1 -0
- package/dist/graph/physics/physics-controller-geometry.js +205 -0
- package/dist/graph/physics/physics-controller-geometry.js.map +1 -0
- package/dist/graph/physics/physics-controller.cjs +277 -0
- package/dist/graph/physics/physics-controller.d.ts +90 -0
- package/dist/graph/physics/physics-controller.d.ts.map +1 -0
- package/dist/graph/physics/physics-controller.js +266 -0
- package/dist/graph/physics/physics-controller.js.map +1 -0
- package/dist/graph/physics/scenegraph-instance.cjs +11 -2
- package/dist/graph/physics/scenegraph-instance.d.ts +3 -1
- package/dist/graph/physics/scenegraph-instance.d.ts.map +1 -1
- package/dist/graph/physics/scenegraph-instance.js +11 -0
- package/dist/graph/physics/scenegraph-instance.js.map +1 -1
- package/dist/graph/physics/scenegraph-motion.cjs +3 -3
- package/dist/graph/physics/scenegraph-motion.d.ts +5 -1
- package/dist/graph/physics/scenegraph-motion.d.ts.map +1 -1
- package/dist/graph/physics/scenegraph-motion.js +3 -3
- package/dist/graph/physics/scenegraph-motion.js.map +1 -1
- package/dist/graph/physics/scenegraph-publication.cjs +13 -3
- package/dist/graph/physics/scenegraph-publication.d.ts +4 -2
- package/dist/graph/physics/scenegraph-publication.d.ts.map +1 -1
- package/dist/graph/physics/scenegraph-publication.js +14 -3
- package/dist/graph/physics/scenegraph-publication.js.map +1 -1
- package/dist/graph/physics/scenegraph-session.cjs +11 -1
- package/dist/graph/physics/scenegraph-session.d.ts +11 -2
- package/dist/graph/physics/scenegraph-session.d.ts.map +1 -1
- package/dist/graph/physics/scenegraph-session.js +13 -1
- package/dist/graph/physics/scenegraph-session.js.map +1 -1
- package/dist/graph/tables/gpu-table-model.cjs +1 -1
- package/dist/graph/tables/gpu-table-model.js +1 -1
- package/dist/graph/tables/gpu-table-transform.cjs +2 -2
- package/dist/graph/tables/gpu-table-transform.d.ts +1 -1
- package/dist/graph/tables/gpu-table-transform.js +2 -2
- package/dist/graph/tables/index.cjs.map +3 -3
- package/dist/index.cjs +3 -0
- package/dist/index.cjs.map +3 -3
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/model/batch-uniform-buffer.cjs +70 -0
- package/dist/model/batch-uniform-buffer.d.ts +21 -0
- package/dist/model/batch-uniform-buffer.d.ts.map +1 -0
- package/dist/model/batch-uniform-buffer.js +48 -0
- package/dist/model/batch-uniform-buffer.js.map +1 -0
- package/dist/model/gpu-vector-bindings.cjs +57 -16
- package/dist/model/gpu-vector-bindings.d.ts.map +1 -1
- package/dist/model/gpu-vector-bindings.js +65 -15
- package/dist/model/gpu-vector-bindings.js.map +1 -1
- package/dist/model/gpu-vector-draw-batches.cjs +4 -2
- package/dist/model/gpu-vector-draw-batches.d.ts.map +1 -1
- package/dist/model/gpu-vector-draw-batches.js +5 -2
- package/dist/model/gpu-vector-draw-batches.js.map +1 -1
- package/dist/model/gpu-vector-model-batches.d.ts +5 -0
- package/dist/model/gpu-vector-model-batches.d.ts.map +1 -1
- package/dist/model/gpu-vector-model-batches.js.map +1 -1
- package/dist/model/gpu-vector-model.cjs +144 -81
- package/dist/model/gpu-vector-model.d.ts +9 -2
- package/dist/model/gpu-vector-model.d.ts.map +1 -1
- package/dist/model/gpu-vector-model.js +173 -100
- package/dist/model/gpu-vector-model.js.map +1 -1
- package/dist/model/model.cjs +8 -0
- package/dist/model/model.d.ts +3 -0
- package/dist/model/model.d.ts.map +1 -1
- package/dist/model/model.js +8 -0
- package/dist/model/model.js.map +1 -1
- package/dist/scenegraph/geometry-node.cjs +47 -0
- package/dist/scenegraph/geometry-node.d.ts +13 -0
- package/dist/scenegraph/geometry-node.d.ts.map +1 -0
- package/dist/scenegraph/geometry-node.js +26 -0
- package/dist/scenegraph/geometry-node.js.map +1 -0
- package/dist/scenegraph/group-node.cjs +42 -0
- package/dist/scenegraph/group-node.d.ts +8 -0
- package/dist/scenegraph/group-node.d.ts.map +1 -1
- package/dist/scenegraph/group-node.js +47 -1
- package/dist/scenegraph/group-node.js.map +1 -1
- package/dist/scenegraph/transform-source.cjs +15 -0
- package/dist/scenegraph/transform-source.d.ts +24 -0
- package/dist/scenegraph/transform-source.d.ts.map +1 -0
- package/dist/scenegraph/transform-source.js +5 -0
- package/dist/scenegraph/transform-source.js.map +1 -0
- package/dist/splats/gpu-splat-graph-renderer.d.ts +1 -1
- package/dist/splats/gpu-splat-graph-renderer.d.ts.map +1 -1
- package/dist/splats/index.cjs.map +1 -1
- package/dist/splats/splat-data.cjs +1 -1
- package/dist/splats/splat-data.d.ts +1 -1
- package/dist/splats/splat-data.js +1 -1
- package/dist/splats/splat-renderer.cjs +7 -2
- package/dist/splats/splat-renderer.d.ts +3 -0
- package/dist/splats/splat-renderer.d.ts.map +1 -1
- package/dist/splats/splat-renderer.js +7 -2
- package/dist/splats/splat-renderer.js.map +1 -1
- package/dist/splats/splat-sort.d.ts +1 -1
- package/dist/splats/splat-sort.d.ts.map +1 -1
- package/dist/text/experimental.cjs +151 -3
- package/dist/text/experimental.d.ts +1 -1
- package/dist/text/experimental.d.ts.map +1 -1
- package/dist/text/experimental.js +1 -1
- package/dist/text/experimental.js.map +1 -1
- package/dist/text/index.cjs +41 -3
- 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/experimental.cjs +128 -18
- package/dist/text/text-2d/experimental.d.ts +8 -8
- package/dist/text/text-2d/experimental.d.ts.map +1 -1
- package/dist/text/text-2d/experimental.js +7 -8
- package/dist/text/text-2d/experimental.js.map +1 -1
- package/dist/text/text-2d/model-utils/text-model-props.d.ts +1 -1
- package/dist/text/text-2d/models/text-attribute-model.cjs +1 -1
- package/dist/text/text-2d/models/text-attribute-model.js +1 -1
- package/dist/utils/deep-equal.cjs +3 -1
- package/dist/utils/deep-equal.d.ts +1 -1
- package/dist/utils/deep-equal.d.ts.map +1 -1
- package/dist/utils/deep-equal.js +3 -1
- package/dist/utils/deep-equal.js.map +1 -1
- package/dist/utils/get-platform-info.cjs +9 -3
- package/dist/utils/get-platform-info.d.ts +1 -1
- package/dist/utils/get-platform-info.d.ts.map +1 -1
- package/dist/utils/get-platform-info.js +1 -1
- package/dist/utils/get-platform-info.js.map +1 -1
- package/package.json +8 -9
- package/src/arrow/arrow-geometry.ts +1 -1
- package/src/arrow/arrow-picking.ts +2 -2
- package/src/arrow/renderers/path/conversion/arrow-path-gpu-vectors.ts +9 -9
- package/src/arrow/renderers/path/conversion/arrow-path-storage-gpu-vectors.ts +4 -4
- package/src/arrow/renderers/path/source/arrow-path-source-mapping.ts +1 -1
- package/src/arrow/renderers/path/transforms/close-arrow-paths.ts +5 -5
- package/src/arrow/renderers/path/transforms/gpu-path-float64-deltas.ts +3 -3
- package/src/arrow/renderers/path/transforms/path-view-origins.ts +2 -2
- package/src/arrow/renderers/polygon/conversion/arrow-polygon-gpu-vectors.ts +1 -1
- package/src/arrow/renderers/polygon/renderers/arrow-polygon-renderer.ts +4 -4
- package/src/arrow/renderers/polygon/source/arrow-polygon-source-mapping.ts +1 -1
- package/src/arrow/renderers/splats/conversion/make-gpu-splat-data-from-arrow.ts +1 -1
- package/src/arrow/renderers/text/conversion/convert-arrow-text-to-attribute.ts +2 -2
- package/src/arrow/renderers/text/conversion/convert-arrow-text-to-storage.ts +1 -1
- package/src/arrow/renderers/text/conversion/convert-arrow-text-vectors.ts +6 -6
- package/src/arrow/renderers/text/conversion/make-gpu-text-data-from-arrow.ts +1 -1
- package/src/arrow/renderers/text/renderers/arrow-text-picking.ts +1 -1
- package/src/arrow/renderers/text/renderers/arrow-text-renderer.ts +5 -5
- package/src/arrow/renderers/text/source/arrow-text-source-mapping.ts +1 -1
- package/src/compute/computation.ts +8 -3
- package/src/compute/texture-transform.ts +2 -2
- package/src/experimental/materials/emissive-material.ts +1 -1
- package/src/experimental/materials/glass-material.ts +1 -1
- package/src/experimental/materials/glass-transmission.ts +1 -1
- package/src/experimental/materials/optical-caustics.ts +1 -1
- package/src/experimental/materials/optical-point-lights.ts +1 -1
- package/src/experimental/materials/reflective-material.ts +1 -1
- package/src/experimental/textures/rgba-decoder.ts +1 -1
- package/src/geometry/gpu-geometry.ts +1 -4
- package/src/gltf/gltf/gltf-extension-support.ts +27 -5
- package/src/gltf/gltf/gltf-lod.ts +22 -4
- package/src/gltf/physics/README.md +1 -1
- package/src/gltf/types/gltf-json-schema.ts +37 -37
- package/src/gltf/types/gltf-postprocessed-schema.ts +28 -28
- package/src/graph/models/path/path-attribute-model.ts +3 -3
- package/src/graph/models/path/path-storage-model.ts +2 -2
- package/src/graph/models/path/path-trips-storage-model.ts +2 -2
- package/src/graph/models/polygon/polygon-attribute-model.ts +2 -2
- package/src/graph/models/polygon/polygon-storage-model.ts +2 -2
- package/src/graph/physics/index.ts +10 -0
- package/src/graph/physics/physics-controller-geometry.ts +264 -0
- package/src/graph/physics/physics-controller.ts +348 -0
- package/src/graph/physics/scenegraph-instance.ts +12 -1
- package/src/graph/physics/scenegraph-motion.ts +14 -3
- package/src/graph/physics/scenegraph-publication.ts +24 -4
- package/src/graph/physics/scenegraph-session.ts +35 -3
- package/src/graph/tables/gpu-table-model.ts +1 -1
- package/src/graph/tables/gpu-table-transform.ts +3 -3
- package/src/index.ts +6 -0
- package/src/model/batch-uniform-buffer.ts +51 -0
- package/src/model/gpu-vector-bindings.ts +77 -19
- package/src/model/gpu-vector-draw-batches.ts +5 -2
- package/src/model/gpu-vector-model-batches.ts +5 -0
- package/src/model/gpu-vector-model.ts +194 -122
- package/src/model/model.ts +10 -0
- package/src/scenegraph/geometry-node.ts +31 -0
- package/src/scenegraph/group-node.ts +54 -1
- package/src/scenegraph/transform-source.ts +30 -0
- package/src/splats/gpu-splat-graph-renderer.ts +1 -1
- package/src/splats/splat-data.ts +1 -1
- package/src/splats/splat-renderer.ts +10 -2
- package/src/splats/splat-sort.ts +1 -1
- package/src/text/README.md +1 -1
- package/src/text/experimental.ts +122 -1
- package/src/text/index.ts +40 -1
- package/src/text/text-2d/experimental.ts +104 -8
- package/src/text/text-2d/model-utils/text-model-props.ts +1 -1
- package/src/text/text-2d/models/text-attribute-model.ts +1 -1
- package/src/utils/deep-equal.ts +4 -2
- package/src/utils/get-platform-info.ts +1 -1
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
type RenderPass
|
|
12
12
|
} from '@luma.gl/core';
|
|
13
13
|
import {ShaderInputs} from '@luma.gl/engine';
|
|
14
|
-
import {GPUData} from '@luma.gl/
|
|
14
|
+
import {GPUData} from '@luma.gl/graph/gpu-data';
|
|
15
15
|
import {GPURecordBatch, GPUTable, type GPUInputSchema} from '@luma.gl/graph/gpu-tables';
|
|
16
16
|
import {GPUTableModel} from '@luma.gl/engine/tables';
|
|
17
17
|
import {GPUSplatData} from './splat-data';
|
|
@@ -54,6 +54,8 @@ export type SplatRendererProps = {
|
|
|
54
54
|
semanticFilter?: SplatSemanticFilter;
|
|
55
55
|
/** Camera-dependent depth ordering strategy. Defaults to `global`. */
|
|
56
56
|
sortMode?: SplatSortMode;
|
|
57
|
+
/** Projected-depth convention for alpha ordering, independent of depthCompare. Defaults to standard. */
|
|
58
|
+
depthConvention?: 'standard' | 'reverse';
|
|
57
59
|
/** Minimum fragment opacity retained after Gaussian attenuation. */
|
|
58
60
|
alphaCutoff?: number;
|
|
59
61
|
/** Alias for {@link alphaCutoff} when integrating opacity-threshold controls. */
|
|
@@ -124,6 +126,7 @@ type ResolvedSplatRendererProps = {
|
|
|
124
126
|
sphericalHarmonicsDegree: SplatSphericalHarmonicsDegree;
|
|
125
127
|
semanticFilter?: SplatSemanticFilter;
|
|
126
128
|
sortMode: SplatSortMode;
|
|
129
|
+
depthConvention: 'standard' | 'reverse';
|
|
127
130
|
alphaCutoff: number;
|
|
128
131
|
screenSizeCutoffPixels: number;
|
|
129
132
|
gaussianSupportRadius: number;
|
|
@@ -241,6 +244,7 @@ export class SplatRenderer {
|
|
|
241
244
|
sphericalHarmonicsDegree: props.sphericalHarmonicsDegree ?? 3,
|
|
242
245
|
semanticFilter: props.semanticFilter,
|
|
243
246
|
sortMode: props.sortMode ?? 'global',
|
|
247
|
+
depthConvention: props.depthConvention ?? 'standard',
|
|
244
248
|
alphaCutoff: props.alphaCutoff ?? props.opacityThreshold ?? 1 / 255,
|
|
245
249
|
screenSizeCutoffPixels: props.screenSizeCutoffPixels ?? 0,
|
|
246
250
|
gaussianSupportRadius: props.gaussianSupportRadius ?? 3,
|
|
@@ -350,6 +354,9 @@ export class SplatRenderer {
|
|
|
350
354
|
this.requiresUpdate = true;
|
|
351
355
|
this.requiresWebGLSourceUpdate = this.device.type !== 'webgpu';
|
|
352
356
|
}
|
|
357
|
+
if (props.depthConvention !== undefined) {
|
|
358
|
+
this.setResolvedProp('depthConvention', props.depthConvention);
|
|
359
|
+
}
|
|
353
360
|
if (props.sortMode !== undefined) {
|
|
354
361
|
this.setResolvedProp('sortMode', props.sortMode);
|
|
355
362
|
}
|
|
@@ -773,7 +780,8 @@ export class SplatRenderer {
|
|
|
773
780
|
const tileRow = Math.max(0, Math.floor(screenPositionY / SPLAT_TILE_SIZE_PIXELS));
|
|
774
781
|
tileIndex = tileRow * tileColumns + tileColumn;
|
|
775
782
|
}
|
|
776
|
-
const
|
|
783
|
+
const projectedDepth = clipPositionW !== 0 ? clipPositionZ / clipPositionW : clipPositionZ;
|
|
784
|
+
const depth = this.props.depthConvention === 'reverse' ? -projectedDepth : projectedDepth;
|
|
777
785
|
let reference = cachedBatchReferences[batchRowIndex];
|
|
778
786
|
if (reference) {
|
|
779
787
|
reference.depth = depth;
|
package/src/splats/splat-sort.ts
CHANGED
|
@@ -25,7 +25,7 @@ export type SplatSortReference = {
|
|
|
25
25
|
batchRowIndex: number;
|
|
26
26
|
/** Stable global source-row index. */
|
|
27
27
|
rowIndex: number;
|
|
28
|
-
/**
|
|
28
|
+
/** Back-to-front sort depth; reverse-Z renderers negate projected depth. */
|
|
29
29
|
depth: number;
|
|
30
30
|
/** Screen tile identity used by tile-local sorting. */
|
|
31
31
|
tileIndex: number;
|
package/src/text/README.md
CHANGED
|
@@ -15,7 +15,7 @@ Experimental 2D text utilities for luma.gl. CPU-side font preparation is isolate
|
|
|
15
15
|
```ts
|
|
16
16
|
import * as arrow from 'apache-arrow';
|
|
17
17
|
import {makeGPUTextDataFromArrow, convertArrowTextToAttribute} from '@luma.gl/engine/arrow';
|
|
18
|
-
import {makeArrowFixedSizeListVector} from '@luma.gl/
|
|
18
|
+
import {makeArrowFixedSizeListVector} from '@luma.gl/graph/arrow';
|
|
19
19
|
import {
|
|
20
20
|
GPUTextResources,
|
|
21
21
|
TextRenderer
|
package/src/text/experimental.ts
CHANGED
|
@@ -2,4 +2,125 @@
|
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
4
|
|
|
5
|
-
export
|
|
5
|
+
export {
|
|
6
|
+
TextAttributeModel,
|
|
7
|
+
type TextAttributeModelProps,
|
|
8
|
+
type TextAttributeRenderBatchState,
|
|
9
|
+
type TextAttributeState,
|
|
10
|
+
type PreparedTextAttributeModelProps,
|
|
11
|
+
TextStorageModel,
|
|
12
|
+
TextRowIndexedStorageModel,
|
|
13
|
+
type TextStorageBatchState,
|
|
14
|
+
type TextStorageModelProps,
|
|
15
|
+
type PreparedTextStorageModelProps,
|
|
16
|
+
type TextStorageRenderBatchState,
|
|
17
|
+
type TextStorageRenderProps,
|
|
18
|
+
type TextStorageState,
|
|
19
|
+
TextDictionaryModel,
|
|
20
|
+
type TextDictionaryBatchState,
|
|
21
|
+
type TextDictionaryModelProps,
|
|
22
|
+
type PreparedTextDictionaryModelProps,
|
|
23
|
+
type TextDictionaryRenderBatchState,
|
|
24
|
+
type TextDictionaryRenderProps,
|
|
25
|
+
type TextDictionaryState,
|
|
26
|
+
buildTextGpuDictionaryCompressedStream,
|
|
27
|
+
buildTextGpuExpandedStream,
|
|
28
|
+
buildTextGpuGlyphDefinitions,
|
|
29
|
+
type TextDictionaryCodePointSource,
|
|
30
|
+
type TextGpuGlyphDefinitions,
|
|
31
|
+
getTextRendererModel,
|
|
32
|
+
DictionaryTextRenderer,
|
|
33
|
+
type DictionaryTextRendererProps,
|
|
34
|
+
createGPUTextData,
|
|
35
|
+
getGPUTextDataProps,
|
|
36
|
+
GPUTextDataImpl,
|
|
37
|
+
type GPUTextDataProps,
|
|
38
|
+
supportsGpuTextExpansion,
|
|
39
|
+
supportsGpuUtf8TextExpansion,
|
|
40
|
+
createTextStorageGlyphMetrics,
|
|
41
|
+
createTextStorageGlyphPages,
|
|
42
|
+
createTextStorageGlyphKernings,
|
|
43
|
+
createTextStorageGlyphLookup,
|
|
44
|
+
createGpuExpandedCompactInput,
|
|
45
|
+
createGpuUtf8ExpandedInput,
|
|
46
|
+
createGpuUtf8ExpandedInputFromBuffers,
|
|
47
|
+
createGpuTextDictionaryUtf8ExpandedInput,
|
|
48
|
+
createGpuTextDictionaryUtf8ExpansionConfig,
|
|
49
|
+
createGpuExpandedGeneratedState,
|
|
50
|
+
dispatchGpuExpandedTextCompute,
|
|
51
|
+
dispatchGpuUtf8ExpandedTextCompute,
|
|
52
|
+
dispatchGpuTextDictionaryUtf8ExpandedCompute,
|
|
53
|
+
type TextStorageGlyphMetricState,
|
|
54
|
+
type TextStorageGlyphPageState,
|
|
55
|
+
type TextStorageGlyphKerningState,
|
|
56
|
+
type TextStorageGlyphLookupState,
|
|
57
|
+
type GpuExpandedCompactInputState,
|
|
58
|
+
type GpuUtf8ExpandedInputState,
|
|
59
|
+
type GpuTextDictionaryUtf8ExpandedInputState,
|
|
60
|
+
type GpuTextDictionaryUtf8ExpansionConfigState,
|
|
61
|
+
type GpuExpandedGeneratedState,
|
|
62
|
+
type GpuTextExpansionResourceOptions,
|
|
63
|
+
type GpuTextAlignmentExpansionOptions,
|
|
64
|
+
GPU_TEXT_EXPANSION_STORAGE_BUFFER_COUNT,
|
|
65
|
+
GPU_UTF8_TEXT_EXPANSION_STORAGE_BUFFER_COUNT,
|
|
66
|
+
type TextGlyphLayout,
|
|
67
|
+
type GpuExpandedTextStream,
|
|
68
|
+
type GpuUtf8TextInput,
|
|
69
|
+
type GpuTextDictionaryUtf8Input,
|
|
70
|
+
type GpuTextDictionaryCompressedStream,
|
|
71
|
+
getGpuUtf8MapShaderBindings,
|
|
72
|
+
getGpuUtf8MapShaderSource,
|
|
73
|
+
type GpuUtf8MapBindingNames,
|
|
74
|
+
type GpuUtf8MapBindingOptions,
|
|
75
|
+
type GpuUtf8MapShaderSourceOptions,
|
|
76
|
+
DEFAULT_GPU_UTF8_MAP_BINDING_NAMES,
|
|
77
|
+
makeTextGlyphAlphaGlsl,
|
|
78
|
+
makeTextGlyphAlphaWgsl,
|
|
79
|
+
type TextGlyphAlphaShaderRenderMode,
|
|
80
|
+
type TextGlyphAlphaShaderSettings,
|
|
81
|
+
type TextGlyphAlphaShaderProps,
|
|
82
|
+
getFontAtlasShaderProps,
|
|
83
|
+
createTextDefaultFragmentShaderUniforms,
|
|
84
|
+
updateTextDefaultFragmentShaderUniforms,
|
|
85
|
+
type FontAtlasShaderProps,
|
|
86
|
+
assertTextAttributeGPUVectorInputs,
|
|
87
|
+
assertTextStorageGPUVectorInputs,
|
|
88
|
+
assertTextDictionaryGPUVectorInputs,
|
|
89
|
+
TEXT_ATTRIBUTE_GPU_INPUT_SCHEMA,
|
|
90
|
+
TEXT_STORAGE_GPU_INPUT_SCHEMA,
|
|
91
|
+
TEXT_DICTIONARY_GPU_INPUT_SCHEMA,
|
|
92
|
+
type TextInputProps,
|
|
93
|
+
type TextAttributeInputProps,
|
|
94
|
+
type TextStorageInputProps,
|
|
95
|
+
type TextDictionaryInputProps,
|
|
96
|
+
GLYPH_OFFSETS_COLUMN,
|
|
97
|
+
GLYPH_FRAMES_COLUMN,
|
|
98
|
+
GLYPH_PAGES_COLUMN,
|
|
99
|
+
GLYPH_INDICES_COLUMN,
|
|
100
|
+
GLYPH_ROW_INDICES_COLUMN,
|
|
101
|
+
GLYPH_CLIP_RECTS_COLUMN,
|
|
102
|
+
EXPANDED_GLYPH_VERTEX_DATA,
|
|
103
|
+
COMPACT_GLYPH_VERTEX_DATA,
|
|
104
|
+
COMPACT_GLYPH_VERTEX_BYTE_STRIDE,
|
|
105
|
+
ROW_INDEXED_COMPACT_GLYPH_VERTEX_BYTE_STRIDE,
|
|
106
|
+
EXPANDED_GLYPH_VERTEX_BYTE_STRIDE,
|
|
107
|
+
CLIPPED_EXPANDED_GLYPH_VERTEX_BYTE_STRIDE,
|
|
108
|
+
INVALID_DICTIONARY_INDEX,
|
|
109
|
+
DEFAULT_TEXT_SHADER_LAYOUT,
|
|
110
|
+
DEFAULT_CLIPPED_TEXT_SHADER_LAYOUT,
|
|
111
|
+
DEFAULT_TEXT_STORAGE_INDEXED_SHADER_LAYOUT,
|
|
112
|
+
DEFAULT_TEXT_ROW_INDEXED_STORAGE_SHADER_LAYOUT,
|
|
113
|
+
DEFAULT_TEXT_DICTIONARY_STORAGE_SHADER_LAYOUT,
|
|
114
|
+
DEFAULT_TEXT_VS,
|
|
115
|
+
DEFAULT_CLIPPED_TEXT_VS,
|
|
116
|
+
DEFAULT_TEXT_FS,
|
|
117
|
+
DEFAULT_TEXT_STORAGE_INDEXED_SOURCE,
|
|
118
|
+
DEFAULT_TEXT_ROW_INDEXED_STORAGE_SOURCE,
|
|
119
|
+
DEFAULT_TEXT_DICTIONARY_STORAGE_SOURCE,
|
|
120
|
+
getFirstTextStorageBatch,
|
|
121
|
+
getFirstTextStorageRenderBatch,
|
|
122
|
+
getTextStorageRowGlyphStartsBuffer,
|
|
123
|
+
getFirstTextDictionaryBatch,
|
|
124
|
+
getFirstTextDictionaryRenderBatch,
|
|
125
|
+
type TextStorageBuffer
|
|
126
|
+
} from './text-2d/experimental';
|
package/src/text/index.ts
CHANGED
|
@@ -2,4 +2,43 @@
|
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
4
|
|
|
5
|
-
export
|
|
5
|
+
export {
|
|
6
|
+
type FontAtlas,
|
|
7
|
+
type GPUTextData,
|
|
8
|
+
type GPUTextStats,
|
|
9
|
+
type GPUTextStrategy,
|
|
10
|
+
GPUTextResources,
|
|
11
|
+
type GPUTextResourcesProps,
|
|
12
|
+
TextRenderer,
|
|
13
|
+
type TextRendererProps,
|
|
14
|
+
measureFontAtlasText,
|
|
15
|
+
type FontAtlasTextMetrics,
|
|
16
|
+
type FontAtlasTextMetricsOptions,
|
|
17
|
+
buildBitmapFontAtlas,
|
|
18
|
+
type BitmapFontAtlasSettings,
|
|
19
|
+
buildSdfFontAtlas,
|
|
20
|
+
type SdfFontAtlasSettings,
|
|
21
|
+
buildMsdfFontAtlas,
|
|
22
|
+
loadMsdfFontAtlas,
|
|
23
|
+
type BmFontMsdfCharacter,
|
|
24
|
+
type BmFontMsdfData,
|
|
25
|
+
type BmFontMsdfKerning,
|
|
26
|
+
buildMapping,
|
|
27
|
+
getCharacterAtlasPage,
|
|
28
|
+
getCharacterLayoutOffset,
|
|
29
|
+
getTextKerningOffset,
|
|
30
|
+
nextPowOfTwo,
|
|
31
|
+
type Character,
|
|
32
|
+
type CharacterMapping,
|
|
33
|
+
type TextKerning,
|
|
34
|
+
type TextGlyphLayout,
|
|
35
|
+
buildTextGlyphLayout,
|
|
36
|
+
type TextCodePointSource,
|
|
37
|
+
type TextLayoutOptions,
|
|
38
|
+
parseGlyphRange,
|
|
39
|
+
type Glyph,
|
|
40
|
+
GlyphRangeLoader,
|
|
41
|
+
type GlyphRangeLoaderOptions,
|
|
42
|
+
buildGlyphFontAtlas,
|
|
43
|
+
createGlyphFontRenderer
|
|
44
|
+
} from './text-2d/index';
|
|
@@ -29,11 +29,64 @@ export {
|
|
|
29
29
|
type TextDictionaryRenderProps,
|
|
30
30
|
type TextDictionaryState
|
|
31
31
|
} from './models/text-dictionary-model';
|
|
32
|
-
export
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
32
|
+
export {
|
|
33
|
+
supportsGpuTextExpansion,
|
|
34
|
+
supportsGpuUtf8TextExpansion,
|
|
35
|
+
createTextStorageGlyphMetrics,
|
|
36
|
+
createTextStorageGlyphPages,
|
|
37
|
+
createTextStorageGlyphKernings,
|
|
38
|
+
createTextStorageGlyphLookup,
|
|
39
|
+
createGpuExpandedCompactInput,
|
|
40
|
+
createGpuUtf8ExpandedInput,
|
|
41
|
+
createGpuUtf8ExpandedInputFromBuffers,
|
|
42
|
+
createGpuTextDictionaryUtf8ExpandedInput,
|
|
43
|
+
createGpuTextDictionaryUtf8ExpansionConfig,
|
|
44
|
+
createGpuExpandedGeneratedState,
|
|
45
|
+
dispatchGpuExpandedTextCompute,
|
|
46
|
+
dispatchGpuUtf8ExpandedTextCompute,
|
|
47
|
+
dispatchGpuTextDictionaryUtf8ExpandedCompute,
|
|
48
|
+
type TextStorageGlyphMetricState,
|
|
49
|
+
type TextStorageGlyphPageState,
|
|
50
|
+
type TextStorageGlyphKerningState,
|
|
51
|
+
type TextStorageGlyphLookupState,
|
|
52
|
+
type GpuExpandedCompactInputState,
|
|
53
|
+
type GpuUtf8ExpandedInputState,
|
|
54
|
+
type GpuTextDictionaryUtf8ExpandedInputState,
|
|
55
|
+
type GpuTextDictionaryUtf8ExpansionConfigState,
|
|
56
|
+
type GpuExpandedGeneratedState,
|
|
57
|
+
type GpuTextExpansionResourceOptions,
|
|
58
|
+
type GpuTextAlignmentExpansionOptions,
|
|
59
|
+
GPU_TEXT_EXPANSION_STORAGE_BUFFER_COUNT,
|
|
60
|
+
GPU_UTF8_TEXT_EXPANSION_STORAGE_BUFFER_COUNT
|
|
61
|
+
} from './model-utils/gpu-text-expansion';
|
|
62
|
+
export {
|
|
63
|
+
type TextGlyphLayout,
|
|
64
|
+
type GpuExpandedTextStream,
|
|
65
|
+
type GpuUtf8TextInput,
|
|
66
|
+
type GpuTextDictionaryUtf8Input,
|
|
67
|
+
type GpuTextDictionaryCompressedStream
|
|
68
|
+
} from './model-utils/gpu-text-types';
|
|
69
|
+
export {
|
|
70
|
+
getGpuUtf8MapShaderBindings,
|
|
71
|
+
getGpuUtf8MapShaderSource,
|
|
72
|
+
type GpuUtf8MapBindingNames,
|
|
73
|
+
type GpuUtf8MapBindingOptions,
|
|
74
|
+
type GpuUtf8MapShaderSourceOptions,
|
|
75
|
+
DEFAULT_GPU_UTF8_MAP_BINDING_NAMES
|
|
76
|
+
} from './model-utils/gpu-utf8-map';
|
|
77
|
+
export {
|
|
78
|
+
makeTextGlyphAlphaGlsl,
|
|
79
|
+
makeTextGlyphAlphaWgsl,
|
|
80
|
+
type TextGlyphAlphaShaderRenderMode,
|
|
81
|
+
type TextGlyphAlphaShaderSettings,
|
|
82
|
+
type TextGlyphAlphaShaderProps
|
|
83
|
+
} from './model-utils/text-fragment-shaders';
|
|
84
|
+
export {
|
|
85
|
+
getFontAtlasShaderProps,
|
|
86
|
+
createTextDefaultFragmentShaderUniforms,
|
|
87
|
+
updateTextDefaultFragmentShaderUniforms,
|
|
88
|
+
type FontAtlasShaderProps
|
|
89
|
+
} from './model-utils/text-fragment-uniforms';
|
|
37
90
|
export {
|
|
38
91
|
buildTextGpuDictionaryCompressedStream,
|
|
39
92
|
buildTextGpuExpandedStream,
|
|
@@ -41,9 +94,52 @@ export {
|
|
|
41
94
|
type TextDictionaryCodePointSource,
|
|
42
95
|
type TextGpuGlyphDefinitions
|
|
43
96
|
} from './model-utils/text-layout';
|
|
44
|
-
export
|
|
45
|
-
|
|
46
|
-
|
|
97
|
+
export {
|
|
98
|
+
assertTextAttributeGPUVectorInputs,
|
|
99
|
+
assertTextStorageGPUVectorInputs,
|
|
100
|
+
assertTextDictionaryGPUVectorInputs,
|
|
101
|
+
TEXT_ATTRIBUTE_GPU_INPUT_SCHEMA,
|
|
102
|
+
TEXT_STORAGE_GPU_INPUT_SCHEMA,
|
|
103
|
+
TEXT_DICTIONARY_GPU_INPUT_SCHEMA,
|
|
104
|
+
type TextInputProps,
|
|
105
|
+
type TextAttributeInputProps,
|
|
106
|
+
type TextStorageInputProps,
|
|
107
|
+
type TextDictionaryInputProps
|
|
108
|
+
} from './model-utils/text-model-props';
|
|
109
|
+
export {
|
|
110
|
+
GLYPH_OFFSETS_COLUMN,
|
|
111
|
+
GLYPH_FRAMES_COLUMN,
|
|
112
|
+
GLYPH_PAGES_COLUMN,
|
|
113
|
+
GLYPH_INDICES_COLUMN,
|
|
114
|
+
GLYPH_ROW_INDICES_COLUMN,
|
|
115
|
+
GLYPH_CLIP_RECTS_COLUMN,
|
|
116
|
+
EXPANDED_GLYPH_VERTEX_DATA,
|
|
117
|
+
COMPACT_GLYPH_VERTEX_DATA,
|
|
118
|
+
COMPACT_GLYPH_VERTEX_BYTE_STRIDE,
|
|
119
|
+
ROW_INDEXED_COMPACT_GLYPH_VERTEX_BYTE_STRIDE,
|
|
120
|
+
EXPANDED_GLYPH_VERTEX_BYTE_STRIDE,
|
|
121
|
+
CLIPPED_EXPANDED_GLYPH_VERTEX_BYTE_STRIDE,
|
|
122
|
+
INVALID_DICTIONARY_INDEX,
|
|
123
|
+
DEFAULT_TEXT_SHADER_LAYOUT,
|
|
124
|
+
DEFAULT_CLIPPED_TEXT_SHADER_LAYOUT,
|
|
125
|
+
DEFAULT_TEXT_STORAGE_INDEXED_SHADER_LAYOUT,
|
|
126
|
+
DEFAULT_TEXT_ROW_INDEXED_STORAGE_SHADER_LAYOUT,
|
|
127
|
+
DEFAULT_TEXT_DICTIONARY_STORAGE_SHADER_LAYOUT,
|
|
128
|
+
DEFAULT_TEXT_VS,
|
|
129
|
+
DEFAULT_CLIPPED_TEXT_VS,
|
|
130
|
+
DEFAULT_TEXT_FS,
|
|
131
|
+
DEFAULT_TEXT_STORAGE_INDEXED_SOURCE,
|
|
132
|
+
DEFAULT_TEXT_ROW_INDEXED_STORAGE_SOURCE,
|
|
133
|
+
DEFAULT_TEXT_DICTIONARY_STORAGE_SOURCE
|
|
134
|
+
} from './model-utils/text-shaders';
|
|
135
|
+
export {
|
|
136
|
+
getFirstTextStorageBatch,
|
|
137
|
+
getFirstTextStorageRenderBatch,
|
|
138
|
+
getTextStorageRowGlyphStartsBuffer,
|
|
139
|
+
getFirstTextDictionaryBatch,
|
|
140
|
+
getFirstTextDictionaryRenderBatch,
|
|
141
|
+
type TextStorageBuffer
|
|
142
|
+
} from './model-utils/text-storage-state';
|
|
47
143
|
export {getTextRendererModel} from './text-renderer';
|
|
48
144
|
export {
|
|
49
145
|
DictionaryTextRenderer,
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
4
|
|
|
5
5
|
import type {ModelProps} from '@luma.gl/engine';
|
|
6
|
-
import {type GPUVector, type ValueList, type VertexList} from '@luma.gl/
|
|
6
|
+
import {type GPUVector, type ValueList, type VertexList} from '@luma.gl/graph/gpu-data';
|
|
7
7
|
import {
|
|
8
8
|
validateGPUInputVectors,
|
|
9
9
|
type GPUInputSchema,
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import {type Buffer, type Device, type RenderPass} from '@luma.gl/core';
|
|
6
6
|
import type {ModelProps} from '@luma.gl/engine';
|
|
7
7
|
import type {DynamicTexture} from '@luma.gl/core/dynamic';
|
|
8
|
-
import {getGPUDataBuffersForLayout, getGPUDataByteOffsetsForLayout} from '@luma.gl/
|
|
8
|
+
import {getGPUDataBuffersForLayout, getGPUDataByteOffsetsForLayout} from '@luma.gl/graph/gpu-data';
|
|
9
9
|
import {GPUTableModel, type GPUTableModelProps} from '@luma.gl/engine/tables';
|
|
10
10
|
import type {TextGlyphLayout} from '../model-utils/gpu-text-types';
|
|
11
11
|
import {EXPANDED_GLYPH_VERTEX_DATA} from '../model-utils/text-shaders';
|
package/src/utils/deep-equal.ts
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* @param depth Depth to which to recurse in nested Objects/Arrays. Use 0 (default) for shallow comparison, -1 for infinite depth
|
|
11
11
|
*/
|
|
12
12
|
/* eslint-disable complexity */
|
|
13
|
-
export function deepEqual(a:
|
|
13
|
+
export function deepEqual(a: unknown, b: unknown, depth: number): boolean {
|
|
14
14
|
if (a === b) {
|
|
15
15
|
return true;
|
|
16
16
|
}
|
|
@@ -32,6 +32,8 @@ export function deepEqual(a: any, b: any, depth: number): boolean {
|
|
|
32
32
|
return false;
|
|
33
33
|
}
|
|
34
34
|
if (typeof a === 'object' && typeof b === 'object') {
|
|
35
|
+
const aObject = a as Record<string, unknown>;
|
|
36
|
+
const bObject = b as Record<string, unknown>;
|
|
35
37
|
const aKeys = Object.keys(a);
|
|
36
38
|
const bKeys = Object.keys(b);
|
|
37
39
|
if (aKeys.length !== bKeys.length) {
|
|
@@ -41,7 +43,7 @@ export function deepEqual(a: any, b: any, depth: number): boolean {
|
|
|
41
43
|
if (!b.hasOwnProperty(key)) {
|
|
42
44
|
return false;
|
|
43
45
|
}
|
|
44
|
-
if (!deepEqual(
|
|
46
|
+
if (!deepEqual(aObject[key], bObject[key], depth - 1)) {
|
|
45
47
|
return false;
|
|
46
48
|
}
|
|
47
49
|
}
|