@voluma/vlam 0.2.3 → 0.3.0

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.
Files changed (91) hide show
  1. package/README.md +3 -2
  2. package/dist/budget-governor.d.ts +4 -4
  3. package/dist/camera-budget-governor.d.ts +11 -11
  4. package/dist/chunk-cache-budget.d.ts +5 -5
  5. package/dist/chunk-fetch-scheduler.d.ts +4 -4
  6. package/dist/chunk-loader-DlNwggfG.js +1859 -0
  7. package/dist/chunk-loader-DlNwggfG.js.map +1 -0
  8. package/dist/chunk-loader.d.ts +2 -2
  9. package/dist/compute-sorter.d.ts +1 -1
  10. package/dist/effects.d.ts +26 -16
  11. package/dist/effects.js +199 -165
  12. package/dist/effects.js.map +1 -1
  13. package/dist/formats/ksplat/index.d.ts +1 -1
  14. package/dist/formats/lcc/collision-mesh.d.ts +2 -2
  15. package/dist/formats/lcc.js +17 -16
  16. package/dist/formats/lcc.js.map +1 -1
  17. package/dist/formats/ply/index.d.ts +1 -1
  18. package/dist/formats/ply/parse-splat-ply.d.ts +2 -2
  19. package/dist/formats/ply.js +1 -1
  20. package/dist/formats/ply.js.map +1 -1
  21. package/dist/formats/rad/index.d.ts +1 -1
  22. package/dist/formats/rad/parse-rad.d.ts +1 -1
  23. package/dist/formats/rad/rad.d.ts +2 -2
  24. package/dist/formats/rad.js +3 -3
  25. package/dist/formats/rad.js.map +1 -1
  26. package/dist/formats/sog/index.d.ts +1 -1
  27. package/dist/formats/sog/parse-sog.d.ts +4 -4
  28. package/dist/formats/sog.js.map +1 -1
  29. package/dist/formats/splat/index.d.ts +1 -1
  30. package/dist/formats/spz/index.d.ts +1 -1
  31. package/dist/index.d.ts +16 -25
  32. package/dist/index.js +253 -9047
  33. package/dist/index.js.map +1 -1
  34. package/dist/{load-scene.d.ts → load-splat-data.d.ts} +15 -13
  35. package/dist/loaders.d.ts +15 -0
  36. package/dist/loaders.js +26 -0
  37. package/dist/loaders.js.map +1 -0
  38. package/dist/loading-wLo8vRbA.js.map +1 -1
  39. package/dist/loading.d.ts +8 -8
  40. package/dist/{splat-mesh-types-CTN_duw2.js → lod-scheduler-B0a_uBlv.js} +133 -140
  41. package/dist/lod-scheduler-B0a_uBlv.js.map +1 -0
  42. package/dist/lod-scheduler.d.ts +1 -1
  43. package/dist/lod-source.d.ts +5 -5
  44. package/dist/{splat-scene.d.ts → merged-splat-mesh.d.ts} +14 -15
  45. package/dist/orientation.d.ts +7 -7
  46. package/dist/{ply-header-BwgExCn-.js → ply-header-B9WllbPg.js} +3 -3
  47. package/dist/{ply-header-BwgExCn-.js.map → ply-header-B9WllbPg.js.map} +1 -1
  48. package/dist/radix-sorter-R0FCSqKu.js +178 -0
  49. package/dist/radix-sorter-R0FCSqKu.js.map +1 -0
  50. package/dist/relighting-CSQF3UcL.js +969 -0
  51. package/dist/relighting-CSQF3UcL.js.map +1 -0
  52. package/dist/relighting.d.ts +1 -1
  53. package/dist/selection.d.ts +13 -0
  54. package/dist/selection.js +137 -0
  55. package/dist/selection.js.map +1 -0
  56. package/dist/source-transform.d.ts +4 -4
  57. package/dist/{splat-budget-DXew_86c.js → splat-budget-DuVZspPQ.js} +7 -7
  58. package/dist/{splat-budget-DXew_86c.js.map → splat-budget-DuVZspPQ.js.map} +1 -1
  59. package/dist/splat-budget.d.ts +1 -1
  60. package/dist/splat-data-BZM5dhhx.js.map +1 -1
  61. package/dist/splat-data.d.ts +4 -4
  62. package/dist/splat-mesh-aQdcWA6v.js +1942 -0
  63. package/dist/splat-mesh-aQdcWA6v.js.map +1 -0
  64. package/dist/splat-mesh-material.d.ts +2 -2
  65. package/dist/splat-mesh-types-BZIko-_9.js +18 -0
  66. package/dist/splat-mesh-types-BZIko-_9.js.map +1 -0
  67. package/dist/splat-mesh-types.d.ts +14 -8
  68. package/dist/splat-mesh.d.ts +4 -4
  69. package/dist/splat-modifier.d.ts +5 -5
  70. package/dist/splat-partition.d.ts +1 -1
  71. package/dist/static-lod-entry.d.ts +12 -0
  72. package/dist/static-lod-splat-mesh.d.ts +2 -2
  73. package/dist/{static-lod-worker-D2fyqQZO.js → static-lod-worker-DktKnJkR.js} +46 -46
  74. package/dist/{static-lod-worker-D2fyqQZO.js.map → static-lod-worker-DktKnJkR.js.map} +1 -1
  75. package/dist/static-lod.js +148 -0
  76. package/dist/static-lod.js.map +1 -0
  77. package/dist/streamed-splat-mesh.d.ts +21 -27
  78. package/dist/streaming.d.ts +23 -0
  79. package/dist/streaming.js +2877 -0
  80. package/dist/streaming.js.map +1 -0
  81. package/dist/{unified-splat-renderer.d.ts → unified-splat-mesh.d.ts} +10 -10
  82. package/dist/unified-work-buffer.d.ts +66 -0
  83. package/dist/unified.d.ts +11 -0
  84. package/dist/unified.js +738 -0
  85. package/dist/unified.js.map +1 -0
  86. package/dist/webgpu-limits-Y3CI_6_6.js +43 -0
  87. package/dist/webgpu-limits-Y3CI_6_6.js.map +1 -0
  88. package/dist/webgpu-limits.d.ts +0 -59
  89. package/dist/work-buffer-gather.d.ts +1 -1
  90. package/package.json +24 -4
  91. package/dist/splat-mesh-types-CTN_duw2.js.map +0 -1
@@ -3,7 +3,7 @@ import { type DepthOfFieldSettings } from './depth-of-field';
3
3
  import { type RelightingSettings, type RelightingUniforms } from './relighting';
4
4
  import { SplatMesh } from './splat-mesh';
5
5
  import type { SplatPickOptions, SplatPickResult } from './splat-mesh';
6
- /** Registration settings for one source in a {@link UnifiedSplatRenderer}. */
6
+ /** Registration settings for one source in a {@link UnifiedSplatMesh}. */
7
7
  export interface UnifiedSplatSourceOptions {
8
8
  /** Whole-source opacity applied after its modifier stack. Defaults to `1`. */
9
9
  opacity?: number;
@@ -12,7 +12,7 @@ export interface UnifiedSplatSourceOptions {
12
12
  /** Higher values survive a fixed work-buffer overflow first. Defaults to `0`. */
13
13
  priority?: number;
14
14
  /**
15
- * Cache a modifier-bearing source until {@link UnifiedSplatRenderer.invalidateSource}
15
+ * Cache a modifier-bearing source until {@link UnifiedSplatMesh.invalidateSource}
16
16
  * is called. Defaults to `false`, which safely re-gathers live modifier
17
17
  * uniforms every frame.
18
18
  *
@@ -23,7 +23,7 @@ export interface UnifiedSplatSourceOptions {
23
23
  cacheModifiers?: boolean;
24
24
  }
25
25
  /**
26
- * Result of a successful {@link UnifiedSplatRenderer.pick}: the frontmost hit
26
+ * Result of a successful {@link UnifiedSplatMesh.pick}: the frontmost hit
27
27
  * across every visible registered source, tagged with the source it landed on.
28
28
  */
29
29
  export interface UnifiedSplatPickResult extends SplatPickResult {
@@ -35,7 +35,7 @@ export interface UnifiedSplatPickResult extends SplatPickResult {
35
35
  *
36
36
  * @experimental May change in a minor release.
37
37
  */
38
- export interface UnifiedSplatRendererOptions {
38
+ export interface UnifiedSplatMeshOptions {
39
39
  /** Composite source colors in display (sRGB) space. Defaults to `false`. */
40
40
  srgbOutput?: boolean;
41
41
  /**
@@ -49,11 +49,11 @@ export interface UnifiedSplatRendererOptions {
49
49
  sortStrategy?: 'counting' | 'exact';
50
50
  }
51
51
  /**
52
- * Returns true when `renderer` can drive {@link UnifiedSplatRenderer}.
52
+ * Returns true when `renderer` can drive {@link UnifiedSplatMesh}.
53
53
  * Heterogeneous gather/sort/draw is WebGPU-only; WebGL2 hosts keep standalone
54
- * `SplatMesh` draws or static {@link SplatScene}.
54
+ * `SplatMesh` draws or static {@link MergedSplatMesh}.
55
55
  */
56
- export declare function supportsUnifiedSplatRenderer(renderer: object): boolean;
56
+ export declare function supportsUnifiedSplatMesh(renderer: object): boolean;
57
57
  /**
58
58
  * One gather → global-sort → draw path for static and streamed splat sources.
59
59
  * Sources retain their own residency and update lifecycle; this mesh gathers
@@ -63,11 +63,11 @@ export declare function supportsUnifiedSplatRenderer(renderer: object): boolean;
63
63
  * registered source mesh instead - sorter bounds and the draw material both
64
64
  * consume world-space centers written by gather.
65
65
  *
66
- * WebGPU only. Prefer {@link supportsUnifiedSplatRenderer} before construction.
66
+ * WebGPU only. Prefer {@link supportsUnifiedSplatMesh} before construction.
67
67
  *
68
68
  * @experimental May change in a minor release.
69
69
  */
70
- export declare class UnifiedSplatRenderer extends THREE.Mesh {
70
+ export declare class UnifiedSplatMesh extends THREE.Mesh {
71
71
  private readonly workBuffer;
72
72
  private readonly workSourceIndex;
73
73
  /** The sorted draw-order buffer; lives outside the geometry, freed on dispose. */
@@ -131,7 +131,7 @@ export declare class UnifiedSplatRenderer extends THREE.Mesh {
131
131
  private overflowedSourceCount;
132
132
  private overflowedSplatCount;
133
133
  private disposed;
134
- constructor(renderer: THREE.WebGPURenderer, capacity: number, options?: UnifiedSplatRendererOptions);
134
+ constructor(renderer: THREE.WebGPURenderer, capacity: number, options?: UnifiedSplatMeshOptions);
135
135
  /** Fixed work-buffer splat capacity chosen at construction. */
136
136
  get capacity(): number;
137
137
  /** Registers a source. The caller keeps ownership and may still query it. */
@@ -0,0 +1,66 @@
1
+ /**
2
+ * Byte costs of {@link UnifiedSplatMesh}'s GPU work buffer.
3
+ *
4
+ * Kept off the core entry so hosts that never composite sources do not pay
5
+ * for the accounting, and so the numbers cannot drift from the renderer
6
+ * that allocates those buffers.
7
+ */
8
+ /** Bytes per splat in the largest unified work-buffer attribute (RGBA32F centers). */
9
+ export declare const WORK_BUFFER_CENTERS_BYTES_PER_SPLAT = 16;
10
+ /**
11
+ * Bytes per work-buffer slot across *all* of its attributes: centers, colors,
12
+ * covarianceA and covarianceB at RGBA32F (16 each), plus the isotropic mix and
13
+ * screen-radius scalars (4 each).
14
+ */
15
+ export declare const WORK_BUFFER_BYTES_PER_SLOT: number;
16
+ /**
17
+ * Byte size of the largest single storage-buffer bind VLAM allocates for a
18
+ * given splat capacity (unified work-buffer centers: `capacity × 16`).
19
+ *
20
+ * Use with adapter/device limits to decide whether to raise `requiredLimits`
21
+ * or lower the budget before constructing {@link UnifiedSplatMesh}.
22
+ */
23
+ export declare function estimateLargestStorageBufferBytes(capacity: number): number;
24
+ /**
25
+ * Estimates what a {@link UnifiedSplatMesh}'s work buffer costs, in bytes,
26
+ * once the scene has rendered a frame.
27
+ *
28
+ * This used to be double the figure below, and the doubling was not a detail.
29
+ * Every `THREE.StorageBufferAttribute` is constructed around a JS typed array,
30
+ * and three's WebGPU backend never releases it: the
31
+ * `attribute.onUploadCallback()` call that would is missing from the backend's
32
+ * buffer upload path. So a work buffer of N slots cost
33
+ * N × {@link WORK_BUFFER_BYTES_PER_SLOT} on the GPU *and* the same again on the
34
+ * JS heap, permanently, even though nothing ever reads the CPU copy back - the
35
+ * gather pass writes these buffers entirely on the GPU.
36
+ *
37
+ * `WorkBuffer.releaseCpuMirrors` now drops those mirrors after the first
38
+ * dispatch that uploads them (see `storage-attribute-mirror`), so steady state
39
+ * is the GPU side alone. The *peak* is still double - the array has to exist
40
+ * for the upload copy - which is what
41
+ * {@link estimateUnifiedWorkBufferPeakBytes} reports.
42
+ *
43
+ * Either figure is invisible to `estimateSplatPoolBytes`, which prices the
44
+ * splat *pool* and knows nothing about the unified renderer's scratch space. A
45
+ * host sizing a scene for a memory-constrained device wants both.
46
+ *
47
+ * @param capacity - Work-buffer capacity in splats.
48
+ * @returns Estimated steady-state bytes.
49
+ * @throws {RangeError} if `capacity` is not a non-negative finite number.
50
+ */
51
+ export declare function estimateUnifiedWorkBufferBytes(capacity: number): number;
52
+ /**
53
+ * Peak bytes a {@link UnifiedSplatMesh}'s work buffer occupies: the window
54
+ * between construction and the first dispatch, while the GPU buffer and the JS
55
+ * array three copied it from are both alive.
56
+ *
57
+ * Ask this one when the question is "will allocating this scene succeed" - an
58
+ * out-of-memory failure happens against the peak. Ask
59
+ * {@link estimateUnifiedWorkBufferBytes} when the question is "what will this
60
+ * scene hold once it is up".
61
+ *
62
+ * @param capacity - Work-buffer capacity in splats.
63
+ * @returns Estimated bytes, GPU plus the not-yet-released CPU mirror.
64
+ * @throws {RangeError} if `capacity` is not a non-negative finite number.
65
+ */
66
+ export declare function estimateUnifiedWorkBufferPeakBytes(capacity: number): number;
@@ -0,0 +1,11 @@
1
+ /**
2
+ * `@voluma/vlam/unified` - one WebGPU draw over several splat sources.
3
+ *
4
+ * {@link UnifiedSplatMesh} concatenates static and streamed meshes into a
5
+ * shared work buffer so overlapping clouds inter-sort. WebGL2 is unsupported;
6
+ * {@link supportsUnifiedSplatMesh} reports that after renderer init.
7
+ *
8
+ * @module unified
9
+ */
10
+ export { UnifiedSplatMesh, supportsUnifiedSplatMesh, type UnifiedSplatPickResult, type UnifiedSplatMeshOptions, type UnifiedSplatSourceOptions, } from './unified-splat-mesh';
11
+ export { estimateLargestStorageBufferBytes, estimateUnifiedWorkBufferBytes, estimateUnifiedWorkBufferPeakBytes, WORK_BUFFER_CENTERS_BYTES_PER_SPLAT, WORK_BUFFER_BYTES_PER_SLOT, } from './unified-work-buffer';