@voluma/vlam 0.2.4 → 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.
- package/README.md +3 -2
- package/dist/budget-governor.d.ts +4 -4
- package/dist/camera-budget-governor.d.ts +11 -11
- package/dist/chunk-cache-budget.d.ts +5 -5
- package/dist/chunk-fetch-scheduler.d.ts +4 -4
- package/dist/chunk-loader-DlNwggfG.js +1859 -0
- package/dist/chunk-loader-DlNwggfG.js.map +1 -0
- package/dist/chunk-loader.d.ts +2 -2
- package/dist/compute-sorter.d.ts +1 -1
- package/dist/effects.d.ts +11 -10
- package/dist/effects.js.map +1 -1
- package/dist/formats/ksplat/index.d.ts +1 -1
- package/dist/formats/lcc/collision-mesh.d.ts +2 -2
- package/dist/formats/lcc.js +17 -16
- package/dist/formats/lcc.js.map +1 -1
- package/dist/formats/ply/index.d.ts +1 -1
- package/dist/formats/ply/parse-splat-ply.d.ts +2 -2
- package/dist/formats/ply.js +1 -1
- package/dist/formats/ply.js.map +1 -1
- package/dist/formats/rad/index.d.ts +1 -1
- package/dist/formats/rad/parse-rad.d.ts +1 -1
- package/dist/formats/rad/rad.d.ts +2 -2
- package/dist/formats/rad.js +3 -3
- package/dist/formats/rad.js.map +1 -1
- package/dist/formats/sog/index.d.ts +1 -1
- package/dist/formats/sog/parse-sog.d.ts +4 -4
- package/dist/formats/sog.js.map +1 -1
- package/dist/formats/splat/index.d.ts +1 -1
- package/dist/formats/spz/index.d.ts +1 -1
- package/dist/index.d.ts +16 -25
- package/dist/index.js +253 -9047
- package/dist/index.js.map +1 -1
- package/dist/{load-scene.d.ts → load-splat-data.d.ts} +15 -13
- package/dist/loaders.d.ts +15 -0
- package/dist/loaders.js +26 -0
- package/dist/loaders.js.map +1 -0
- package/dist/loading-wLo8vRbA.js.map +1 -1
- package/dist/loading.d.ts +8 -8
- package/dist/{splat-mesh-types-CTN_duw2.js → lod-scheduler-B0a_uBlv.js} +133 -140
- package/dist/lod-scheduler-B0a_uBlv.js.map +1 -0
- package/dist/lod-scheduler.d.ts +1 -1
- package/dist/lod-source.d.ts +5 -5
- package/dist/{splat-scene.d.ts → merged-splat-mesh.d.ts} +14 -15
- package/dist/orientation.d.ts +7 -7
- package/dist/{ply-header-BwgExCn-.js → ply-header-B9WllbPg.js} +3 -3
- package/dist/{ply-header-BwgExCn-.js.map → ply-header-B9WllbPg.js.map} +1 -1
- package/dist/radix-sorter-R0FCSqKu.js +178 -0
- package/dist/radix-sorter-R0FCSqKu.js.map +1 -0
- package/dist/relighting-CSQF3UcL.js +969 -0
- package/dist/relighting-CSQF3UcL.js.map +1 -0
- package/dist/relighting.d.ts +1 -1
- package/dist/selection.d.ts +13 -0
- package/dist/selection.js +137 -0
- package/dist/selection.js.map +1 -0
- package/dist/source-transform.d.ts +4 -4
- package/dist/{splat-budget-DXew_86c.js → splat-budget-DuVZspPQ.js} +7 -7
- package/dist/{splat-budget-DXew_86c.js.map → splat-budget-DuVZspPQ.js.map} +1 -1
- package/dist/splat-budget.d.ts +1 -1
- package/dist/splat-data-BZM5dhhx.js.map +1 -1
- package/dist/splat-data.d.ts +4 -4
- package/dist/splat-mesh-aQdcWA6v.js +1942 -0
- package/dist/splat-mesh-aQdcWA6v.js.map +1 -0
- package/dist/splat-mesh-material.d.ts +2 -2
- package/dist/splat-mesh-types-BZIko-_9.js +18 -0
- package/dist/splat-mesh-types-BZIko-_9.js.map +1 -0
- package/dist/splat-mesh-types.d.ts +14 -8
- package/dist/splat-mesh.d.ts +4 -4
- package/dist/splat-modifier.d.ts +5 -5
- package/dist/splat-partition.d.ts +1 -1
- package/dist/static-lod-entry.d.ts +12 -0
- package/dist/static-lod-splat-mesh.d.ts +2 -2
- package/dist/{static-lod-worker-D2fyqQZO.js → static-lod-worker-DktKnJkR.js} +46 -46
- package/dist/{static-lod-worker-D2fyqQZO.js.map → static-lod-worker-DktKnJkR.js.map} +1 -1
- package/dist/static-lod.js +148 -0
- package/dist/static-lod.js.map +1 -0
- package/dist/streamed-splat-mesh.d.ts +21 -27
- package/dist/streaming.d.ts +23 -0
- package/dist/streaming.js +2877 -0
- package/dist/streaming.js.map +1 -0
- package/dist/{unified-splat-renderer.d.ts → unified-splat-mesh.d.ts} +10 -10
- package/dist/unified-work-buffer.d.ts +66 -0
- package/dist/unified.d.ts +11 -0
- package/dist/unified.js +738 -0
- package/dist/unified.js.map +1 -0
- package/dist/webgpu-limits-Y3CI_6_6.js +43 -0
- package/dist/webgpu-limits-Y3CI_6_6.js.map +1 -0
- package/dist/webgpu-limits.d.ts +0 -59
- package/dist/work-buffer-gather.d.ts +1 -1
- package/package.json +24 -4
- package/dist/splat-mesh-types-CTN_duw2.js.map +0 -1
package/README.md
CHANGED
|
@@ -31,7 +31,8 @@ npm install @voluma/vlam three
|
|
|
31
31
|
|
|
32
32
|
```ts
|
|
33
33
|
import * as THREE from 'three/webgpu';
|
|
34
|
-
import { SplatMesh, createSplatRenderer
|
|
34
|
+
import { SplatMesh, createSplatRenderer } from '@voluma/vlam';
|
|
35
|
+
import { loadSplatData } from '@voluma/vlam/loaders';
|
|
35
36
|
|
|
36
37
|
const renderer = await createSplatRenderer();
|
|
37
38
|
renderer.setSize(innerWidth, innerHeight);
|
|
@@ -42,7 +43,7 @@ const camera = new THREE.PerspectiveCamera(60, innerWidth / innerHeight, 0.01, 1
|
|
|
42
43
|
camera.position.set(1, 0.5, 1.4);
|
|
43
44
|
camera.lookAt(0, 0, 0);
|
|
44
45
|
|
|
45
|
-
const splats = new SplatMesh(await
|
|
46
|
+
const splats = new SplatMesh(await loadSplatData('/scene.sog'));
|
|
46
47
|
scene.add(splats);
|
|
47
48
|
|
|
48
49
|
renderer.setAnimationLoop(() => {
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
* Shared splat-budget governance across multiple streamed meshes.
|
|
3
3
|
*
|
|
4
4
|
* A single `StreamedSplatMesh` keeps itself within a per-device budget, but a
|
|
5
|
-
* host that shows several streamed scenes at once (a main capture plus
|
|
5
|
+
* host that shows several streamed scenes at once (a main capture plus additional
|
|
6
6
|
* or inset meshes) must not let each mesh claim the whole device budget -
|
|
7
7
|
* their pools are separate, so the costs add. Historically hosts hand-tuned
|
|
8
|
-
* this ("shrink the main mesh to 0.7 when
|
|
8
|
+
* this ("shrink the main mesh to 0.7 when additional meshes exist"); the
|
|
9
9
|
* {@link BudgetGovernor} makes it a first-class policy: register each mesh
|
|
10
10
|
* with a priority weight and the governor splits one total budget across the
|
|
11
11
|
* members, reallocating when membership, weights, or the total change.
|
|
@@ -50,7 +50,7 @@ export interface BudgetGovernorOptions {
|
|
|
50
50
|
/**
|
|
51
51
|
* Grow dead-band as a fraction of a member's current budget (default
|
|
52
52
|
* `0.1`). A reallocation that would *raise* a member's budget by no more
|
|
53
|
-
* than this fraction is skipped, so brief membership churn (
|
|
53
|
+
* than this fraction is skipped, so brief membership churn (an additional mesh
|
|
54
54
|
* appearing for a moment) does not thrash LOD schedules. Shrinks always
|
|
55
55
|
* apply immediately - that is what keeps `sum(member budgets) ≤ total` an
|
|
56
56
|
* invariant rather than a goal.
|
|
@@ -98,7 +98,7 @@ export declare class BudgetGovernor {
|
|
|
98
98
|
*
|
|
99
99
|
* @param member - The mesh (or compatible object) to govern.
|
|
100
100
|
* @param options - `weight` (default `1`): the member's share is
|
|
101
|
-
* proportional to its weight - e.g. main mesh `7`,
|
|
101
|
+
* proportional to its weight - e.g. main mesh `7`, additional mesh `3` reproduces
|
|
102
102
|
* the old 0.7 host split. `0` registers the member suspended.
|
|
103
103
|
*/
|
|
104
104
|
register(member: BudgetGovernedMember, options?: {
|
|
@@ -2,16 +2,16 @@
|
|
|
2
2
|
* Camera-driven splat-budget weighting across several streamed meshes.
|
|
3
3
|
*
|
|
4
4
|
* {@link BudgetGovernor} splits one total by *priority*, which a host must
|
|
5
|
-
* choose and maintain. That is the wrong axis for a scene of
|
|
6
|
-
* makes a
|
|
7
|
-
* every frame. Splitting a pool evenly instead (`pool / N`) gives the
|
|
8
|
-
* you fly up to a quarter of the budget it needs while three
|
|
5
|
+
* choose and maintain. That is the wrong axis for a scene of additional meshes:
|
|
6
|
+
* what makes a mesh worth splats is that the camera is near it, and that changes
|
|
7
|
+
* every frame. Splitting a pool evenly instead (`pool / N`) gives the mesh
|
|
8
|
+
* you fly up to a quarter of the budget it needs while three meshes nobody is
|
|
9
9
|
* looking at hold the rest.
|
|
10
10
|
*
|
|
11
11
|
* {@link CameraBudgetGovernor} closes that loop: each update it measures every
|
|
12
12
|
* member's projected size from the camera, multiplies in the host's priority
|
|
13
13
|
* tier, and writes the resulting weights to a `BudgetGovernor` in one batch.
|
|
14
|
-
* Approaching one of four
|
|
14
|
+
* Approaching one of four additional meshes pulls budget off the far ones automatically.
|
|
15
15
|
*
|
|
16
16
|
* This is Spark's model, reached differently. Spark shares one `lodSplatCount`
|
|
17
17
|
* and biases meshes with a per-mesh `lodScale` (focused 2, adjacent 0.25,
|
|
@@ -53,7 +53,7 @@ export interface CameraBudgetMember extends BudgetGovernedMember {
|
|
|
53
53
|
/**
|
|
54
54
|
* The visibility that actually decides whether the member's splats reach the
|
|
55
55
|
* screen, when that differs from `visible`. `SplatMesh` provides it: a
|
|
56
|
-
* `
|
|
56
|
+
* `UnifiedSplatMesh` forces `visible = false` on every source it owns
|
|
57
57
|
* (only to keep the regular scene draw from double-drawing them) while the
|
|
58
58
|
* source may be fully on screen through the unified draw - without this, the
|
|
59
59
|
* governor would suspend every unified source and freeze its streaming.
|
|
@@ -117,8 +117,8 @@ export interface CameraBudgetMemberOptions {
|
|
|
117
117
|
/**
|
|
118
118
|
* Pins this member's weight, opting it out of camera weighting while it still
|
|
119
119
|
* competes for the same total. Use it for a main scene that should hold a
|
|
120
|
-
* steady share while
|
|
121
|
-
* against
|
|
120
|
+
* steady share while additional meshes fight over the rest - e.g. `fixedWeight: 4`
|
|
121
|
+
* against extras averaging `1`.
|
|
122
122
|
*/
|
|
123
123
|
fixedWeight?: number;
|
|
124
124
|
}
|
|
@@ -129,8 +129,8 @@ export interface CameraBudgetMemberOptions {
|
|
|
129
129
|
* ```js
|
|
130
130
|
* const governor = new CameraBudgetGovernor({ totalBudget: 4_000_000 });
|
|
131
131
|
* governor.register(main, { fixedWeight: 4 }); // steady share
|
|
132
|
-
* governor.register(
|
|
133
|
-
* governor.register(
|
|
132
|
+
* governor.register(extraA); // camera-weighted, priority 1
|
|
133
|
+
* governor.register(extraB);
|
|
134
134
|
*
|
|
135
135
|
* // once per frame, after the scene graph is up to date:
|
|
136
136
|
* governor.update(camera);
|
|
@@ -142,7 +142,7 @@ export interface CameraBudgetMemberOptions {
|
|
|
142
142
|
*
|
|
143
143
|
* **A member can only grow into a budget its pool can hold.** A streamed mesh
|
|
144
144
|
* allocates its pool once, from its construction budget, and clamps `setBudget`
|
|
145
|
-
* to it - so a
|
|
145
|
+
* to it - so a mesh built at a quarter of the total can never be given more
|
|
146
146
|
* than a quarter, however close the camera gets. Construct governed meshes with
|
|
147
147
|
* `maxBudget` set to the largest share they should ever reach, and price those
|
|
148
148
|
* ceilings with `estimateSplatPoolBytes` first: the pools cost their ceilings
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
* Cross-mesh decoded-chunk cache arbitration.
|
|
3
3
|
*
|
|
4
4
|
* Every {@link StreamedSplatMesh} caps its own decoded-chunk cache, and in
|
|
5
|
-
* `foveationMode: '
|
|
6
|
-
* size)` - a number sized for *one* streamed scene. A scene of streamed
|
|
7
|
-
* therefore has no ceiling at all: thirteen
|
|
5
|
+
* `foveationMode: 'page-table'` that cap is `min(2 GiB, this capture's decoded
|
|
6
|
+
* size)` - a number sized for *one* streamed scene. A scene of streamed additional meshes
|
|
7
|
+
* therefore has no ceiling at all: thirteen extras plus a main are thirteen
|
|
8
8
|
* plus one independent caps, and because each is sized to its own capture, a
|
|
9
9
|
* desktop that fits them never evicts. The background sweep then runs to
|
|
10
10
|
* completion against every one of them, pulling every capture in the scene into
|
|
@@ -43,8 +43,8 @@ export interface ChunkCacheClient {
|
|
|
43
43
|
*
|
|
44
44
|
* Bytes above it are handed to siblings that can use them, the way
|
|
45
45
|
* `BudgetGovernor` waterfills past a member's `maxBudget`. Without it a scene
|
|
46
|
-
* of one large capture and a dozen small
|
|
47
|
-
* envelope for
|
|
46
|
+
* of one large capture and a dozen small additional meshes would reserve most of the
|
|
47
|
+
* envelope for extras that cannot fill it.
|
|
48
48
|
*/
|
|
49
49
|
readonly ceilingBytes: number;
|
|
50
50
|
/**
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Every {@link StreamedSplatMesh} owns its own `ChunkLoader` worker and issues
|
|
5
5
|
* chunk requests toward its own in-flight cap, so a scene of streamed meshes
|
|
6
|
-
* fetches with no shared ordering: a
|
|
6
|
+
* fetches with no shared ordering: a mesh the camera is pointed at competes
|
|
7
7
|
* for bandwidth and connection slots against a dozen distant ones, each of
|
|
8
8
|
* which is equally entitled to its own cap. Spark does not have this problem
|
|
9
9
|
* structurally - one global traversal orders every fetch want
|
|
@@ -81,7 +81,7 @@ export interface ChunkFetchSchedulerOptions {
|
|
|
81
81
|
* Slots every registered mesh may hold regardless of weight. Default 1.
|
|
82
82
|
*
|
|
83
83
|
* Without a floor a scene's far meshes stop fetching entirely while the
|
|
84
|
-
* focused one streams, and a
|
|
84
|
+
* focused one streams, and a mesh with no coarse coverage draws nothing -
|
|
85
85
|
* so the floor is what turns "far meshes wait" into "far meshes trickle".
|
|
86
86
|
*
|
|
87
87
|
* One slot is always granted regardless of this setting: a mesh entitled to
|
|
@@ -156,8 +156,8 @@ export declare class ChunkFetchScheduler {
|
|
|
156
156
|
* asks - which is what keeps the first mesh to reschedule from taking the
|
|
157
157
|
* pipe and holding it. Dividing the *remainder* after every participant's
|
|
158
158
|
* floor instead would invert the whole point on a large scene: thirteen
|
|
159
|
-
*
|
|
160
|
-
* focused
|
|
159
|
+
* additional meshes and a main at floor 1 consume a 16-slot pipe entirely, leaving the
|
|
160
|
+
* focused mesh a smaller share than the far ones it is competing with.
|
|
161
161
|
*
|
|
162
162
|
* The denominator counts every mesh that plausibly wants the pipe - all
|
|
163
163
|
* registered meshes except those both weightless and idle, plus the caller.
|