@rings-webgpu/core 1.0.36 → 1.0.38
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/dist/rings.es.js +203 -201
- package/dist/rings.es.js.map +3 -3
- package/dist/rings.es.max.js +1368 -77
- package/dist/rings.umd.js +219 -217
- package/dist/rings.umd.js.map +3 -3
- package/dist/rings.umd.max.js +1370 -76
- package/dist/types/components/renderer/GSplatStreamRenderer.d.ts +176 -0
- package/dist/types/index.d.ts +4 -0
- package/dist/types/loader/StreamLoader.d.ts +26 -0
- package/dist/types/loader/parser/3dgs/StreamingGaussianSplatParser.d.ts +53 -0
- package/dist/types/loader/parser/ply/PlyStreamParser.d.ts +66 -0
- package/dist/types/loader/parser/ply/index.d.ts +1 -0
- package/dist/types/materials/GSplatMaterial.d.ts +1 -0
- package/package.json +1 -1
package/dist/rings.es.max.js
CHANGED
|
@@ -2113,7 +2113,7 @@ function GetShader(name) {
|
|
|
2113
2113
|
}
|
|
2114
2114
|
|
|
2115
2115
|
var __defProp$2 = Object.defineProperty;
|
|
2116
|
-
var __decorateClass$
|
|
2116
|
+
var __decorateClass$p = (decorators, target, key, kind) => {
|
|
2117
2117
|
var result = void 0 ;
|
|
2118
2118
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
2119
2119
|
if (decorator = decorators[i])
|
|
@@ -2216,10 +2216,10 @@ const _Struct = class _Struct {
|
|
|
2216
2216
|
return struct.__size;
|
|
2217
2217
|
}
|
|
2218
2218
|
};
|
|
2219
|
-
__decorateClass$
|
|
2219
|
+
__decorateClass$p([
|
|
2220
2220
|
NonSerialize
|
|
2221
2221
|
], _Struct.prototype, "__refection");
|
|
2222
|
-
__decorateClass$
|
|
2222
|
+
__decorateClass$p([
|
|
2223
2223
|
NonSerialize
|
|
2224
2224
|
], _Struct.prototype, "__size");
|
|
2225
2225
|
let Struct = _Struct;
|
|
@@ -21965,9 +21965,9 @@ class OctreeEntity {
|
|
|
21965
21965
|
}
|
|
21966
21966
|
|
|
21967
21967
|
var __defProp$1 = Object.defineProperty;
|
|
21968
|
-
var __getOwnPropDesc$
|
|
21969
|
-
var __decorateClass$
|
|
21970
|
-
var result = __getOwnPropDesc$
|
|
21968
|
+
var __getOwnPropDesc$o = Object.getOwnPropertyDescriptor;
|
|
21969
|
+
var __decorateClass$o = (decorators, target, key, kind) => {
|
|
21970
|
+
var result = __getOwnPropDesc$o(target, key) ;
|
|
21971
21971
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
21972
21972
|
if (decorator = decorators[i])
|
|
21973
21973
|
result = (decorator(target, key, result) ) || result;
|
|
@@ -22565,13 +22565,13 @@ class RenderNode extends ComponentBase {
|
|
|
22565
22565
|
this._combineShaderRefection = void 0;
|
|
22566
22566
|
}
|
|
22567
22567
|
}
|
|
22568
|
-
__decorateClass$
|
|
22568
|
+
__decorateClass$o([
|
|
22569
22569
|
EditorInspector
|
|
22570
22570
|
], RenderNode.prototype, "materials");
|
|
22571
|
-
__decorateClass$
|
|
22571
|
+
__decorateClass$o([
|
|
22572
22572
|
EditorInspector
|
|
22573
22573
|
], RenderNode.prototype, "castShadow");
|
|
22574
|
-
__decorateClass$
|
|
22574
|
+
__decorateClass$o([
|
|
22575
22575
|
EditorInspector
|
|
22576
22576
|
], RenderNode.prototype, "castGI");
|
|
22577
22577
|
|
|
@@ -23238,9 +23238,9 @@ class Shader {
|
|
|
23238
23238
|
}
|
|
23239
23239
|
}
|
|
23240
23240
|
|
|
23241
|
-
var __getOwnPropDesc$
|
|
23242
|
-
var __decorateClass$
|
|
23243
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
23241
|
+
var __getOwnPropDesc$n = Object.getOwnPropertyDescriptor;
|
|
23242
|
+
var __decorateClass$n = (decorators, target, key, kind) => {
|
|
23243
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$n(target, key) : target;
|
|
23244
23244
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
23245
23245
|
if (decorator = decorators[i])
|
|
23246
23246
|
result = (decorator(result)) || result;
|
|
@@ -23272,7 +23272,7 @@ let GSplatShader = class extends Shader {
|
|
|
23272
23272
|
pass.setUniform("pixelCull", new Float32Array([2, 0, 0, 0]));
|
|
23273
23273
|
}
|
|
23274
23274
|
};
|
|
23275
|
-
GSplatShader = __decorateClass$
|
|
23275
|
+
GSplatShader = __decorateClass$n([
|
|
23276
23276
|
RegisterShader(GSplatShader, "GSplatShader")
|
|
23277
23277
|
], GSplatShader);
|
|
23278
23278
|
|
|
@@ -23316,6 +23316,10 @@ class GSplatMaterial extends Material {
|
|
|
23316
23316
|
const pass = this.shader.getDefaultColorShader();
|
|
23317
23317
|
pass.setUniform("pixelCull", this._pixelCullArray);
|
|
23318
23318
|
}
|
|
23319
|
+
setTexParams(texParams) {
|
|
23320
|
+
const pass = this.shader.getDefaultColorShader();
|
|
23321
|
+
pass.setUniformArray("tex_params", texParams);
|
|
23322
|
+
}
|
|
23319
23323
|
}
|
|
23320
23324
|
|
|
23321
23325
|
class VertexGPUBuffer extends GPUBufferBase {
|
|
@@ -24289,9 +24293,9 @@ class Float16ArrayTexture extends Texture {
|
|
|
24289
24293
|
}
|
|
24290
24294
|
}
|
|
24291
24295
|
|
|
24292
|
-
var __getOwnPropDesc$
|
|
24293
|
-
var __decorateClass$
|
|
24294
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
24296
|
+
var __getOwnPropDesc$m = Object.getOwnPropertyDescriptor;
|
|
24297
|
+
var __decorateClass$m = (decorators, target, key, kind) => {
|
|
24298
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$m(target, key) : target;
|
|
24295
24299
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
24296
24300
|
if (decorator = decorators[i])
|
|
24297
24301
|
result = (decorator(result)) || result;
|
|
@@ -25090,7 +25094,7 @@ let GSplatRenderer = class extends RenderNode {
|
|
|
25090
25094
|
super.destroy(force);
|
|
25091
25095
|
}
|
|
25092
25096
|
};
|
|
25093
|
-
GSplatRenderer = __decorateClass$
|
|
25097
|
+
GSplatRenderer = __decorateClass$m([
|
|
25094
25098
|
RegisterComponent(GSplatRenderer, "GSplatRenderer")
|
|
25095
25099
|
], GSplatRenderer);
|
|
25096
25100
|
|
|
@@ -25229,9 +25233,9 @@ const PointCloud_FS = (
|
|
|
25229
25233
|
`
|
|
25230
25234
|
);
|
|
25231
25235
|
|
|
25232
|
-
var __getOwnPropDesc$
|
|
25233
|
-
var __decorateClass$
|
|
25234
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
25236
|
+
var __getOwnPropDesc$l = Object.getOwnPropertyDescriptor;
|
|
25237
|
+
var __decorateClass$l = (decorators, target, key, kind) => {
|
|
25238
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$l(target, key) : target;
|
|
25235
25239
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
25236
25240
|
if (decorator = decorators[i])
|
|
25237
25241
|
result = (decorator(result)) || result;
|
|
@@ -25263,7 +25267,7 @@ let PointCloudShader = class extends Shader {
|
|
|
25263
25267
|
pass.setUniformArray("pointParams", new Float32Array([0, 0, 0, 128]));
|
|
25264
25268
|
}
|
|
25265
25269
|
};
|
|
25266
|
-
PointCloudShader = __decorateClass$
|
|
25270
|
+
PointCloudShader = __decorateClass$l([
|
|
25267
25271
|
RegisterShader(PointCloudShader, "PointCloudShader")
|
|
25268
25272
|
], PointCloudShader);
|
|
25269
25273
|
|
|
@@ -25456,9 +25460,9 @@ class Float32ArrayTexture extends Texture {
|
|
|
25456
25460
|
}
|
|
25457
25461
|
}
|
|
25458
25462
|
|
|
25459
|
-
var __getOwnPropDesc$
|
|
25460
|
-
var __decorateClass$
|
|
25461
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
25463
|
+
var __getOwnPropDesc$k = Object.getOwnPropertyDescriptor;
|
|
25464
|
+
var __decorateClass$k = (decorators, target, key, kind) => {
|
|
25465
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$k(target, key) : target;
|
|
25462
25466
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
25463
25467
|
if (decorator = decorators[i])
|
|
25464
25468
|
result = (decorator(result)) || result;
|
|
@@ -25769,7 +25773,7 @@ let PointCloudRenderer = class extends RenderNode {
|
|
|
25769
25773
|
super.destroy(force);
|
|
25770
25774
|
}
|
|
25771
25775
|
};
|
|
25772
|
-
PointCloudRenderer = __decorateClass$
|
|
25776
|
+
PointCloudRenderer = __decorateClass$k([
|
|
25773
25777
|
RegisterComponent(PointCloudRenderer, "PointCloudRenderer")
|
|
25774
25778
|
], PointCloudRenderer);
|
|
25775
25779
|
|
|
@@ -26124,9 +26128,9 @@ class Entity extends CEventDispatcher {
|
|
|
26124
26128
|
}
|
|
26125
26129
|
}
|
|
26126
26130
|
|
|
26127
|
-
var __getOwnPropDesc$
|
|
26128
|
-
var __decorateClass$
|
|
26129
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
26131
|
+
var __getOwnPropDesc$j = Object.getOwnPropertyDescriptor;
|
|
26132
|
+
var __decorateClass$j = (decorators, target, key, kind) => {
|
|
26133
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$j(target, key) : target;
|
|
26130
26134
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
26131
26135
|
if (decorator = decorators[i])
|
|
26132
26136
|
result = (decorator(result)) || result;
|
|
@@ -26401,7 +26405,7 @@ let Object3D = class extends Entity {
|
|
|
26401
26405
|
super.destroy(force);
|
|
26402
26406
|
}
|
|
26403
26407
|
};
|
|
26404
|
-
Object3D = __decorateClass$
|
|
26408
|
+
Object3D = __decorateClass$j([
|
|
26405
26409
|
DecorateObject3D
|
|
26406
26410
|
], Object3D);
|
|
26407
26411
|
function DecorateObject3D(ctor, _) {
|
|
@@ -27767,9 +27771,9 @@ class MorphTargetData {
|
|
|
27767
27771
|
}
|
|
27768
27772
|
|
|
27769
27773
|
var __defProp = Object.defineProperty;
|
|
27770
|
-
var __getOwnPropDesc$
|
|
27771
|
-
var __decorateClass$
|
|
27772
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
27774
|
+
var __getOwnPropDesc$i = Object.getOwnPropertyDescriptor;
|
|
27775
|
+
var __decorateClass$i = (decorators, target, key, kind) => {
|
|
27776
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$i(target, key) : target;
|
|
27773
27777
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
27774
27778
|
if (decorator = decorators[i])
|
|
27775
27779
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
@@ -27882,13 +27886,13 @@ let MeshRenderer = class extends RenderNode {
|
|
|
27882
27886
|
super.destroy(force);
|
|
27883
27887
|
}
|
|
27884
27888
|
};
|
|
27885
|
-
__decorateClass$
|
|
27889
|
+
__decorateClass$i([
|
|
27886
27890
|
EditorInspector
|
|
27887
27891
|
], MeshRenderer.prototype, "geometry", 1);
|
|
27888
|
-
__decorateClass$
|
|
27892
|
+
__decorateClass$i([
|
|
27889
27893
|
EditorInspector
|
|
27890
27894
|
], MeshRenderer.prototype, "material", 1);
|
|
27891
|
-
MeshRenderer = __decorateClass$
|
|
27895
|
+
MeshRenderer = __decorateClass$i([
|
|
27892
27896
|
RegisterComponent(MeshRenderer, "MeshRenderer")
|
|
27893
27897
|
], MeshRenderer);
|
|
27894
27898
|
|
|
@@ -28494,9 +28498,9 @@ class PlaneGeometry extends GeometryBase {
|
|
|
28494
28498
|
}
|
|
28495
28499
|
}
|
|
28496
28500
|
|
|
28497
|
-
var __getOwnPropDesc$
|
|
28498
|
-
var __decorateClass$
|
|
28499
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
28501
|
+
var __getOwnPropDesc$h = Object.getOwnPropertyDescriptor;
|
|
28502
|
+
var __decorateClass$h = (decorators, target, key, kind) => {
|
|
28503
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$h(target, key) : target;
|
|
28500
28504
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
28501
28505
|
if (decorator = decorators[i])
|
|
28502
28506
|
result = (decorator(result)) || result;
|
|
@@ -28520,7 +28524,7 @@ let QuadShader = class extends Shader {
|
|
|
28520
28524
|
this.setUniformFloat(`height`, 100);
|
|
28521
28525
|
}
|
|
28522
28526
|
};
|
|
28523
|
-
QuadShader = __decorateClass$
|
|
28527
|
+
QuadShader = __decorateClass$h([
|
|
28524
28528
|
RegisterShader(QuadShader, "QuadShader")
|
|
28525
28529
|
], QuadShader);
|
|
28526
28530
|
|
|
@@ -35883,9 +35887,9 @@ class LightBase extends ComponentBase {
|
|
|
35883
35887
|
}
|
|
35884
35888
|
}
|
|
35885
35889
|
|
|
35886
|
-
var __getOwnPropDesc$
|
|
35887
|
-
var __decorateClass$
|
|
35888
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
35890
|
+
var __getOwnPropDesc$g = Object.getOwnPropertyDescriptor;
|
|
35891
|
+
var __decorateClass$g = (decorators, target, key, kind) => {
|
|
35892
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$g(target, key) : target;
|
|
35889
35893
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
35890
35894
|
if (decorator = decorators[i])
|
|
35891
35895
|
result = (decorator(result)) || result;
|
|
@@ -35927,13 +35931,13 @@ let DirectLight = class extends LightBase {
|
|
|
35927
35931
|
debug() {
|
|
35928
35932
|
}
|
|
35929
35933
|
};
|
|
35930
|
-
DirectLight = __decorateClass$
|
|
35934
|
+
DirectLight = __decorateClass$g([
|
|
35931
35935
|
RegisterComponent(DirectLight, "DirectLight")
|
|
35932
35936
|
], DirectLight);
|
|
35933
35937
|
|
|
35934
|
-
var __getOwnPropDesc$
|
|
35935
|
-
var __decorateClass$
|
|
35936
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
35938
|
+
var __getOwnPropDesc$f = Object.getOwnPropertyDescriptor;
|
|
35939
|
+
var __decorateClass$f = (decorators, target, key, kind) => {
|
|
35940
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$f(target, key) : target;
|
|
35937
35941
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
35938
35942
|
if (decorator = decorators[i])
|
|
35939
35943
|
result = (decorator(result)) || result;
|
|
@@ -35991,13 +35995,13 @@ let PointLight = class extends LightBase {
|
|
|
35991
35995
|
debugDraw(show) {
|
|
35992
35996
|
}
|
|
35993
35997
|
};
|
|
35994
|
-
PointLight = __decorateClass$
|
|
35998
|
+
PointLight = __decorateClass$f([
|
|
35995
35999
|
RegisterComponent(PointLight, "PointLight")
|
|
35996
36000
|
], PointLight);
|
|
35997
36001
|
|
|
35998
|
-
var __getOwnPropDesc$
|
|
35999
|
-
var __decorateClass$
|
|
36000
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
36002
|
+
var __getOwnPropDesc$e = Object.getOwnPropertyDescriptor;
|
|
36003
|
+
var __decorateClass$e = (decorators, target, key, kind) => {
|
|
36004
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$e(target, key) : target;
|
|
36001
36005
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
36002
36006
|
if (decorator = decorators[i])
|
|
36003
36007
|
result = (decorator(result)) || result;
|
|
@@ -36062,7 +36066,7 @@ let SpotLight = class extends LightBase {
|
|
|
36062
36066
|
debugDraw(show) {
|
|
36063
36067
|
}
|
|
36064
36068
|
};
|
|
36065
|
-
SpotLight = __decorateClass$
|
|
36069
|
+
SpotLight = __decorateClass$e([
|
|
36066
36070
|
RegisterComponent(SpotLight, "SpotLight")
|
|
36067
36071
|
], SpotLight);
|
|
36068
36072
|
|
|
@@ -42147,7 +42151,7 @@ class PostProcessingComponent extends ComponentBase {
|
|
|
42147
42151
|
}
|
|
42148
42152
|
}
|
|
42149
42153
|
|
|
42150
|
-
const version = "1.0.
|
|
42154
|
+
const version = "1.0.36";
|
|
42151
42155
|
|
|
42152
42156
|
class Engine3D {
|
|
42153
42157
|
/**
|
|
@@ -46660,9 +46664,9 @@ class AtmosphericTexture2D extends VirtualTexture {
|
|
|
46660
46664
|
}
|
|
46661
46665
|
}
|
|
46662
46666
|
|
|
46663
|
-
var __getOwnPropDesc$
|
|
46664
|
-
var __decorateClass$
|
|
46665
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
46667
|
+
var __getOwnPropDesc$d = Object.getOwnPropertyDescriptor;
|
|
46668
|
+
var __decorateClass$d = (decorators, target, key, kind) => {
|
|
46669
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$d(target, key) : target;
|
|
46666
46670
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
46667
46671
|
if (decorator = decorators[i])
|
|
46668
46672
|
result = (decorator(result)) || result;
|
|
@@ -46686,7 +46690,7 @@ let SkyShader = class extends Shader {
|
|
|
46686
46690
|
shaderState.depthCompare = GPUCompareFunction.less;
|
|
46687
46691
|
}
|
|
46688
46692
|
};
|
|
46689
|
-
SkyShader = __decorateClass$
|
|
46693
|
+
SkyShader = __decorateClass$d([
|
|
46690
46694
|
RegisterShader(SkyShader, "SkyShader")
|
|
46691
46695
|
], SkyShader);
|
|
46692
46696
|
|
|
@@ -47484,9 +47488,9 @@ class SkeletonAnimationClipState {
|
|
|
47484
47488
|
}
|
|
47485
47489
|
}
|
|
47486
47490
|
|
|
47487
|
-
var __getOwnPropDesc$
|
|
47488
|
-
var __decorateClass$
|
|
47489
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
47491
|
+
var __getOwnPropDesc$c = Object.getOwnPropertyDescriptor;
|
|
47492
|
+
var __decorateClass$c = (decorators, target, key, kind) => {
|
|
47493
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$c(target, key) : target;
|
|
47490
47494
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
47491
47495
|
if (decorator = decorators[i])
|
|
47492
47496
|
result = (decorator(result)) || result;
|
|
@@ -47690,7 +47694,7 @@ let SkeletonAnimationComponent = class extends ComponentBase {
|
|
|
47690
47694
|
this._currentClipState.weight = 1;
|
|
47691
47695
|
}
|
|
47692
47696
|
};
|
|
47693
|
-
SkeletonAnimationComponent = __decorateClass$
|
|
47697
|
+
SkeletonAnimationComponent = __decorateClass$c([
|
|
47694
47698
|
RegisterComponent(SkeletonAnimationComponent, "SkeletonAnimationComponent")
|
|
47695
47699
|
], SkeletonAnimationComponent);
|
|
47696
47700
|
class SkeletonAnimationCrossFadeState {
|
|
@@ -47726,9 +47730,9 @@ class SkeletonAnimationCrossFadeState {
|
|
|
47726
47730
|
}
|
|
47727
47731
|
}
|
|
47728
47732
|
|
|
47729
|
-
var __getOwnPropDesc$
|
|
47730
|
-
var __decorateClass$
|
|
47731
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
47733
|
+
var __getOwnPropDesc$b = Object.getOwnPropertyDescriptor;
|
|
47734
|
+
var __decorateClass$b = (decorators, target, key, kind) => {
|
|
47735
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$b(target, key) : target;
|
|
47732
47736
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
47733
47737
|
if (decorator = decorators[i])
|
|
47734
47738
|
result = (decorator(result)) || result;
|
|
@@ -48139,7 +48143,7 @@ let AnimatorComponent = class extends ComponentBase {
|
|
|
48139
48143
|
return dst;
|
|
48140
48144
|
}
|
|
48141
48145
|
};
|
|
48142
|
-
AnimatorComponent = __decorateClass$
|
|
48146
|
+
AnimatorComponent = __decorateClass$b([
|
|
48143
48147
|
RegisterComponent(AnimatorComponent, "AnimatorComponent")
|
|
48144
48148
|
], AnimatorComponent);
|
|
48145
48149
|
class PropertyAnimationClipState {
|
|
@@ -48896,9 +48900,9 @@ class PropertyAnimation extends ComponentBase {
|
|
|
48896
48900
|
}
|
|
48897
48901
|
}
|
|
48898
48902
|
|
|
48899
|
-
var __getOwnPropDesc$
|
|
48900
|
-
var __decorateClass$
|
|
48901
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
48903
|
+
var __getOwnPropDesc$a = Object.getOwnPropertyDescriptor;
|
|
48904
|
+
var __decorateClass$a = (decorators, target, key, kind) => {
|
|
48905
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$a(target, key) : target;
|
|
48902
48906
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
48903
48907
|
if (decorator = decorators[i])
|
|
48904
48908
|
result = (decorator(result)) || result;
|
|
@@ -49047,7 +49051,7 @@ let SkinnedMeshRenderer2 = class extends MeshRenderer {
|
|
|
49047
49051
|
super.nodeUpdate(view, passType, renderPassState, clusterLightingBuffer);
|
|
49048
49052
|
}
|
|
49049
49053
|
};
|
|
49050
|
-
SkinnedMeshRenderer2 = __decorateClass$
|
|
49054
|
+
SkinnedMeshRenderer2 = __decorateClass$a([
|
|
49051
49055
|
RegisterComponent(SkinnedMeshRenderer2, "SkinnedMeshRenderer2")
|
|
49052
49056
|
], SkinnedMeshRenderer2);
|
|
49053
49057
|
|
|
@@ -54180,9 +54184,9 @@ class UITextField extends UIRenderAble {
|
|
|
54180
54184
|
}
|
|
54181
54185
|
}
|
|
54182
54186
|
|
|
54183
|
-
var __getOwnPropDesc$
|
|
54184
|
-
var __decorateClass$
|
|
54185
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
54187
|
+
var __getOwnPropDesc$9 = Object.getOwnPropertyDescriptor;
|
|
54188
|
+
var __decorateClass$9 = (decorators, target, key, kind) => {
|
|
54189
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$9(target, key) : target;
|
|
54186
54190
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
54187
54191
|
if (decorator = decorators[i])
|
|
54188
54192
|
result = (decorator(result)) || result;
|
|
@@ -54259,13 +54263,13 @@ let Light = class extends LightBase {
|
|
|
54259
54263
|
debugDraw(show) {
|
|
54260
54264
|
}
|
|
54261
54265
|
};
|
|
54262
|
-
Light = __decorateClass$
|
|
54266
|
+
Light = __decorateClass$9([
|
|
54263
54267
|
RegisterComponent(Light, "Light")
|
|
54264
54268
|
], Light);
|
|
54265
54269
|
|
|
54266
|
-
var __getOwnPropDesc$
|
|
54267
|
-
var __decorateClass$
|
|
54268
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
54270
|
+
var __getOwnPropDesc$8 = Object.getOwnPropertyDescriptor;
|
|
54271
|
+
var __decorateClass$8 = (decorators, target, key, kind) => {
|
|
54272
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$8(target, key) : target;
|
|
54269
54273
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
54270
54274
|
if (decorator = decorators[i])
|
|
54271
54275
|
result = (decorator(result)) || result;
|
|
@@ -54340,10 +54344,779 @@ let FatLineRenderer = class extends RenderNode {
|
|
|
54340
54344
|
super.destroy(force);
|
|
54341
54345
|
}
|
|
54342
54346
|
};
|
|
54343
|
-
FatLineRenderer = __decorateClass$
|
|
54347
|
+
FatLineRenderer = __decorateClass$8([
|
|
54344
54348
|
RegisterComponent(FatLineRenderer, "FatLineRenderer")
|
|
54345
54349
|
], FatLineRenderer);
|
|
54346
54350
|
|
|
54351
|
+
var __getOwnPropDesc$7 = Object.getOwnPropertyDescriptor;
|
|
54352
|
+
var __decorateClass$7 = (decorators, target, key, kind) => {
|
|
54353
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$7(target, key) : target;
|
|
54354
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
54355
|
+
if (decorator = decorators[i])
|
|
54356
|
+
result = (decorator(result)) || result;
|
|
54357
|
+
return result;
|
|
54358
|
+
};
|
|
54359
|
+
let GSplatStreamRenderer = class extends RenderNode {
|
|
54360
|
+
// Splat count and texture dimensions
|
|
54361
|
+
totalCount = 0;
|
|
54362
|
+
size = new Vector2();
|
|
54363
|
+
localBoundBox = new BoundingBox();
|
|
54364
|
+
// public worldBoundBox: BoundingBox = new BoundingBox();
|
|
54365
|
+
get worldBoundBox() {
|
|
54366
|
+
const boundBox = new BoundingBox();
|
|
54367
|
+
boundBox.makeEmpty();
|
|
54368
|
+
const worldMatrix = this.object3D.transform.worldMatrix;
|
|
54369
|
+
const m = worldMatrix.rawData;
|
|
54370
|
+
const localMin = this.localBoundBox.min;
|
|
54371
|
+
const localMax = this.localBoundBox.max;
|
|
54372
|
+
const corners = [
|
|
54373
|
+
[localMin.x, localMin.y, localMin.z],
|
|
54374
|
+
// 0: min, min, min
|
|
54375
|
+
[localMax.x, localMin.y, localMin.z],
|
|
54376
|
+
// 1: max, min, min
|
|
54377
|
+
[localMin.x, localMax.y, localMin.z],
|
|
54378
|
+
// 2: min, max, min
|
|
54379
|
+
[localMax.x, localMax.y, localMin.z],
|
|
54380
|
+
// 3: max, max, min
|
|
54381
|
+
[localMin.x, localMin.y, localMax.z],
|
|
54382
|
+
// 4: min, min, max
|
|
54383
|
+
[localMax.x, localMin.y, localMax.z],
|
|
54384
|
+
// 5: max, min, max
|
|
54385
|
+
[localMin.x, localMax.y, localMax.z],
|
|
54386
|
+
// 6: min, max, max
|
|
54387
|
+
[localMax.x, localMax.y, localMax.z]
|
|
54388
|
+
// 7: max, max, max
|
|
54389
|
+
];
|
|
54390
|
+
for (const [x, y, z] of corners) {
|
|
54391
|
+
const wx = m[0] * x + m[4] * y + m[8] * z + m[12];
|
|
54392
|
+
const wy = m[1] * x + m[5] * y + m[9] * z + m[13];
|
|
54393
|
+
const wz = m[2] * x + m[6] * y + m[10] * z + m[14];
|
|
54394
|
+
boundBox.expandByPoint(new Vector3(wx, wy, wz));
|
|
54395
|
+
}
|
|
54396
|
+
return boundBox;
|
|
54397
|
+
}
|
|
54398
|
+
// GPU textures for splat data
|
|
54399
|
+
splatColor;
|
|
54400
|
+
transformA;
|
|
54401
|
+
transformB;
|
|
54402
|
+
texParams;
|
|
54403
|
+
// [numSplats, texWidth, validCount, visBoost]
|
|
54404
|
+
splatOrder;
|
|
54405
|
+
// Material and geometry
|
|
54406
|
+
gsplatMaterial;
|
|
54407
|
+
// CPU-side data buffers (pre-allocated)
|
|
54408
|
+
_colorData;
|
|
54409
|
+
// RGBA8: count * 4
|
|
54410
|
+
_transformAData;
|
|
54411
|
+
// RGBA32U: count * 4
|
|
54412
|
+
_transformBData;
|
|
54413
|
+
// RGBA16F: count * 4
|
|
54414
|
+
_orderData;
|
|
54415
|
+
// R32U: size.x * size.y
|
|
54416
|
+
_positions;
|
|
54417
|
+
// xyz per splat (local space)
|
|
54418
|
+
// private _worldPositions: Float32Array; // xyz per splat (world space, cached)
|
|
54419
|
+
// Tracking which splats have been set
|
|
54420
|
+
_splatSetFlags;
|
|
54421
|
+
// Track which indices have data
|
|
54422
|
+
_validCount = 0;
|
|
54423
|
+
// Number of splats with valid data
|
|
54424
|
+
// Web Worker for sorting (same as GSplatRenderer)
|
|
54425
|
+
_sortWorker;
|
|
54426
|
+
_lastSentTime = 0;
|
|
54427
|
+
_minIntervalMs = 16;
|
|
54428
|
+
_centersSent = false;
|
|
54429
|
+
_lastViewMatrixHash = 0;
|
|
54430
|
+
// Adaptive sorting optimization
|
|
54431
|
+
_lastCameraSpeed = 0;
|
|
54432
|
+
_adaptiveSorting = true;
|
|
54433
|
+
_lastPixelCullParams = "";
|
|
54434
|
+
_texturesInitialized = false;
|
|
54435
|
+
// Pixel coverage culling
|
|
54436
|
+
_minPixelCoverage = 4;
|
|
54437
|
+
_maxPixelCoverage = 0;
|
|
54438
|
+
_maxPixelCullDistance = 0;
|
|
54439
|
+
// Batched rendering
|
|
54440
|
+
_batchSize = 128;
|
|
54441
|
+
instanceCount = 0;
|
|
54442
|
+
// Batch update optimization
|
|
54443
|
+
_pendingUpdates = /* @__PURE__ */ new Set();
|
|
54444
|
+
// Indices pending GPU update
|
|
54445
|
+
_autoFlushThreshold = 100;
|
|
54446
|
+
// Auto-flush when this many updates pending
|
|
54447
|
+
_frameCount = 0;
|
|
54448
|
+
constructor() {
|
|
54449
|
+
super();
|
|
54450
|
+
}
|
|
54451
|
+
/**
|
|
54452
|
+
* Initialize renderer with total splat count
|
|
54453
|
+
* Pre-allocates all GPU resources with zero-initialized data
|
|
54454
|
+
* @param totalCount Total number of splats that will be streamed
|
|
54455
|
+
* @param batchSize Splats per draw call (default: 128)
|
|
54456
|
+
*/
|
|
54457
|
+
initCount(totalCount, batchSize = 128) {
|
|
54458
|
+
if (totalCount <= 0) {
|
|
54459
|
+
throw new Error("Total count must be greater than 0");
|
|
54460
|
+
}
|
|
54461
|
+
this.totalCount = totalCount;
|
|
54462
|
+
this._batchSize = batchSize;
|
|
54463
|
+
this.size = this.evalTextureSize(totalCount);
|
|
54464
|
+
const w = this.size.x | 0;
|
|
54465
|
+
const h = this.size.y | 0;
|
|
54466
|
+
const total = w * h;
|
|
54467
|
+
this._colorData = new Uint8Array(total * 4);
|
|
54468
|
+
this._colorData.fill(0);
|
|
54469
|
+
this._transformAData = new Uint32Array(total * 4);
|
|
54470
|
+
this._transformAData.fill(0);
|
|
54471
|
+
this._transformBData = new Array(total * 4).fill(0);
|
|
54472
|
+
this._orderData = new Uint32Array(total);
|
|
54473
|
+
for (let i = 0; i < total; i++) {
|
|
54474
|
+
this._orderData[i] = i < totalCount ? i : totalCount > 0 ? totalCount - 1 : 0;
|
|
54475
|
+
}
|
|
54476
|
+
this._positions = new Float32Array(totalCount * 3);
|
|
54477
|
+
this._positions.fill(0);
|
|
54478
|
+
this.localBoundBox.makeEmpty();
|
|
54479
|
+
this._splatSetFlags = new Array(totalCount).fill(false);
|
|
54480
|
+
this._validCount = 0;
|
|
54481
|
+
this.texParams = new Float32Array([this._validCount, this.size.x, 0, 1]);
|
|
54482
|
+
this.splatColor = new Uint8ArrayTexture().create(w, h, this._colorData, false);
|
|
54483
|
+
this.splatColor.name = "splatColor";
|
|
54484
|
+
this.splatColor.minFilter = "nearest";
|
|
54485
|
+
this.splatColor.magFilter = "nearest";
|
|
54486
|
+
this.splatColor.mipmapFilter = "nearest";
|
|
54487
|
+
this.splatColor.addressModeU = "clamp-to-edge";
|
|
54488
|
+
this.splatColor.addressModeV = "clamp-to-edge";
|
|
54489
|
+
this.transformA = new Uint32ArrayTexture().create(w, h, this._transformAData);
|
|
54490
|
+
this.transformA.name = "transformA";
|
|
54491
|
+
this.transformA.minFilter = "nearest";
|
|
54492
|
+
this.transformA.magFilter = "nearest";
|
|
54493
|
+
this.transformA.addressModeU = "clamp-to-edge";
|
|
54494
|
+
this.transformA.addressModeV = "clamp-to-edge";
|
|
54495
|
+
this.transformB = new Float16ArrayTexture().create(w, h, this._transformBData, false);
|
|
54496
|
+
this.transformB.name = "transformB";
|
|
54497
|
+
this.transformB.minFilter = "nearest";
|
|
54498
|
+
this.transformB.magFilter = "nearest";
|
|
54499
|
+
this.transformB.mipmapFilter = "nearest";
|
|
54500
|
+
this.transformB.addressModeU = "clamp-to-edge";
|
|
54501
|
+
this.transformB.addressModeV = "clamp-to-edge";
|
|
54502
|
+
this.splatOrder = new R32UintTexture().create(w, h, this._orderData);
|
|
54503
|
+
this.splatOrder.name = "splatOrder";
|
|
54504
|
+
this.splatOrder.minFilter = "nearest";
|
|
54505
|
+
this.splatOrder.magFilter = "nearest";
|
|
54506
|
+
this.splatOrder.addressModeU = "clamp-to-edge";
|
|
54507
|
+
this.splatOrder.addressModeV = "clamp-to-edge";
|
|
54508
|
+
this.gsplatMaterial = new GSplatMaterial();
|
|
54509
|
+
this.geometry = new GSplatGeometry(this._batchSize);
|
|
54510
|
+
this.materials = [this.gsplatMaterial];
|
|
54511
|
+
this.instanceCount = 0;
|
|
54512
|
+
}
|
|
54513
|
+
/**
|
|
54514
|
+
* Set data for a single splat at the given index
|
|
54515
|
+
* Updates CPU buffers and marks for GPU update
|
|
54516
|
+
* @param index Splat index (0 to count-1)
|
|
54517
|
+
* @param data Splat data (position is required, others optional)
|
|
54518
|
+
*/
|
|
54519
|
+
setSplatData(index, data) {
|
|
54520
|
+
if (index < 0 || index >= this.totalCount) {
|
|
54521
|
+
throw new Error(`Index ${index} out of range [0, ${this.totalCount})`);
|
|
54522
|
+
}
|
|
54523
|
+
const wasSet = this._splatSetFlags[index];
|
|
54524
|
+
this._positions[index * 3 + 0] = data.position[0];
|
|
54525
|
+
this._positions[index * 3 + 1] = data.position[1];
|
|
54526
|
+
this._positions[index * 3 + 2] = data.position[2];
|
|
54527
|
+
this.localBoundBox.expandByPoint(new Vector3(data.position[0], data.position[1], data.position[2]));
|
|
54528
|
+
const SH_C0 = 0.28209479177387814;
|
|
54529
|
+
let r = 0.5, g = 0.5, b = 0.5;
|
|
54530
|
+
if (data.sh && data.sh.coeffs && data.sh.coeffs.length >= 3) {
|
|
54531
|
+
r = 0.5 + data.sh.coeffs[0] * SH_C0;
|
|
54532
|
+
g = 0.5 + data.sh.coeffs[1] * SH_C0;
|
|
54533
|
+
b = 0.5 + data.sh.coeffs[2] * SH_C0;
|
|
54534
|
+
}
|
|
54535
|
+
const a = data.opacity !== void 0 ? 1 / (1 + Math.exp(-data.opacity)) : 1;
|
|
54536
|
+
const colorIdx = index * 4;
|
|
54537
|
+
this._colorData[colorIdx + 0] = Math.max(0, Math.min(255, Math.floor(r * 255)));
|
|
54538
|
+
this._colorData[colorIdx + 1] = Math.max(0, Math.min(255, Math.floor(g * 255)));
|
|
54539
|
+
this._colorData[colorIdx + 2] = Math.max(0, Math.min(255, Math.floor(b * 255)));
|
|
54540
|
+
this._colorData[colorIdx + 3] = Math.max(0, Math.min(255, Math.floor(a * 255)));
|
|
54541
|
+
this.updateTransformData(index, data);
|
|
54542
|
+
if (!wasSet) {
|
|
54543
|
+
this._splatSetFlags[index] = true;
|
|
54544
|
+
this._validCount++;
|
|
54545
|
+
this.texParams[2] = this._validCount;
|
|
54546
|
+
}
|
|
54547
|
+
this._pendingUpdates.add(index);
|
|
54548
|
+
}
|
|
54549
|
+
/**
|
|
54550
|
+
* Update transform data for a single splat
|
|
54551
|
+
*/
|
|
54552
|
+
updateTransformData(index, data) {
|
|
54553
|
+
const idx = index * 4;
|
|
54554
|
+
const fb = new ArrayBuffer(4);
|
|
54555
|
+
const f32 = new Float32Array(fb);
|
|
54556
|
+
const u32 = new Uint32Array(fb);
|
|
54557
|
+
const setFloatBits = (v) => {
|
|
54558
|
+
f32[0] = v;
|
|
54559
|
+
return u32[0];
|
|
54560
|
+
};
|
|
54561
|
+
const x = data.position[0];
|
|
54562
|
+
const y = data.position[1];
|
|
54563
|
+
const z = data.position[2];
|
|
54564
|
+
this._transformAData[idx + 0] = setFloatBits(x);
|
|
54565
|
+
this._transformAData[idx + 1] = setFloatBits(y);
|
|
54566
|
+
this._transformAData[idx + 2] = setFloatBits(z);
|
|
54567
|
+
let qx = 0, qy = 0, qz = 0, qw = 1;
|
|
54568
|
+
if (data.rotation) {
|
|
54569
|
+
qx = data.rotation[0];
|
|
54570
|
+
qy = data.rotation[1];
|
|
54571
|
+
qz = data.rotation[2];
|
|
54572
|
+
qw = data.rotation[3];
|
|
54573
|
+
const inv = 1 / Math.hypot(qx, qy, qz, qw);
|
|
54574
|
+
qx *= inv;
|
|
54575
|
+
qy *= inv;
|
|
54576
|
+
qz *= inv;
|
|
54577
|
+
qw *= inv;
|
|
54578
|
+
}
|
|
54579
|
+
let sx = 1, sy = 1, sz = 1;
|
|
54580
|
+
if (data.scale) {
|
|
54581
|
+
sx = Math.exp(data.scale[0]);
|
|
54582
|
+
sy = Math.exp(data.scale[1]);
|
|
54583
|
+
sz = Math.exp(data.scale[2]);
|
|
54584
|
+
}
|
|
54585
|
+
const x2 = qx + qx;
|
|
54586
|
+
const y2 = qy + qy;
|
|
54587
|
+
const z2 = qz + qz;
|
|
54588
|
+
const xx = qx * x2;
|
|
54589
|
+
const xy = qx * y2;
|
|
54590
|
+
const xz = qx * z2;
|
|
54591
|
+
const yy = qy * y2;
|
|
54592
|
+
const yz = qy * z2;
|
|
54593
|
+
const zz = qz * z2;
|
|
54594
|
+
const wx = qw * x2;
|
|
54595
|
+
const wy = qw * y2;
|
|
54596
|
+
const wz = qw * z2;
|
|
54597
|
+
const data0 = 1 - (yy + zz);
|
|
54598
|
+
const data1 = xy + wz;
|
|
54599
|
+
const data2 = xz - wy;
|
|
54600
|
+
const data3 = xy - wz;
|
|
54601
|
+
const data4 = 1 - (xx + zz);
|
|
54602
|
+
const data5 = yz + wx;
|
|
54603
|
+
const data6 = xz + wy;
|
|
54604
|
+
const data7 = yz - wx;
|
|
54605
|
+
const data8 = 1 - (xx + yy);
|
|
54606
|
+
const r00 = data0 * sx;
|
|
54607
|
+
const r01 = data1 * sx;
|
|
54608
|
+
const r02 = data2 * sx;
|
|
54609
|
+
const r10 = data3 * sy;
|
|
54610
|
+
const r11 = data4 * sy;
|
|
54611
|
+
const r12 = data5 * sy;
|
|
54612
|
+
const r20 = data6 * sz;
|
|
54613
|
+
const r21 = data7 * sz;
|
|
54614
|
+
const r22 = data8 * sz;
|
|
54615
|
+
const cAx = r00 * r00 + r10 * r10 + r20 * r20;
|
|
54616
|
+
const cAy = r00 * r01 + r10 * r11 + r20 * r21;
|
|
54617
|
+
const cAz = r00 * r02 + r10 * r12 + r20 * r22;
|
|
54618
|
+
const cBx = r01 * r01 + r11 * r11 + r21 * r21;
|
|
54619
|
+
const cBy = r01 * r02 + r11 * r12 + r21 * r22;
|
|
54620
|
+
const cBz = r02 * r02 + r12 * r12 + r22 * r22;
|
|
54621
|
+
const bidx = idx;
|
|
54622
|
+
this._transformBData[bidx + 0] = cAx;
|
|
54623
|
+
this._transformBData[bidx + 1] = cAy;
|
|
54624
|
+
this._transformBData[bidx + 2] = cAz;
|
|
54625
|
+
this._transformBData[bidx + 3] = cBz;
|
|
54626
|
+
const hx = toHalfFloat(cBx) & 65535;
|
|
54627
|
+
const hy = toHalfFloat(cBy) & 65535;
|
|
54628
|
+
this._transformAData[idx + 3] = hx | hy << 16;
|
|
54629
|
+
}
|
|
54630
|
+
/**
|
|
54631
|
+
* Flush pending updates to GPU
|
|
54632
|
+
* Updates GPU textures with all pending changes
|
|
54633
|
+
*/
|
|
54634
|
+
flushUpdates() {
|
|
54635
|
+
if (this._pendingUpdates.size === 0) return;
|
|
54636
|
+
const w = this.size.x | 0;
|
|
54637
|
+
const h = this.size.y | 0;
|
|
54638
|
+
this.splatColor.updateTexture(w, h, this._colorData);
|
|
54639
|
+
this.transformA.updateTexture(w, h, this._transformAData);
|
|
54640
|
+
this.transformB.updateTexture(w, h, this._transformBData, false);
|
|
54641
|
+
this.updatePendingWorldPositions();
|
|
54642
|
+
this._pendingUpdates.clear();
|
|
54643
|
+
}
|
|
54644
|
+
/**
|
|
54645
|
+
* Set auto-flush threshold
|
|
54646
|
+
* @param threshold Number of pending updates before auto-flush (default: 100)
|
|
54647
|
+
*/
|
|
54648
|
+
setAutoFlushThreshold(threshold) {
|
|
54649
|
+
this._autoFlushThreshold = Math.max(1, threshold);
|
|
54650
|
+
}
|
|
54651
|
+
/**
|
|
54652
|
+
* Get current streaming statistics
|
|
54653
|
+
*/
|
|
54654
|
+
getStreamingStats() {
|
|
54655
|
+
return {
|
|
54656
|
+
totalCount: this.totalCount,
|
|
54657
|
+
validCount: this._validCount,
|
|
54658
|
+
pendingUpdates: this._pendingUpdates.size,
|
|
54659
|
+
progress: this.totalCount > 0 ? this._validCount / this.totalCount * 100 : 0
|
|
54660
|
+
};
|
|
54661
|
+
}
|
|
54662
|
+
/**
|
|
54663
|
+
* Update splat sorting before rendering
|
|
54664
|
+
* Uses the same logic as GSplatRenderer for reliable sorting
|
|
54665
|
+
*/
|
|
54666
|
+
onBeforeUpdate(view) {
|
|
54667
|
+
if (this._validCount > 0 && view?.camera) {
|
|
54668
|
+
if (view.camera.viewMatrix) {
|
|
54669
|
+
this.scheduleOrder(view.camera.viewMatrix);
|
|
54670
|
+
}
|
|
54671
|
+
}
|
|
54672
|
+
}
|
|
54673
|
+
/**
|
|
54674
|
+
* Update world space positions when transform changes
|
|
54675
|
+
*/
|
|
54676
|
+
updateWorldPositions() {
|
|
54677
|
+
if (!this._positions || this._validCount === 0) return;
|
|
54678
|
+
this._centersSent = false;
|
|
54679
|
+
}
|
|
54680
|
+
updatePendingWorldPositions() {
|
|
54681
|
+
if (!this._positions || this._validCount === 0) return;
|
|
54682
|
+
this._centersSent = false;
|
|
54683
|
+
}
|
|
54684
|
+
/**
|
|
54685
|
+
* Schedule Web Worker-based sorting task
|
|
54686
|
+
* Uses the same logic as GSplatRenderer for consistency
|
|
54687
|
+
*/
|
|
54688
|
+
scheduleOrder(viewMatrix) {
|
|
54689
|
+
if (this._validCount === 0) return;
|
|
54690
|
+
const transformChanged = this.object3D.transform.localChange;
|
|
54691
|
+
if (transformChanged) {
|
|
54692
|
+
this.updateWorldPositions();
|
|
54693
|
+
}
|
|
54694
|
+
const r = viewMatrix.rawData;
|
|
54695
|
+
const vx = r[2], vy = r[6], vz = r[10];
|
|
54696
|
+
const px = -(r[0] * r[12] + r[1] * r[13] + r[2] * r[14]);
|
|
54697
|
+
const py = -(r[4] * r[12] + r[5] * r[13] + r[6] * r[14]);
|
|
54698
|
+
const pz = -(r[8] * r[12] + r[9] * r[13] + r[10] * r[14]);
|
|
54699
|
+
const now = performance.now();
|
|
54700
|
+
const deltaTime = (now - this._lastSentTime) / 1e3;
|
|
54701
|
+
const posHash = Math.floor(px * 1e3) ^ Math.floor(py * 1e3) ^ Math.floor(pz * 1e3);
|
|
54702
|
+
const dirHash = Math.floor(vx * 1e3) ^ Math.floor(vy * 1e3) ^ Math.floor(vz * 1e3);
|
|
54703
|
+
const hash = posHash ^ dirHash;
|
|
54704
|
+
if (hash === this._lastViewMatrixHash && !transformChanged && this._centersSent) {
|
|
54705
|
+
return;
|
|
54706
|
+
}
|
|
54707
|
+
let effectiveThrottle = this._minIntervalMs;
|
|
54708
|
+
if (this._adaptiveSorting && this._minIntervalMs > 0) {
|
|
54709
|
+
const hashDelta = Math.abs(hash - this._lastViewMatrixHash);
|
|
54710
|
+
const speed = hashDelta / Math.max(deltaTime, 1e-3);
|
|
54711
|
+
if (speed < 1e3) {
|
|
54712
|
+
effectiveThrottle = this._minIntervalMs;
|
|
54713
|
+
} else if (speed < 1e4) {
|
|
54714
|
+
effectiveThrottle = this._minIntervalMs * 0.5;
|
|
54715
|
+
} else {
|
|
54716
|
+
effectiveThrottle = this._minIntervalMs * 0.2;
|
|
54717
|
+
}
|
|
54718
|
+
this._lastCameraSpeed = speed;
|
|
54719
|
+
}
|
|
54720
|
+
if (now - this._lastSentTime < effectiveThrottle) {
|
|
54721
|
+
return;
|
|
54722
|
+
}
|
|
54723
|
+
this._lastViewMatrixHash = hash;
|
|
54724
|
+
this._lastSentTime = now;
|
|
54725
|
+
if (!this._sortWorker) {
|
|
54726
|
+
this._sortWorker = this.createSortWorker();
|
|
54727
|
+
this._sortWorker.onmessage = (ev) => {
|
|
54728
|
+
const newOrder = ev.data.order;
|
|
54729
|
+
const oldOrder = this._orderData.buffer;
|
|
54730
|
+
this._sortWorker.postMessage({
|
|
54731
|
+
order: oldOrder
|
|
54732
|
+
}, [oldOrder]);
|
|
54733
|
+
const indices = new Uint32Array(newOrder);
|
|
54734
|
+
const total = this.size.x * this.size.y;
|
|
54735
|
+
const validCount = Math.min(this._validCount, indices.length);
|
|
54736
|
+
if (!this._orderData || this._orderData.length !== total) {
|
|
54737
|
+
this._orderData = new Uint32Array(total);
|
|
54738
|
+
}
|
|
54739
|
+
this._orderData.set(indices.subarray(0, validCount), 0);
|
|
54740
|
+
if (validCount < total) {
|
|
54741
|
+
const lastIndex = this._validCount > 0 ? this._validCount - 1 : 0;
|
|
54742
|
+
this._orderData.fill(lastIndex, validCount, total);
|
|
54743
|
+
}
|
|
54744
|
+
this.splatOrder.updateTexture(this.size.x, this.size.y, this._orderData);
|
|
54745
|
+
const valid = Math.max(0, Math.min(this._validCount, ev.data.count | 0));
|
|
54746
|
+
this.texParams[2] = valid;
|
|
54747
|
+
this.texParams[0] = valid;
|
|
54748
|
+
this._updateTexParams();
|
|
54749
|
+
const newInstanceCount = Math.ceil(valid / this._batchSize);
|
|
54750
|
+
this.instanceCount = newInstanceCount;
|
|
54751
|
+
};
|
|
54752
|
+
const centers = new Float32Array(this._validCount * 3);
|
|
54753
|
+
let centerIdx = 0;
|
|
54754
|
+
const worldMatrix = this.object3D.transform.worldMatrix;
|
|
54755
|
+
const localPos = this._positions;
|
|
54756
|
+
const m = worldMatrix.rawData;
|
|
54757
|
+
for (let i = 0; i < this._validCount; i++) {
|
|
54758
|
+
if (this._splatSetFlags[i]) {
|
|
54759
|
+
const srcIdx = i * 3;
|
|
54760
|
+
const x = localPos[srcIdx + 0];
|
|
54761
|
+
const y = localPos[srcIdx + 1];
|
|
54762
|
+
const z = localPos[srcIdx + 2];
|
|
54763
|
+
centers[centerIdx * 3 + 0] = m[0] * x + m[4] * y + m[8] * z + m[12];
|
|
54764
|
+
centers[centerIdx * 3 + 1] = m[1] * x + m[5] * y + m[9] * z + m[13];
|
|
54765
|
+
centers[centerIdx * 3 + 2] = m[2] * x + m[6] * y + m[10] * z + m[14];
|
|
54766
|
+
centerIdx++;
|
|
54767
|
+
}
|
|
54768
|
+
}
|
|
54769
|
+
const orderBuffer = new Uint32Array(this.totalCount);
|
|
54770
|
+
for (let i = 0; i < this.totalCount; i++) {
|
|
54771
|
+
orderBuffer[i] = i < this._validCount ? i : this._validCount > 0 ? this._validCount - 1 : 0;
|
|
54772
|
+
}
|
|
54773
|
+
this._sortWorker.postMessage({
|
|
54774
|
+
order: orderBuffer.buffer,
|
|
54775
|
+
centers: centers.buffer
|
|
54776
|
+
}, [orderBuffer.buffer, centers.buffer]);
|
|
54777
|
+
this._centersSent = true;
|
|
54778
|
+
}
|
|
54779
|
+
if (!this._centersSent && this._sortWorker) {
|
|
54780
|
+
const centers = new Float32Array(this._validCount * 3);
|
|
54781
|
+
let centerIdx = 0;
|
|
54782
|
+
const worldMatrix = this.object3D.transform.worldMatrix;
|
|
54783
|
+
const localPos = this._positions;
|
|
54784
|
+
const m = worldMatrix.rawData;
|
|
54785
|
+
for (let i = 0; i < this._validCount; i++) {
|
|
54786
|
+
if (this._splatSetFlags[i]) {
|
|
54787
|
+
const srcIdx = i * 3;
|
|
54788
|
+
const x = localPos[srcIdx + 0];
|
|
54789
|
+
const y = localPos[srcIdx + 1];
|
|
54790
|
+
const z = localPos[srcIdx + 2];
|
|
54791
|
+
centers[centerIdx * 3 + 0] = m[0] * x + m[4] * y + m[8] * z + m[12];
|
|
54792
|
+
centers[centerIdx * 3 + 1] = m[1] * x + m[5] * y + m[9] * z + m[13];
|
|
54793
|
+
centers[centerIdx * 3 + 2] = m[2] * x + m[6] * y + m[10] * z + m[14];
|
|
54794
|
+
centerIdx++;
|
|
54795
|
+
}
|
|
54796
|
+
}
|
|
54797
|
+
this._sortWorker.postMessage({
|
|
54798
|
+
type: "centers",
|
|
54799
|
+
centers: centers.buffer
|
|
54800
|
+
}, [centers.buffer]);
|
|
54801
|
+
this._centersSent = true;
|
|
54802
|
+
}
|
|
54803
|
+
this._sortWorker.postMessage({
|
|
54804
|
+
cameraPosition: { x: px, y: py, z: pz },
|
|
54805
|
+
cameraDirection: { x: -vx, y: -vy, z: -vz }
|
|
54806
|
+
});
|
|
54807
|
+
}
|
|
54808
|
+
/**
|
|
54809
|
+
* Create Web Worker for sorting
|
|
54810
|
+
* Uses the exact same logic as GSplatRenderer for consistency
|
|
54811
|
+
*/
|
|
54812
|
+
createSortWorker() {
|
|
54813
|
+
function SortWorker() {
|
|
54814
|
+
const compareBits = 16;
|
|
54815
|
+
const bucketCount = 2 ** compareBits + 1;
|
|
54816
|
+
let order;
|
|
54817
|
+
let centers;
|
|
54818
|
+
let cameraPosition;
|
|
54819
|
+
let cameraDirection;
|
|
54820
|
+
let forceUpdate = false;
|
|
54821
|
+
const lastCameraPosition = { x: 0, y: 0, z: 0 };
|
|
54822
|
+
const lastCameraDirection = { x: 0, y: 0, z: 0 };
|
|
54823
|
+
const boundMin = { x: 0, y: 0, z: 0 };
|
|
54824
|
+
const boundMax = { x: 0, y: 0, z: 0 };
|
|
54825
|
+
let distances;
|
|
54826
|
+
let countBuffer;
|
|
54827
|
+
const binarySearch = (m, n, compare_fn) => {
|
|
54828
|
+
while (m <= n) {
|
|
54829
|
+
const k = n + m >> 1;
|
|
54830
|
+
const cmp = compare_fn(k);
|
|
54831
|
+
if (cmp > 0) {
|
|
54832
|
+
m = k + 1;
|
|
54833
|
+
} else if (cmp < 0) {
|
|
54834
|
+
n = k - 1;
|
|
54835
|
+
} else {
|
|
54836
|
+
return k;
|
|
54837
|
+
}
|
|
54838
|
+
}
|
|
54839
|
+
return ~m;
|
|
54840
|
+
};
|
|
54841
|
+
const update = () => {
|
|
54842
|
+
if (!order || !centers || !cameraPosition || !cameraDirection) return;
|
|
54843
|
+
const px = cameraPosition.x;
|
|
54844
|
+
const py = cameraPosition.y;
|
|
54845
|
+
const pz = cameraPosition.z;
|
|
54846
|
+
const dx = cameraDirection.x;
|
|
54847
|
+
const dy = cameraDirection.y;
|
|
54848
|
+
const dz = cameraDirection.z;
|
|
54849
|
+
const epsilon = 1e-3;
|
|
54850
|
+
if (!forceUpdate && Math.abs(px - lastCameraPosition.x) < epsilon && Math.abs(py - lastCameraPosition.y) < epsilon && Math.abs(pz - lastCameraPosition.z) < epsilon && Math.abs(dx - lastCameraDirection.x) < epsilon && Math.abs(dy - lastCameraDirection.y) < epsilon && Math.abs(dz - lastCameraDirection.z) < epsilon) {
|
|
54851
|
+
return;
|
|
54852
|
+
}
|
|
54853
|
+
forceUpdate = false;
|
|
54854
|
+
lastCameraPosition.x = px;
|
|
54855
|
+
lastCameraPosition.y = py;
|
|
54856
|
+
lastCameraPosition.z = pz;
|
|
54857
|
+
lastCameraDirection.x = dx;
|
|
54858
|
+
lastCameraDirection.y = dy;
|
|
54859
|
+
lastCameraDirection.z = dz;
|
|
54860
|
+
const numVertices = centers.length / 3;
|
|
54861
|
+
if (distances?.length !== numVertices) {
|
|
54862
|
+
distances = new Uint32Array(numVertices);
|
|
54863
|
+
}
|
|
54864
|
+
let minDist;
|
|
54865
|
+
let maxDist;
|
|
54866
|
+
for (let i = 0; i < 8; ++i) {
|
|
54867
|
+
const x = (i & 1 ? boundMin.x : boundMax.x) - px;
|
|
54868
|
+
const y = (i & 2 ? boundMin.y : boundMax.y) - py;
|
|
54869
|
+
const z = (i & 4 ? boundMin.z : boundMax.z) - pz;
|
|
54870
|
+
const d = x * dx + y * dy + z * dz;
|
|
54871
|
+
if (i === 0) {
|
|
54872
|
+
minDist = maxDist = d;
|
|
54873
|
+
} else {
|
|
54874
|
+
minDist = Math.min(minDist, d);
|
|
54875
|
+
maxDist = Math.max(maxDist, d);
|
|
54876
|
+
}
|
|
54877
|
+
}
|
|
54878
|
+
if (!countBuffer) {
|
|
54879
|
+
countBuffer = new Uint32Array(bucketCount);
|
|
54880
|
+
} else {
|
|
54881
|
+
countBuffer.fill(0);
|
|
54882
|
+
}
|
|
54883
|
+
const range = maxDist - minDist;
|
|
54884
|
+
const divider = range < 1e-6 ? 0 : 1 / range * 2 ** compareBits;
|
|
54885
|
+
for (let i = 0; i < numVertices; ++i) {
|
|
54886
|
+
const istride = i * 3;
|
|
54887
|
+
const x = centers[istride + 0] - px;
|
|
54888
|
+
const y = centers[istride + 1] - py;
|
|
54889
|
+
const z = centers[istride + 2] - pz;
|
|
54890
|
+
const d = x * dx + y * dy + z * dz;
|
|
54891
|
+
const sortKey = Math.floor((d - minDist) * divider);
|
|
54892
|
+
distances[i] = sortKey;
|
|
54893
|
+
countBuffer[sortKey]++;
|
|
54894
|
+
}
|
|
54895
|
+
for (let i = 1; i < bucketCount; i++) {
|
|
54896
|
+
countBuffer[i] += countBuffer[i - 1];
|
|
54897
|
+
}
|
|
54898
|
+
for (let i = 0; i < numVertices; i++) {
|
|
54899
|
+
const distance = distances[i];
|
|
54900
|
+
const destIndex = --countBuffer[distance];
|
|
54901
|
+
order[destIndex] = i;
|
|
54902
|
+
}
|
|
54903
|
+
const dist = (i) => distances[order[i]] / divider + minDist;
|
|
54904
|
+
const findZero = () => {
|
|
54905
|
+
const result = binarySearch(0, numVertices - 1, (i) => -dist(i));
|
|
54906
|
+
return Math.min(numVertices, Math.abs(result));
|
|
54907
|
+
};
|
|
54908
|
+
const count = dist(numVertices - 1) >= 0 ? findZero() : numVertices;
|
|
54909
|
+
self.postMessage({
|
|
54910
|
+
order: order.buffer,
|
|
54911
|
+
count
|
|
54912
|
+
}, [order.buffer]);
|
|
54913
|
+
order = null;
|
|
54914
|
+
};
|
|
54915
|
+
self.onmessage = (message) => {
|
|
54916
|
+
if (message.data.order) {
|
|
54917
|
+
order = new Uint32Array(message.data.order);
|
|
54918
|
+
}
|
|
54919
|
+
if (message.data.centers) {
|
|
54920
|
+
centers = new Float32Array(message.data.centers);
|
|
54921
|
+
boundMin.x = boundMax.x = centers[0];
|
|
54922
|
+
boundMin.y = boundMax.y = centers[1];
|
|
54923
|
+
boundMin.z = boundMax.z = centers[2];
|
|
54924
|
+
const numVertices = centers.length / 3;
|
|
54925
|
+
for (let i = 1; i < numVertices; ++i) {
|
|
54926
|
+
const x = centers[i * 3 + 0];
|
|
54927
|
+
const y = centers[i * 3 + 1];
|
|
54928
|
+
const z = centers[i * 3 + 2];
|
|
54929
|
+
boundMin.x = Math.min(boundMin.x, x);
|
|
54930
|
+
boundMin.y = Math.min(boundMin.y, y);
|
|
54931
|
+
boundMin.z = Math.min(boundMin.z, z);
|
|
54932
|
+
boundMax.x = Math.max(boundMax.x, x);
|
|
54933
|
+
boundMax.y = Math.max(boundMax.y, y);
|
|
54934
|
+
boundMax.z = Math.max(boundMax.z, z);
|
|
54935
|
+
}
|
|
54936
|
+
forceUpdate = true;
|
|
54937
|
+
}
|
|
54938
|
+
if (message.data.cameraPosition) cameraPosition = message.data.cameraPosition;
|
|
54939
|
+
if (message.data.cameraDirection) cameraDirection = message.data.cameraDirection;
|
|
54940
|
+
update();
|
|
54941
|
+
};
|
|
54942
|
+
}
|
|
54943
|
+
const code = `(${SortWorker.toString()})()`;
|
|
54944
|
+
const blob = new Blob([code], { type: "application/javascript" });
|
|
54945
|
+
const url = URL.createObjectURL(blob);
|
|
54946
|
+
return new Worker(url);
|
|
54947
|
+
}
|
|
54948
|
+
/**
|
|
54949
|
+
* Set visibility boost factor
|
|
54950
|
+
*/
|
|
54951
|
+
setVisBoost(v) {
|
|
54952
|
+
this.texParams[3] = Math.max(0, v);
|
|
54953
|
+
}
|
|
54954
|
+
setCount(c) {
|
|
54955
|
+
this.texParams[0] = Math.max(0, c);
|
|
54956
|
+
}
|
|
54957
|
+
_updateTexParams() {
|
|
54958
|
+
this.gsplatMaterial.setTexParams(this.texParams);
|
|
54959
|
+
}
|
|
54960
|
+
/**
|
|
54961
|
+
* Set sort throttle interval (milliseconds)
|
|
54962
|
+
*/
|
|
54963
|
+
setSortThrottle(ms) {
|
|
54964
|
+
this._minIntervalMs = Math.max(0, ms | 0);
|
|
54965
|
+
}
|
|
54966
|
+
/**
|
|
54967
|
+
* Enable/disable adaptive sorting
|
|
54968
|
+
*/
|
|
54969
|
+
setAdaptiveSorting(enabled) {
|
|
54970
|
+
this._adaptiveSorting = enabled;
|
|
54971
|
+
}
|
|
54972
|
+
/**
|
|
54973
|
+
* Set pixel coverage culling thresholds
|
|
54974
|
+
*/
|
|
54975
|
+
setPixelCulling(minPixels, maxPixels = 0, maxPixelCullDistance = 0) {
|
|
54976
|
+
this._minPixelCoverage = Math.max(0, minPixels);
|
|
54977
|
+
this._maxPixelCoverage = Math.max(0, maxPixels);
|
|
54978
|
+
this._maxPixelCullDistance = Math.max(0, maxPixelCullDistance);
|
|
54979
|
+
}
|
|
54980
|
+
/**
|
|
54981
|
+
* Get current pixel culling settings
|
|
54982
|
+
*/
|
|
54983
|
+
getPixelCullingStats() {
|
|
54984
|
+
return {
|
|
54985
|
+
minPixels: this._minPixelCoverage,
|
|
54986
|
+
maxPixels: this._maxPixelCoverage,
|
|
54987
|
+
maxPixelCullDistance: this._maxPixelCullDistance,
|
|
54988
|
+
maxEnabled: this._maxPixelCoverage > 0,
|
|
54989
|
+
distanceEnabled: this._maxPixelCullDistance > 0
|
|
54990
|
+
};
|
|
54991
|
+
}
|
|
54992
|
+
/**
|
|
54993
|
+
* Get batching statistics
|
|
54994
|
+
*/
|
|
54995
|
+
getBatchingStats() {
|
|
54996
|
+
return {
|
|
54997
|
+
enabled: true,
|
|
54998
|
+
batchSize: this._batchSize,
|
|
54999
|
+
instanceCount: this.instanceCount,
|
|
55000
|
+
splatCount: this._validCount,
|
|
55001
|
+
reduction: this._validCount > 0 ? (1 - this.instanceCount / this._validCount) * 100 : 0
|
|
55002
|
+
};
|
|
55003
|
+
}
|
|
55004
|
+
/**
|
|
55005
|
+
* Calculate texture size for given splat count
|
|
55006
|
+
*/
|
|
55007
|
+
evalTextureSize(count) {
|
|
55008
|
+
let w = Math.ceil(Math.sqrt(count));
|
|
55009
|
+
const align = 64;
|
|
55010
|
+
w = Math.ceil(w / align) * align;
|
|
55011
|
+
const h = Math.ceil(count / w);
|
|
55012
|
+
return new Vector2(w, h);
|
|
55013
|
+
}
|
|
55014
|
+
/**
|
|
55015
|
+
* Update node before rendering
|
|
55016
|
+
*/
|
|
55017
|
+
nodeUpdate(view, passType, renderPassState, clusterLightingBuffer) {
|
|
55018
|
+
if (this._pendingUpdates.size > 0 && this._frameCount >= 60) {
|
|
55019
|
+
this.flushUpdates();
|
|
55020
|
+
}
|
|
55021
|
+
if (this._frameCount >= 60 && this._pendingUpdates.size === 0) {
|
|
55022
|
+
this._frameCount = 0;
|
|
55023
|
+
}
|
|
55024
|
+
this._frameCount++;
|
|
55025
|
+
const worldMatrix = this.object3D.transform.worldMatrix;
|
|
55026
|
+
this.gsplatMaterial.setTransformMatrix(worldMatrix);
|
|
55027
|
+
const currentParams = `${this._minPixelCoverage},${this._maxPixelCoverage},${this._maxPixelCullDistance},${this._batchSize}`;
|
|
55028
|
+
if (currentParams !== this._lastPixelCullParams) {
|
|
55029
|
+
this.gsplatMaterial.setPixelCulling(this._minPixelCoverage, this._maxPixelCoverage, this._maxPixelCullDistance, this._batchSize);
|
|
55030
|
+
this._lastPixelCullParams = currentParams;
|
|
55031
|
+
}
|
|
55032
|
+
if (!this._texturesInitialized) {
|
|
55033
|
+
this.gsplatMaterial.setSplatTextures(
|
|
55034
|
+
this.splatColor,
|
|
55035
|
+
this.transformA,
|
|
55036
|
+
this.transformB,
|
|
55037
|
+
this.texParams,
|
|
55038
|
+
this.splatOrder
|
|
55039
|
+
);
|
|
55040
|
+
this._texturesInitialized = true;
|
|
55041
|
+
}
|
|
55042
|
+
super.nodeUpdate(view, passType, renderPassState, clusterLightingBuffer);
|
|
55043
|
+
}
|
|
55044
|
+
/**
|
|
55045
|
+
* Render pass
|
|
55046
|
+
*/
|
|
55047
|
+
renderPass(view, passType, renderContext) {
|
|
55048
|
+
const encoder = renderContext.encoder;
|
|
55049
|
+
for (let mat of this.materials) {
|
|
55050
|
+
const passes = mat.getPass(passType);
|
|
55051
|
+
if (!passes || passes.length === 0) continue;
|
|
55052
|
+
for (const pass of passes) {
|
|
55053
|
+
if (!pass.pipeline) continue;
|
|
55054
|
+
pass.apply(this.geometry, renderContext.rendererPassState || renderContext);
|
|
55055
|
+
GPUContext.bindPipeline(encoder, pass);
|
|
55056
|
+
GPUContext.bindGeometryBuffer(encoder, this.geometry);
|
|
55057
|
+
const subGeometry = this.geometry.subGeometries[0];
|
|
55058
|
+
const lodInfo = subGeometry.lodLevels[0];
|
|
55059
|
+
if (this.instanceCount > 0) {
|
|
55060
|
+
GPUContext.drawIndexed(
|
|
55061
|
+
encoder,
|
|
55062
|
+
lodInfo.indexCount,
|
|
55063
|
+
this.instanceCount,
|
|
55064
|
+
lodInfo.indexStart,
|
|
55065
|
+
0,
|
|
55066
|
+
0
|
|
55067
|
+
);
|
|
55068
|
+
} else {
|
|
55069
|
+
GPUContext.drawIndexed(
|
|
55070
|
+
encoder,
|
|
55071
|
+
lodInfo.indexCount,
|
|
55072
|
+
1,
|
|
55073
|
+
lodInfo.indexStart,
|
|
55074
|
+
0,
|
|
55075
|
+
0
|
|
55076
|
+
);
|
|
55077
|
+
}
|
|
55078
|
+
}
|
|
55079
|
+
}
|
|
55080
|
+
}
|
|
55081
|
+
/**
|
|
55082
|
+
* Clean up resources
|
|
55083
|
+
*/
|
|
55084
|
+
destroy(force) {
|
|
55085
|
+
if (this._sortWorker) {
|
|
55086
|
+
this._sortWorker.terminate();
|
|
55087
|
+
this._sortWorker = null;
|
|
55088
|
+
}
|
|
55089
|
+
if (this.splatColor) {
|
|
55090
|
+
this.splatColor.destroy(force);
|
|
55091
|
+
this.splatColor = null;
|
|
55092
|
+
}
|
|
55093
|
+
if (this.transformA) {
|
|
55094
|
+
this.transformA.destroy(force);
|
|
55095
|
+
this.transformA = null;
|
|
55096
|
+
}
|
|
55097
|
+
if (this.transformB) {
|
|
55098
|
+
this.transformB.destroy(force);
|
|
55099
|
+
this.transformB = null;
|
|
55100
|
+
}
|
|
55101
|
+
if (this.splatOrder) {
|
|
55102
|
+
this.splatOrder.destroy(force);
|
|
55103
|
+
this.splatOrder = null;
|
|
55104
|
+
}
|
|
55105
|
+
this._positions = null;
|
|
55106
|
+
this._orderData = null;
|
|
55107
|
+
this._colorData = null;
|
|
55108
|
+
this._transformAData = null;
|
|
55109
|
+
this._transformBData = null;
|
|
55110
|
+
this.texParams = null;
|
|
55111
|
+
this._splatSetFlags = null;
|
|
55112
|
+
this._pendingUpdates.clear();
|
|
55113
|
+
super.destroy(force);
|
|
55114
|
+
}
|
|
55115
|
+
};
|
|
55116
|
+
GSplatStreamRenderer = __decorateClass$7([
|
|
55117
|
+
RegisterComponent(GSplatStreamRenderer, "GSplatStreamRenderer")
|
|
55118
|
+
], GSplatStreamRenderer);
|
|
55119
|
+
|
|
54347
55120
|
class Probe extends Object3D {
|
|
54348
55121
|
index = 0;
|
|
54349
55122
|
drawCallFrame = -1;
|
|
@@ -59823,6 +60596,127 @@ class LoaderManager extends CEventDispatcher {
|
|
|
59823
60596
|
}
|
|
59824
60597
|
}
|
|
59825
60598
|
|
|
60599
|
+
class StreamLoader extends LoaderBase {
|
|
60600
|
+
/**
|
|
60601
|
+
* Load resource with streaming support
|
|
60602
|
+
* @param url Resource URL
|
|
60603
|
+
* @param parserClass Parser class that supports streaming
|
|
60604
|
+
* @param loaderFunctions Optional loader callbacks
|
|
60605
|
+
* @param userData Optional user data
|
|
60606
|
+
* @returns Promise that resolves when initial data is ready (header parsed), includes cancel method
|
|
60607
|
+
*/
|
|
60608
|
+
async loadStream(url, parserClass, loaderFunctions, userData) {
|
|
60609
|
+
if (parserClass.format !== ParserFormat.BIN) {
|
|
60610
|
+
throw new Error("StreamLoader only supports BIN format parsers");
|
|
60611
|
+
}
|
|
60612
|
+
return new Promise(async (succ, fail) => {
|
|
60613
|
+
let aborted = false;
|
|
60614
|
+
let reader = null;
|
|
60615
|
+
let abortController = null;
|
|
60616
|
+
const cancel = () => {
|
|
60617
|
+
aborted = true;
|
|
60618
|
+
if (reader) {
|
|
60619
|
+
reader.cancel().catch(() => {
|
|
60620
|
+
});
|
|
60621
|
+
reader.releaseLock();
|
|
60622
|
+
}
|
|
60623
|
+
if (abortController) {
|
|
60624
|
+
abortController.abort();
|
|
60625
|
+
}
|
|
60626
|
+
if (parser && typeof parser.cancel === "function") {
|
|
60627
|
+
parser.cancel();
|
|
60628
|
+
}
|
|
60629
|
+
};
|
|
60630
|
+
let parser = null;
|
|
60631
|
+
try {
|
|
60632
|
+
this.baseUrl = url.substring(0, url.lastIndexOf("/") + 1);
|
|
60633
|
+
this.initUrl = url;
|
|
60634
|
+
abortController = new AbortController();
|
|
60635
|
+
const response = await fetch(url, {
|
|
60636
|
+
headers: loaderFunctions?.headers,
|
|
60637
|
+
signal: abortController.signal
|
|
60638
|
+
});
|
|
60639
|
+
if (!response.ok) {
|
|
60640
|
+
throw new Error(`Request rejected with status ${response.status}`);
|
|
60641
|
+
}
|
|
60642
|
+
reader = response.body.getReader();
|
|
60643
|
+
const contentLength = +response.headers.get("Content-Length") || 0;
|
|
60644
|
+
parser = new parserClass();
|
|
60645
|
+
parser.userData = userData;
|
|
60646
|
+
parser.baseUrl = this.baseUrl;
|
|
60647
|
+
parser.initUrl = url;
|
|
60648
|
+
parser.loaderFunctions = loaderFunctions;
|
|
60649
|
+
if (typeof parser.initStream !== "function") {
|
|
60650
|
+
throw new Error(`Parser ${parserClass.name} does not support streaming. Implement initStream() method.`);
|
|
60651
|
+
}
|
|
60652
|
+
let parserResolved = false;
|
|
60653
|
+
await parser.initStream(contentLength, () => {
|
|
60654
|
+
if (!parserResolved && !aborted && parser && parser.verification()) {
|
|
60655
|
+
parserResolved = true;
|
|
60656
|
+
succ({ parser, cancel });
|
|
60657
|
+
}
|
|
60658
|
+
});
|
|
60659
|
+
let receivedLength = 0;
|
|
60660
|
+
while (!aborted) {
|
|
60661
|
+
const { done, value } = await reader.read();
|
|
60662
|
+
if (done || aborted) {
|
|
60663
|
+
if (!aborted) {
|
|
60664
|
+
if (typeof parser.finalizeStream === "function") {
|
|
60665
|
+
await parser.finalizeStream();
|
|
60666
|
+
}
|
|
60667
|
+
if (!parserResolved && parser) {
|
|
60668
|
+
if (parser.verification()) {
|
|
60669
|
+
parserResolved = true;
|
|
60670
|
+
succ({ parser, cancel });
|
|
60671
|
+
} else {
|
|
60672
|
+
throw new Error("Parser verification failed");
|
|
60673
|
+
}
|
|
60674
|
+
}
|
|
60675
|
+
}
|
|
60676
|
+
break;
|
|
60677
|
+
}
|
|
60678
|
+
if (aborted) break;
|
|
60679
|
+
receivedLength += value.length;
|
|
60680
|
+
if (contentLength > 0 && loaderFunctions?.onProgress && !aborted) {
|
|
60681
|
+
loaderFunctions.onProgress.call(
|
|
60682
|
+
this,
|
|
60683
|
+
receivedLength,
|
|
60684
|
+
contentLength,
|
|
60685
|
+
url,
|
|
60686
|
+
parser
|
|
60687
|
+
);
|
|
60688
|
+
}
|
|
60689
|
+
if (!aborted && typeof parser.processChunk === "function") {
|
|
60690
|
+
await parser.processChunk(value, receivedLength, contentLength);
|
|
60691
|
+
}
|
|
60692
|
+
if (!parserResolved && !aborted && parser && parser.verification()) {
|
|
60693
|
+
parserResolved = true;
|
|
60694
|
+
succ({ parser, cancel });
|
|
60695
|
+
}
|
|
60696
|
+
}
|
|
60697
|
+
if (!aborted && loaderFunctions?.onComplete) {
|
|
60698
|
+
loaderFunctions.onComplete.call(this, url);
|
|
60699
|
+
}
|
|
60700
|
+
} catch (e) {
|
|
60701
|
+
if (aborted) {
|
|
60702
|
+
return;
|
|
60703
|
+
}
|
|
60704
|
+
if (loaderFunctions?.onError) {
|
|
60705
|
+
loaderFunctions.onError(e);
|
|
60706
|
+
}
|
|
60707
|
+
fail(e);
|
|
60708
|
+
} finally {
|
|
60709
|
+
if (reader && !aborted) {
|
|
60710
|
+
try {
|
|
60711
|
+
reader.releaseLock();
|
|
60712
|
+
} catch {
|
|
60713
|
+
}
|
|
60714
|
+
}
|
|
60715
|
+
}
|
|
60716
|
+
});
|
|
60717
|
+
}
|
|
60718
|
+
}
|
|
60719
|
+
|
|
59826
60720
|
function computeAABBFromPositions(position) {
|
|
59827
60721
|
const min = [Infinity, Infinity, Infinity];
|
|
59828
60722
|
const max = [-Infinity, -Infinity, -Infinity];
|
|
@@ -61041,6 +61935,314 @@ function parsePlyPointCloudASCII(buffer, header) {
|
|
|
61041
61935
|
};
|
|
61042
61936
|
}
|
|
61043
61937
|
|
|
61938
|
+
class PlyStreamParser {
|
|
61939
|
+
_header = null;
|
|
61940
|
+
_headerBuffer = new Uint8Array(4096);
|
|
61941
|
+
_headerLength = 0;
|
|
61942
|
+
_headerParsed = false;
|
|
61943
|
+
// Data parsing state
|
|
61944
|
+
_dataBuffer = null;
|
|
61945
|
+
_dataOffset = 0;
|
|
61946
|
+
_processedVertices = 0;
|
|
61947
|
+
_vertexStride = 0;
|
|
61948
|
+
_propOffsets = [];
|
|
61949
|
+
_properties = [];
|
|
61950
|
+
// Callbacks
|
|
61951
|
+
_onHeaderParsed = null;
|
|
61952
|
+
_onSplatParsed = null;
|
|
61953
|
+
_batchSize = 1e3;
|
|
61954
|
+
_cancelled = false;
|
|
61955
|
+
constructor(onHeaderParsed, onSplatParsed, batchSize = 1e3) {
|
|
61956
|
+
this._onHeaderParsed = onHeaderParsed;
|
|
61957
|
+
this._onSplatParsed = onSplatParsed;
|
|
61958
|
+
this._batchSize = batchSize;
|
|
61959
|
+
}
|
|
61960
|
+
/**
|
|
61961
|
+
* Process incoming data chunk
|
|
61962
|
+
*/
|
|
61963
|
+
processChunk(chunk) {
|
|
61964
|
+
if (this._cancelled) return;
|
|
61965
|
+
if (!this._headerParsed) {
|
|
61966
|
+
this._processHeaderChunk(chunk);
|
|
61967
|
+
} else {
|
|
61968
|
+
this._processDataChunk(chunk);
|
|
61969
|
+
}
|
|
61970
|
+
}
|
|
61971
|
+
/**
|
|
61972
|
+
* Cancel parsing
|
|
61973
|
+
* Stops processing new chunks
|
|
61974
|
+
*/
|
|
61975
|
+
cancel() {
|
|
61976
|
+
this._cancelled = true;
|
|
61977
|
+
}
|
|
61978
|
+
/**
|
|
61979
|
+
* Check if parsing is cancelled
|
|
61980
|
+
*/
|
|
61981
|
+
isCancelled() {
|
|
61982
|
+
return this._cancelled;
|
|
61983
|
+
}
|
|
61984
|
+
/**
|
|
61985
|
+
* Process header chunk
|
|
61986
|
+
*/
|
|
61987
|
+
_processHeaderChunk(chunk) {
|
|
61988
|
+
const needed = this._headerLength + chunk.length;
|
|
61989
|
+
if (needed > this._headerBuffer.length) {
|
|
61990
|
+
const newBuffer = new Uint8Array(Math.max(needed, this._headerBuffer.length * 2));
|
|
61991
|
+
newBuffer.set(this._headerBuffer.subarray(0, this._headerLength));
|
|
61992
|
+
this._headerBuffer = newBuffer;
|
|
61993
|
+
}
|
|
61994
|
+
this._headerBuffer.set(chunk, this._headerLength);
|
|
61995
|
+
this._headerLength += chunk.length;
|
|
61996
|
+
const headerText = new TextDecoder("utf-8").decode(
|
|
61997
|
+
this._headerBuffer.subarray(0, this._headerLength)
|
|
61998
|
+
);
|
|
61999
|
+
const headerEnd = headerText.indexOf("end_header\n");
|
|
62000
|
+
if (headerEnd >= 0) {
|
|
62001
|
+
const headerEndPos = headerEnd + "end_header\n".length;
|
|
62002
|
+
const headerBuffer = this._headerBuffer.subarray(0, headerEndPos);
|
|
62003
|
+
const headerArrayBuffer = headerBuffer.buffer.slice(headerBuffer.byteOffset, headerBuffer.byteOffset + headerBuffer.byteLength);
|
|
62004
|
+
const header = this._parseHeader(headerArrayBuffer);
|
|
62005
|
+
this._header = header;
|
|
62006
|
+
this._headerParsed = true;
|
|
62007
|
+
this._initializeDataParsing(header);
|
|
62008
|
+
if (this._onHeaderParsed) {
|
|
62009
|
+
this._onHeaderParsed(header);
|
|
62010
|
+
}
|
|
62011
|
+
const chunkStartInHeader = this._headerLength - chunk.length;
|
|
62012
|
+
const remainingStartInChunk = headerEndPos - chunkStartInHeader;
|
|
62013
|
+
if (remainingStartInChunk > 0 && remainingStartInChunk < chunk.length) {
|
|
62014
|
+
const remainingChunk = chunk.subarray(remainingStartInChunk);
|
|
62015
|
+
this._processDataChunk(remainingChunk);
|
|
62016
|
+
} else if (remainingStartInChunk === 0) {
|
|
62017
|
+
this._processDataChunk(chunk);
|
|
62018
|
+
}
|
|
62019
|
+
}
|
|
62020
|
+
}
|
|
62021
|
+
/**
|
|
62022
|
+
* Parse PLY header from buffer
|
|
62023
|
+
*/
|
|
62024
|
+
_parseHeader(buffer) {
|
|
62025
|
+
const ascii = new TextDecoder("utf-8").decode(new Uint8Array(buffer));
|
|
62026
|
+
const headerEnd = ascii.indexOf("end_header\n");
|
|
62027
|
+
if (headerEnd < 0) {
|
|
62028
|
+
throw new Error("PLY: Invalid PLY header");
|
|
62029
|
+
}
|
|
62030
|
+
const headerText = ascii.substring(0, headerEnd + "end_header\n".length);
|
|
62031
|
+
const lines = headerText.split(/\r?\n/);
|
|
62032
|
+
let format = "";
|
|
62033
|
+
let vertexCount = 0;
|
|
62034
|
+
let faceCount = 0;
|
|
62035
|
+
const properties = [];
|
|
62036
|
+
const faceProperties = [];
|
|
62037
|
+
const textureFiles = [];
|
|
62038
|
+
let inVertexElement = false;
|
|
62039
|
+
let inFaceElement = false;
|
|
62040
|
+
for (const line of lines) {
|
|
62041
|
+
if (line.startsWith("format ")) {
|
|
62042
|
+
format = line.split(/\s+/)[1];
|
|
62043
|
+
} else if (line.startsWith("comment TextureFile ")) {
|
|
62044
|
+
const texturePath = line.substring("comment TextureFile ".length).trim();
|
|
62045
|
+
if (texturePath) {
|
|
62046
|
+
textureFiles.push(texturePath);
|
|
62047
|
+
}
|
|
62048
|
+
} else if (line.startsWith("element ")) {
|
|
62049
|
+
const toks = line.split(/\s+/);
|
|
62050
|
+
inVertexElement = toks[1] === "vertex";
|
|
62051
|
+
inFaceElement = toks[1] === "face";
|
|
62052
|
+
if (inVertexElement) {
|
|
62053
|
+
vertexCount = parseInt(toks[2]);
|
|
62054
|
+
inFaceElement = false;
|
|
62055
|
+
}
|
|
62056
|
+
if (inFaceElement) {
|
|
62057
|
+
faceCount = parseInt(toks[2]);
|
|
62058
|
+
inVertexElement = false;
|
|
62059
|
+
}
|
|
62060
|
+
} else if (inVertexElement && line.startsWith("property ")) {
|
|
62061
|
+
const toks = line.split(/\s+/);
|
|
62062
|
+
const type = toks[1];
|
|
62063
|
+
const name = toks[2];
|
|
62064
|
+
properties.push({ name, type });
|
|
62065
|
+
} else if (inFaceElement && line.startsWith("property ")) {
|
|
62066
|
+
const toks = line.split(/\s+/);
|
|
62067
|
+
if (toks[1] === "list") {
|
|
62068
|
+
const countType = toks[2];
|
|
62069
|
+
const itemType = toks[3];
|
|
62070
|
+
const name = toks[4];
|
|
62071
|
+
faceProperties.push({ name, type: `list ${countType} ${itemType}` });
|
|
62072
|
+
} else {
|
|
62073
|
+
const type = toks[1];
|
|
62074
|
+
const name = toks[2];
|
|
62075
|
+
faceProperties.push({ name, type });
|
|
62076
|
+
}
|
|
62077
|
+
}
|
|
62078
|
+
}
|
|
62079
|
+
if (format !== "binary_little_endian" && format !== "ascii") {
|
|
62080
|
+
throw new Error(`PLY: Unsupported format: ${format}`);
|
|
62081
|
+
}
|
|
62082
|
+
let splatPropertyCount = 0;
|
|
62083
|
+
let splatPropertyColorCount = 0;
|
|
62084
|
+
for (const property of properties) {
|
|
62085
|
+
if (splatProperties.includes(property.name)) {
|
|
62086
|
+
splatPropertyCount++;
|
|
62087
|
+
}
|
|
62088
|
+
if (splatColorProperties.includes(property.name)) {
|
|
62089
|
+
splatPropertyColorCount++;
|
|
62090
|
+
}
|
|
62091
|
+
}
|
|
62092
|
+
let mode;
|
|
62093
|
+
if (faceCount > 0) {
|
|
62094
|
+
mode = PlyMode.Mesh;
|
|
62095
|
+
} else if (splatPropertyCount === splatProperties.length && splatPropertyColorCount === 3) {
|
|
62096
|
+
mode = PlyMode.Splat;
|
|
62097
|
+
} else {
|
|
62098
|
+
mode = PlyMode.PointCloud;
|
|
62099
|
+
}
|
|
62100
|
+
return {
|
|
62101
|
+
format,
|
|
62102
|
+
vertexCount,
|
|
62103
|
+
faceCount,
|
|
62104
|
+
properties,
|
|
62105
|
+
faceProperties: faceProperties.length > 0 ? faceProperties : void 0,
|
|
62106
|
+
textureFiles,
|
|
62107
|
+
headerByteLength: headerText.length,
|
|
62108
|
+
mode
|
|
62109
|
+
};
|
|
62110
|
+
}
|
|
62111
|
+
/**
|
|
62112
|
+
* Initialize data parsing structures
|
|
62113
|
+
*/
|
|
62114
|
+
_initializeDataParsing(header) {
|
|
62115
|
+
this._properties = header.properties;
|
|
62116
|
+
this._propOffsets = [];
|
|
62117
|
+
this._vertexStride = 0;
|
|
62118
|
+
for (const p of this._properties) {
|
|
62119
|
+
this._propOffsets.push(this._vertexStride);
|
|
62120
|
+
this._vertexStride += byteSizeOfType(p.type);
|
|
62121
|
+
}
|
|
62122
|
+
const estimatedSize = header.vertexCount * this._vertexStride;
|
|
62123
|
+
this._dataBuffer = new Uint8Array(Math.min(estimatedSize, 1024 * 1024 * 10));
|
|
62124
|
+
this._dataOffset = 0;
|
|
62125
|
+
this._processedVertices = 0;
|
|
62126
|
+
}
|
|
62127
|
+
/**
|
|
62128
|
+
* Process data chunk
|
|
62129
|
+
*/
|
|
62130
|
+
_processDataChunk(chunk) {
|
|
62131
|
+
if (!this._header || !this._dataBuffer) return;
|
|
62132
|
+
const needed = this._dataOffset + chunk.length;
|
|
62133
|
+
if (needed > this._dataBuffer.length) {
|
|
62134
|
+
const newSize = Math.max(needed, this._dataBuffer.length * 2);
|
|
62135
|
+
const newBuffer = new Uint8Array(newSize);
|
|
62136
|
+
newBuffer.set(this._dataBuffer);
|
|
62137
|
+
this._dataBuffer = newBuffer;
|
|
62138
|
+
}
|
|
62139
|
+
this._dataBuffer.set(chunk, this._dataOffset);
|
|
62140
|
+
this._dataOffset += chunk.length;
|
|
62141
|
+
this._parseVertices();
|
|
62142
|
+
}
|
|
62143
|
+
/**
|
|
62144
|
+
* Parse vertices from current data buffer
|
|
62145
|
+
*/
|
|
62146
|
+
_parseVertices() {
|
|
62147
|
+
if (!this._header || !this._dataBuffer) return;
|
|
62148
|
+
const payload = new DataView(this._dataBuffer.buffer, this._dataBuffer.byteOffset, this._dataBuffer.byteLength);
|
|
62149
|
+
const vertexCount = this._header.vertexCount;
|
|
62150
|
+
const has = (n) => this._properties.find((p) => p.name === n) != null;
|
|
62151
|
+
const propIndex = (n) => this._properties.findIndex((p) => p.name === n);
|
|
62152
|
+
while (this._processedVertices < vertexCount && !this._cancelled) {
|
|
62153
|
+
const v = this._processedVertices;
|
|
62154
|
+
const vOffset = v * this._vertexStride;
|
|
62155
|
+
if (vOffset + this._vertexStride > this._dataOffset) {
|
|
62156
|
+
break;
|
|
62157
|
+
}
|
|
62158
|
+
if (this._cancelled) {
|
|
62159
|
+
break;
|
|
62160
|
+
}
|
|
62161
|
+
const ix = propIndex("x");
|
|
62162
|
+
const iy = propIndex("y");
|
|
62163
|
+
const iz = propIndex("z");
|
|
62164
|
+
if (ix < 0 || iy < 0 || iz < 0) {
|
|
62165
|
+
throw new Error("PLY: Missing required x/y/z properties for vertex");
|
|
62166
|
+
}
|
|
62167
|
+
const splatData = {
|
|
62168
|
+
position: [
|
|
62169
|
+
readByType(payload, vOffset + this._propOffsets[ix], this._properties[ix].type),
|
|
62170
|
+
readByType(payload, vOffset + this._propOffsets[iy], this._properties[iy].type),
|
|
62171
|
+
readByType(payload, vOffset + this._propOffsets[iz], this._properties[iz].type)
|
|
62172
|
+
]
|
|
62173
|
+
};
|
|
62174
|
+
if (has("scale_0")) {
|
|
62175
|
+
splatData.scale = [
|
|
62176
|
+
readByType(payload, vOffset + this._propOffsets[propIndex("scale_0")], this._properties[propIndex("scale_0")].type),
|
|
62177
|
+
readByType(payload, vOffset + this._propOffsets[propIndex("scale_1")], this._properties[propIndex("scale_1")].type),
|
|
62178
|
+
readByType(payload, vOffset + this._propOffsets[propIndex("scale_2")], this._properties[propIndex("scale_2")].type)
|
|
62179
|
+
];
|
|
62180
|
+
}
|
|
62181
|
+
if (has("rot_0")) {
|
|
62182
|
+
const w = readByType(payload, vOffset + this._propOffsets[propIndex("rot_0")], this._properties[propIndex("rot_0")].type);
|
|
62183
|
+
const x = readByType(payload, vOffset + this._propOffsets[propIndex("rot_1")], this._properties[propIndex("rot_1")].type);
|
|
62184
|
+
const y = readByType(payload, vOffset + this._propOffsets[propIndex("rot_2")], this._properties[propIndex("rot_2")].type);
|
|
62185
|
+
const z = readByType(payload, vOffset + this._propOffsets[propIndex("rot_3")], this._properties[propIndex("rot_3")].type);
|
|
62186
|
+
splatData.rotation = [x, y, z, w];
|
|
62187
|
+
}
|
|
62188
|
+
if (has("opacity")) {
|
|
62189
|
+
splatData.opacity = readByType(payload, vOffset + this._propOffsets[propIndex("opacity")], this._properties[propIndex("opacity")].type);
|
|
62190
|
+
}
|
|
62191
|
+
const dcIdx = [propIndex("f_dc_0"), propIndex("f_dc_1"), propIndex("f_dc_2")];
|
|
62192
|
+
if (dcIdx[0] >= 0 && dcIdx[1] >= 0 && dcIdx[2] >= 0) {
|
|
62193
|
+
const restIndices = [];
|
|
62194
|
+
for (let i = 0; i < this._properties.length; i++) {
|
|
62195
|
+
if (this._properties[i].name.startsWith("f_rest_")) restIndices.push(i);
|
|
62196
|
+
}
|
|
62197
|
+
const coeffsPerColor = 1 + restIndices.length / 3;
|
|
62198
|
+
const coeffs = new Float32Array(coeffsPerColor * 3);
|
|
62199
|
+
coeffs[0] = readByType(payload, vOffset + this._propOffsets[dcIdx[0]], this._properties[dcIdx[0]].type);
|
|
62200
|
+
coeffs[coeffsPerColor + 0] = readByType(payload, vOffset + this._propOffsets[dcIdx[1]], this._properties[dcIdx[1]].type);
|
|
62201
|
+
coeffs[2 * coeffsPerColor + 0] = readByType(payload, vOffset + this._propOffsets[dcIdx[2]], this._properties[dcIdx[2]].type);
|
|
62202
|
+
let rPtr = 1;
|
|
62203
|
+
let gPtr = 1;
|
|
62204
|
+
let bPtr = 1;
|
|
62205
|
+
for (let i = 0; i < restIndices.length; i += 3) {
|
|
62206
|
+
const ri = restIndices[i + 0];
|
|
62207
|
+
const gi = restIndices[i + 1];
|
|
62208
|
+
const bi = restIndices[i + 2];
|
|
62209
|
+
coeffs[rPtr] = readByType(payload, vOffset + this._propOffsets[ri], this._properties[ri].type);
|
|
62210
|
+
coeffs[coeffsPerColor + gPtr] = readByType(payload, vOffset + this._propOffsets[gi], this._properties[gi].type);
|
|
62211
|
+
coeffs[2 * coeffsPerColor + bPtr] = readByType(payload, vOffset + this._propOffsets[bi], this._properties[bi].type);
|
|
62212
|
+
rPtr++;
|
|
62213
|
+
gPtr++;
|
|
62214
|
+
bPtr++;
|
|
62215
|
+
}
|
|
62216
|
+
splatData.sh = {
|
|
62217
|
+
order: Math.floor(Math.sqrt(coeffsPerColor)),
|
|
62218
|
+
coeffs
|
|
62219
|
+
};
|
|
62220
|
+
}
|
|
62221
|
+
if (this._onSplatParsed) {
|
|
62222
|
+
this._onSplatParsed(splatData, v);
|
|
62223
|
+
}
|
|
62224
|
+
this._processedVertices++;
|
|
62225
|
+
if (this._processedVertices % this._batchSize === 0) {
|
|
62226
|
+
setTimeout(() => {
|
|
62227
|
+
this._parseVertices();
|
|
62228
|
+
}, 0);
|
|
62229
|
+
return;
|
|
62230
|
+
}
|
|
62231
|
+
}
|
|
62232
|
+
}
|
|
62233
|
+
/**
|
|
62234
|
+
* Get current parsing progress
|
|
62235
|
+
*/
|
|
62236
|
+
getProgress() {
|
|
62237
|
+
const total = this._header?.vertexCount || 0;
|
|
62238
|
+
return {
|
|
62239
|
+
processed: this._processedVertices,
|
|
62240
|
+
total,
|
|
62241
|
+
percentage: total > 0 ? this._processedVertices / total * 100 : 0
|
|
62242
|
+
};
|
|
62243
|
+
}
|
|
62244
|
+
}
|
|
62245
|
+
|
|
61044
62246
|
class GaussianSplatParser extends ParserBase {
|
|
61045
62247
|
static format = ParserFormat.BIN;
|
|
61046
62248
|
async parseBuffer(buffer) {
|
|
@@ -61076,6 +62278,95 @@ class GaussianSplatParser extends ParserBase {
|
|
|
61076
62278
|
}
|
|
61077
62279
|
}
|
|
61078
62280
|
|
|
62281
|
+
class StreamingGaussianSplatParser extends ParserBase {
|
|
62282
|
+
static format = ParserFormat.BIN;
|
|
62283
|
+
_streamParser = null;
|
|
62284
|
+
_streamingRenderer = null;
|
|
62285
|
+
_rendererObject = null;
|
|
62286
|
+
_chunksPerBatch = 1e3;
|
|
62287
|
+
// Number of splats to process per batch
|
|
62288
|
+
_headerParsed = false;
|
|
62289
|
+
_onHeaderParsed = null;
|
|
62290
|
+
_cancelled = false;
|
|
62291
|
+
/**
|
|
62292
|
+
* Initialize streaming parser
|
|
62293
|
+
* @param contentLength Total content length (if known)
|
|
62294
|
+
* @param onHeaderParsed Optional callback when header is parsed (parser is ready)
|
|
62295
|
+
*/
|
|
62296
|
+
async initStream(contentLength, onHeaderParsed) {
|
|
62297
|
+
this._onHeaderParsed = onHeaderParsed || null;
|
|
62298
|
+
this._rendererObject = new Object3D();
|
|
62299
|
+
this._rendererObject.name = "StreamingGaussianSplat";
|
|
62300
|
+
this._streamingRenderer = this._rendererObject.addComponent(GSplatStreamRenderer);
|
|
62301
|
+
this._streamParser = new PlyStreamParser(
|
|
62302
|
+
(header) => {
|
|
62303
|
+
if (this._streamingRenderer) {
|
|
62304
|
+
this._streamingRenderer.initCount(header.vertexCount);
|
|
62305
|
+
}
|
|
62306
|
+
if (this._rendererObject) {
|
|
62307
|
+
this.data = this._rendererObject;
|
|
62308
|
+
}
|
|
62309
|
+
this._headerParsed = true;
|
|
62310
|
+
if (this._onHeaderParsed) {
|
|
62311
|
+
this._onHeaderParsed();
|
|
62312
|
+
}
|
|
62313
|
+
},
|
|
62314
|
+
(splatData, index) => {
|
|
62315
|
+
if (this._streamingRenderer) {
|
|
62316
|
+
this._streamingRenderer.setSplatData(index, splatData);
|
|
62317
|
+
}
|
|
62318
|
+
},
|
|
62319
|
+
this._chunksPerBatch
|
|
62320
|
+
);
|
|
62321
|
+
}
|
|
62322
|
+
/**
|
|
62323
|
+
* Process incoming data chunk
|
|
62324
|
+
* @param chunk Data chunk
|
|
62325
|
+
* @param receivedLength Total bytes received so far
|
|
62326
|
+
* @param contentLength Total content length (if known)
|
|
62327
|
+
*/
|
|
62328
|
+
async processChunk(chunk, receivedLength, contentLength) {
|
|
62329
|
+
if (this._cancelled || !this._streamParser) return;
|
|
62330
|
+
this._streamParser.processChunk(chunk);
|
|
62331
|
+
}
|
|
62332
|
+
/**
|
|
62333
|
+
* Cancel streaming loading
|
|
62334
|
+
* Stops processing new chunks and cleans up resources
|
|
62335
|
+
*/
|
|
62336
|
+
cancel() {
|
|
62337
|
+
this._cancelled = true;
|
|
62338
|
+
if (this._streamParser) {
|
|
62339
|
+
this._streamParser.cancel();
|
|
62340
|
+
}
|
|
62341
|
+
}
|
|
62342
|
+
/**
|
|
62343
|
+
* Check if loading is cancelled
|
|
62344
|
+
*/
|
|
62345
|
+
isCancelled() {
|
|
62346
|
+
return this._cancelled;
|
|
62347
|
+
}
|
|
62348
|
+
/**
|
|
62349
|
+
* Finalize streaming parsing
|
|
62350
|
+
*/
|
|
62351
|
+
async finalizeStream() {
|
|
62352
|
+
if (this._rendererObject) {
|
|
62353
|
+
this.data = this._rendererObject;
|
|
62354
|
+
}
|
|
62355
|
+
}
|
|
62356
|
+
/**
|
|
62357
|
+
* Get parsing progress
|
|
62358
|
+
*/
|
|
62359
|
+
getProgress() {
|
|
62360
|
+
if (this._streamParser) {
|
|
62361
|
+
return this._streamParser.getProgress();
|
|
62362
|
+
}
|
|
62363
|
+
return { processed: 0, total: 0, percentage: 0 };
|
|
62364
|
+
}
|
|
62365
|
+
verification() {
|
|
62366
|
+
return this._headerParsed && !!this.data && !!this._streamingRenderer;
|
|
62367
|
+
}
|
|
62368
|
+
}
|
|
62369
|
+
|
|
61079
62370
|
var GeoType = /* @__PURE__ */ ((GeoType2) => {
|
|
61080
62371
|
GeoType2["Point"] = "Point";
|
|
61081
62372
|
GeoType2["LineString"] = "LineString";
|
|
@@ -71686,4 +72977,4 @@ const __viteBrowserExternal = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.def
|
|
|
71686
72977
|
__proto__: null
|
|
71687
72978
|
}, Symbol.toStringTag, { value: 'Module' }));
|
|
71688
72979
|
|
|
71689
|
-
export { AccelerateDecelerateInterpolator, AccelerateInterpolator, AnimationCurve, AnimationCurveT, AnimationMonitor, AnimatorComponent, AnimatorEventKeyframe, AnticipateInterpolator, AnticipateOvershootInterpolator, ArrayHas, ArrayItemIndex, AtlasParser, AtmosphericComponent, AtmosphericScatteringSky, AtmosphericScatteringSkySetting, AtmosphericScatteringSky_shader, AttributeAnimCurve, AxisObject, B3DMLoader, B3DMLoaderBase, B3DMParseUtil, B3DMParser, BRDFLUT, BRDFLUTGenerate, BRDF_frag, BatchTable, BiMap, BillboardComponent, BillboardType, BitUtil, BitmapTexture2D, BitmapTexture2DArray, BitmapTextureCube, Blend, BlendFactor, BlendMode, BlendShapeData, BlendShapePropertyData, BloomPost, BlurEffectCreatorBlur_cs, BlurEffectCreatorSample_cs, BlurTexture2DBufferCreator, BounceInterpolator, BoundUtil, BoundingBox, BoundingSphere, BoundingVolume, BoxColliderShape, BoxGeometry, BrdfLut_frag, BsDF_frag, BxDF_frag, BxdfDebug_frag, BytesArray, CEvent, CEventDispatcher, CEventListener, CResizeEvent, CSM, Camera3D, CameraControllerBase, CameraType, CameraUtil, CapsuleColliderShape, CastPointShadowMaterialPass, CastShadowMaterialPass, Clearcoat_frag, ClusterBoundsSource_cs, ClusterConfig, ClusterDebug_frag, ClusterLight, ClusterLightingBuffer, ClusterLightingRender, ClusterLighting_cs, CollectInfo, ColliderComponent, ColliderShape, ColliderShapeType, Color, ColorGradient, ColorLitMaterial, ColorLitShader, ColorPassFragmentOutput, ColorPassRenderer, ColorUtil, ComData, Combine_cs, Common_frag, Common_vert, ComponentBase, ComponentCollect, ComputeGPUBuffer, ComputeShader, Context3D, CubeCamera, CubeMapFaceEnum, CubeSky_Shader, CubicBezierCurve, CubicBezierPath, CubicBezierType, CycleInterpolator, CylinderGeometry, DDGIIrradianceComputePass, DDGIIrradianceGPUBufferReader, DDGIIrradianceVolume, DDGIIrradiance_shader, DDGILightingPass, DDGILighting_shader, DDGIMultiBouncePass, DDGIProbeRenderer, DEGREES_TO_RADIANS, DRACO_DECODER_GLTF_JS, DecelerateInterpolator, Denoising_cs, Depth2DTextureArray, DepthCubeArrayTexture, DepthMaterialPass, DepthOfFieldPost, DepthOfView_cs, DirectLight, DoubleArray, EditorInspector, Engine3D, Entity, EntityBatchCollect, EntityCollect, EnvMap_frag, ErpImage2CubeMap, ErpImage2CubeMapCreateCube_cs, ErpImage2CubeMapRgbe2rgba_cs, ExtrudeGeometry, FAILED, FASTFLOOR, FXAAPost, FXAAShader, FastMathShader, FatLineGeometry, FatLineMaterial, FatLineRenderer, FatLineShader, FatLine_FS, FatLine_VS, FeatureTable, FileLoader, FirstPersonCameraController, Float16ArrayTexture, Float32ArrayTexture, FlyCameraController, FontChar, FontInfo, FontPage, FontParser, ForwardRenderJob, FragmentOutput, FragmentVarying, FrameCache, Frustum, FrustumCSM, FrustumCulling_cs, FullQuad_vert_wgsl, GBufferFrame, GBufferPass, GBufferPost, GBufferStand, GBuffer_pass, GILighting, GIProbeMaterial, GIProbeMaterialType, GIProbeShader, GIRenderCompleteEvent, GIRenderStartEvent, GLBChunk, GLBHeader, GLBParser, GLSLLexer, GLSLLexerToken, GLSLPreprocessor, GLSLSyntax, GLTFBinaryExtension, GLTFMaterial, GLTFParser, GLTFSubParser, GLTFSubParserCamera, GLTFSubParserConverter, GLTFSubParserMaterial, GLTFSubParserMesh, GLTFSubParserSkeleton, GLTFSubParserSkin, GLTFType, GLTF_Accessors, GLTF_Info, GLTF_Light, GLTF_Mesh, GLTF_Node, GLTF_Primitives, GLTF_Scene, GPUAddressMode, GPUBlendFactor, GPUBufferBase, GPUBufferType, GPUCompareFunction, GPUContext, GPUCullMode, GPUFilterMode, GPUPrimitiveTopology, GPUTextureFormat, GPUVertexFormat, GPUVertexStepMode, GSplatFormat, GSplatGeometry, GSplatMaterial, GSplatRenderer, GSplatShader, GSplat_FS, GSplat_VS, GTAOPost, GTAO_cs, GUIAtlasTexture, GUICanvas, GUIConfig, GUIGeometry, GUIGeometryRebuild, GUIMaterial, GUIPassRenderer, GUIPick, GUIPickHelper, GUIQuad, GUIQuadAttrEnum, GUIRenderer, GUIShader, GUISpace, GUISprite, GUITexture, GaussianSplatParser, GenerayRandomDir, GeoJsonParser, GeoJsonUtil, GeoType, GeometryBase, GeometryIndicesBuffer, GeometryUtil, GeometryVertexBuffer, GeometryVertexType, GetComponentClass, GetCountInstanceID, GetRepeat, GetShader, GlassShader, GlobalBindGroup, GlobalBindGroupLayout, GlobalFog, GlobalFog_shader, GlobalIlluminationComponent, GlobalUniform, GlobalUniformGroup, GodRayPost, GodRay_cs, GridObject, HDRTexture, HDRTextureCube, Hair_frag, Hair_shader_op, Hair_shader_tr, HaltonSeq, Horizontal, HoverCameraController, I3DMLoader, I3DMLoaderBase, I3DMParser, IBLEnvMapCreator, IBLEnvMapCreator_cs, IESProfiles, IESProfiles_frag, IKDTreeUserData, ImageType, IndicesGPUBuffer, Inline_vert, InputSystem, InstanceDrawComponent, InstanceUniform, InstancedMesh, Interpolator, InterpolatorEnum, IrradianceDataReaderCompleteEvent, IrradianceVolumeData_frag, Irradiance_frag, IsEditorInspector, IsNonSerialize, Joint, JointPose, JumperInterpolator, KDTreeEntity, KDTreeNode, KDTreeRange, KDTreeSpace, KDTreeUUID, KHR_draco_mesh_compression, KHR_lights_punctual, KHR_materials_clearcoat, KHR_materials_emissive_strength, KHR_materials_ior, KHR_materials_unlit, KMZParser, KV, KelvinUtil, KeyCode, KeyEvent, Keyframe, KeyframeT, LASLoader, LASParser, LASUtils, LASVisualizationMode, LDRTextureCube, LOADED, LOADING, LRUCache, LambertMaterial, Lambert_shader, Light, LightBase, LightData, LightEntries, LightType, LightingFunction_frag, Line, LineClassification, LinearInterpolator, LitMaterial, LitSSSShader, LitShader, Lit_shader, LoaderBase, LoaderEvent, LoaderManager, MAX_VALUE, MIN_VALUE, Material, MaterialDataUniformGPUBuffer, MaterialUtilities, MathShader, MathUtil, Matrix3, Matrix4, MatrixBindGroup, MatrixGPUBuffer, MatrixShader, MemoryDO, MemoryInfo, MergeRGBACreator, MergeRGBA_cs, MeshColliderShape, MeshFilter, MeshRenderer, MinMaxAnimationCurves, MinMaxCurve, MinMaxCurveState, MinMaxPolyCurves, MorePassParser, MorePassShader, MorphTargetBlender, MorphTargetData, MorphTargetFrame, MorphTargetTransformKey, MorphTarget_shader, MouseCode, MultiBouncePass_cs, Navi3DAstar, Navi3DConst, Navi3DEdge, Navi3DFunnel, Navi3DMaskType, Navi3DMesh, Navi3DPoint, Navi3DPoint2D, Navi3DPointFat, Navi3DRouter, Navi3DTriangle, NonSerialize, NormalMap_frag, OAnimationEvent, OBJParser, Object3D, Object3DEvent, Object3DTransformTools, Object3DUtil, ObjectAnimClip, OcclusionSystem, Octree, OctreeEntity, OrbitController, OrderMap, Orientation3D, OutLineBlendColor_cs, OutlineCalcOutline_cs, OutlinePass, OutlinePost, OutlinePostData, OutlinePostManager, OutlinePostSlot, Outline_cs, OvershootInterpolator, PARSING, PBRLItShader, PBRLitSSSShader, PLUGIN_REGISTERED, PNTSLoader, PNTSLoaderBase, PNTSParser, ParserBase, ParserFormat, ParticleSystemCurveEvalMode, ParticleSystemRandomnessIds, PassGenerate, PassShader, PassType, PhysicMaterialUniform_frag, PickCompute, PickFire, PickGUIEvent3D, PickResult, Picker_cs, PingPong, PipelinePool, Plane3D, PlaneClassification, PlaneGeometry, PlyMode, PlyParser, PointClassification, PointCloudGeometry, PointCloudMaterial, PointCloudRenderer, PointCloudShader, PointCloud_FS, PointCloud_VS, PointLight, PointLightShadowRenderer, PointShadowCubeCamera, PointerEvent3D, Polynomial, PolynomialCurve, Polynomials, PoolNode, PostBase, PostProcessingComponent, PostRenderer, PreDepthPassRenderer, PreFilteredEnvironment_cs, PreFilteredEnvironment_cs2, PreIntegratedLut, PreIntegratedLutCompute, PrefabAvatarData, PrefabAvatarParser, PrefabBoneData, PrefabMaterialParser, PrefabMeshData, PrefabMeshParser, PrefabNode, PrefabParser, PrefabStringUtil, PrefabTextureData, PrefabTextureParser, Preprocessor, PriorityQueue, Probe, ProbeEntries, ProbeGBufferFrame, ProfilerUtil, PropertyAnimClip, PropertyAnimTag, PropertyAnimation, PropertyAnimationClip, PropertyAnimationClipState, PropertyAnimationEvent, PropertyHelp, QuadAABB, QuadGlsl_fs, QuadGlsl_vs, QuadRoot, QuadShader, QuadTree, QuadTreeCell, Quad_depth2dArray_frag_wgsl, Quad_depth2d_frag_wgsl, Quad_depthCube_frag_wgsl, Quad_frag_wgsl, Quad_vert_wgsl, Quaternion, R32UintTexture, RADIANS_TO_DEGREES, RGBEErrorCode, RGBEHeader, RGBEParser, RTDescriptor, RTFrame, RTResourceConfig, RTResourceMap, Rand, RandomSeed, Ray, RayCastMeshDetail, Reader, Rect, Reference, Reflection, ReflectionCG, ReflectionEntries, ReflectionMaterial, ReflectionRenderer, ReflectionShader, ReflectionShader_shader, RegisterComponent, RegisterShader, RenderContext, RenderLayer, RenderLayerUtil, RenderNode, RenderShaderCollect, RenderShaderCompute, RenderShaderPass, RenderTexture, RendererBase, RendererJob, RendererMap, RendererMask, RendererMaskUtil, RendererPassState, RepeatSE, Res, RotationControlComponents, SHCommon_frag, SN_ArrayConstant, SN_BinaryOperation, SN_Break, SN_CodeBlock, SN_Constant, SN_Continue, SN_Declaration, SN_Discard, SN_DoWhileLoop, SN_Expression, SN_ForLoop, SN_Function, SN_FunctionArgs, SN_FunctionCall, SN_IFBranch, SN_Identifier, SN_IndexOperation, SN_Layout, SN_ParenExpression, SN_Precision, SN_Return, SN_SelectOperation, SN_Struct, SN_TernaryOperation, SN_UnaryOperation, SN_WhileLoop, SSAO_cs, SSGI2_cs, SSGIPost, SSRPost, SSR_BlendColor_cs, SSR_IS_Kernel, SSR_IS_cs, SSR_RayTrace_cs, ScaleControlComponents, Scene3D, Shader, ShaderAttributeInfo, ShaderConverter, ShaderConverterResult, ShaderLib, ShaderPassBase, ShaderReflection, ShaderStage, ShaderState, ShaderUniformInfo, ShaderUtil, ShadingInput, ShadowLightsCollect, ShadowMapPassRenderer, ShadowMapping_frag, Skeleton, SkeletonAnimationClip, SkeletonAnimationClipState, SkeletonAnimationComponent, SkeletonAnimationCompute, SkeletonAnimation_shader, SkeletonBlendComputeArgs, SkeletonPose, SkeletonTransformComputeArgs, SkinnedMeshRenderer, SkinnedMeshRenderer2, SkyGBufferPass, SkyGBuffer_pass, SkyMaterial, SkyRenderer, SkyShader, SolidColorSky, SphereColliderShape, SphereGeometry, SphereReflection, SpotLight, StandShader, StatementNode, StorageGPUBuffer, StringUtil, Struct, StructStorageGPUBuffer, SubGeometry, TAACopyTex_cs, TAAPost, TAASharpTex_cs, TAA_cs, TestComputeLoadBuffer, TextAnchor, TextFieldLayout, TextFieldLine, Texture, TextureCube, TextureCubeFaceData, TextureCubeStdCreator, TextureCubeUtils, TextureMipmapCompute, TextureMipmapGenerator, TextureScaleCompute, ThirdPersonCameraController, Tile, TileSet, TileSetChild, TileSetChildContent, TileSetChildContentMetaData, TileSetRoot, TilesRenderer, Time, TokenType, TorusGeometry, TouchData, TrailGeometry, Transform, TransformAxisEnum, TransformControllerBaseComponent, TransformMode, TransformSpaceMode, TranslationControlComponents, TranslatorContext, TriGeometry, Triangle, UIButton, UIButtonTransition, UIComponentBase, UIEvent, UIImage, UIImageGroup, UIInteractive, UIInteractiveStyle, UIPanel, UIRenderAble, UIShadow, UITextField, UITransform, UNLOADED, UUID, UV, Uint32ArrayTexture, Uint8ArrayTexture, UnLit, UnLitMaterial, UnLitMaterialUniform_frag, UnLitShader, UnLitTexArrayMaterial, UnLitTexArrayShader, UnLitTextureArray, UnLit_frag, UniformGPUBuffer, UniformNode, UniformType, ValueEnumType, ValueOp, ValueParser, ValueSpread, Vector2, Vector3, Vector3Ex, Vector4, VertexAttribute, VertexAttributeIndexShader, VertexAttributeName, VertexAttributeSize, VertexAttributeStride, VertexAttributes_vert, VertexBufferLayout, VertexFormat, VertexGPUBuffer, Vertical, VideoUniform_frag, View3D, ViewPanel, ViewQuad, VirtualTexture, WGS84_FLATTENING, WGS84_HEIGHT, WGS84_RADIUS, WGSLTranslator, WayLines3D, WayPoint3D, WebGPUDescriptorCreator, WorldMatrixUniform, WorldPanel, WrapMode, WrapTimeMode, ZCullingCompute, ZPassShader_cs, ZPassShader_fs, ZPassShader_vs, ZSorterUtil, append, arrayToString, blendComponent, buildCurves, byteSizeOfType, calculateCurveRangesValue, calculateMinMax, castPointShadowMap_vert, clamp, clampRepeat, computeAABBFromPositions, cos, crossProduct, cubicPolynomialRoot, cubicPolynomialRootsGeneric, curvesSupportProcedural, deg2Rad, detectGSplatFormat, directionShadowCastMap_frag, dot, doubleIntegrateSegment, downSample, fastInvSqrt, floorfToIntPos, fonts, generateRandom, generateRandom3, getFloatFromInt, getGLTypeFromTypedArray, getGLTypeFromTypedArrayType, getGlobalRandomSeed, getTypedArray, getTypedArrayTypeFromGLType, grad1, grad2, grad3, grad4, inferSHOrder, integrateSegment, irradianceDataReader, kPI, lerp, lerpByte, lerpColor, lerpVector3, lruPriorityCallback, magnitude, makeAloneSprite, makeGUISprite, makeMatrix44, markUsedSetLeaves, markUsedTiles, markVisibleTiles, matrixMultiply, matrixRotate, matrixRotateY, mergeFunctions, multiplyMatrices4x4REF, normal_distribution, normalizeFast, normalizeSafe, normalizedToByte, normalizedToWord, outlinePostData, outlinePostManager, parsePlyGaussianSplat, parsePlyHeader, parsePlyMesh, parsePlyPointCloud, perm, post, priorityCallback, quadraticPolynomialRootsGeneric, rad2Deg, random01, randomBarycentricCoord, randomPointBetweenEllipsoid, randomPointBetweenSphere, randomPointInsideCube, randomPointInsideEllipsoid, randomPointInsideUnitCircle, randomPointInsideUnitSphere, randomQuaternion, randomQuaternionUniformDistribution, randomSeed, randomUnitVector, randomUnitVector2, rangedRandomFloat, rangedRandomInt, readByType, readMagicBytes, registerMaterial, repeat, rotMatrix, rotateVectorByQuat, roundfToIntPos, scale, shadowCastMap_frag, shadowCastMap_vert, simplex, sin, snoise1, snoise2, snoise3, snoise4, splatColorProperties, splatProperties, sqrMagnitude, sqrtImpl, stencilStateFace, swap, textureCompress, threshold, throttle, toHalfFloat, toggleTiles, traverseAncestors, traverseSet, tw, uniform_real_distribution, uniform_real_distribution2, upSample$1 as upSample, webGPUContext, zSorterUtil };
|
|
72980
|
+
export { AccelerateDecelerateInterpolator, AccelerateInterpolator, AnimationCurve, AnimationCurveT, AnimationMonitor, AnimatorComponent, AnimatorEventKeyframe, AnticipateInterpolator, AnticipateOvershootInterpolator, ArrayHas, ArrayItemIndex, AtlasParser, AtmosphericComponent, AtmosphericScatteringSky, AtmosphericScatteringSkySetting, AtmosphericScatteringSky_shader, AttributeAnimCurve, AxisObject, B3DMLoader, B3DMLoaderBase, B3DMParseUtil, B3DMParser, BRDFLUT, BRDFLUTGenerate, BRDF_frag, BatchTable, BiMap, BillboardComponent, BillboardType, BitUtil, BitmapTexture2D, BitmapTexture2DArray, BitmapTextureCube, Blend, BlendFactor, BlendMode, BlendShapeData, BlendShapePropertyData, BloomPost, BlurEffectCreatorBlur_cs, BlurEffectCreatorSample_cs, BlurTexture2DBufferCreator, BounceInterpolator, BoundUtil, BoundingBox, BoundingSphere, BoundingVolume, BoxColliderShape, BoxGeometry, BrdfLut_frag, BsDF_frag, BxDF_frag, BxdfDebug_frag, BytesArray, CEvent, CEventDispatcher, CEventListener, CResizeEvent, CSM, Camera3D, CameraControllerBase, CameraType, CameraUtil, CapsuleColliderShape, CastPointShadowMaterialPass, CastShadowMaterialPass, Clearcoat_frag, ClusterBoundsSource_cs, ClusterConfig, ClusterDebug_frag, ClusterLight, ClusterLightingBuffer, ClusterLightingRender, ClusterLighting_cs, CollectInfo, ColliderComponent, ColliderShape, ColliderShapeType, Color, ColorGradient, ColorLitMaterial, ColorLitShader, ColorPassFragmentOutput, ColorPassRenderer, ColorUtil, ComData, Combine_cs, Common_frag, Common_vert, ComponentBase, ComponentCollect, ComputeGPUBuffer, ComputeShader, Context3D, CubeCamera, CubeMapFaceEnum, CubeSky_Shader, CubicBezierCurve, CubicBezierPath, CubicBezierType, CycleInterpolator, CylinderGeometry, DDGIIrradianceComputePass, DDGIIrradianceGPUBufferReader, DDGIIrradianceVolume, DDGIIrradiance_shader, DDGILightingPass, DDGILighting_shader, DDGIMultiBouncePass, DDGIProbeRenderer, DEGREES_TO_RADIANS, DRACO_DECODER_GLTF_JS, DecelerateInterpolator, Denoising_cs, Depth2DTextureArray, DepthCubeArrayTexture, DepthMaterialPass, DepthOfFieldPost, DepthOfView_cs, DirectLight, DoubleArray, EditorInspector, Engine3D, Entity, EntityBatchCollect, EntityCollect, EnvMap_frag, ErpImage2CubeMap, ErpImage2CubeMapCreateCube_cs, ErpImage2CubeMapRgbe2rgba_cs, ExtrudeGeometry, FAILED, FASTFLOOR, FXAAPost, FXAAShader, FastMathShader, FatLineGeometry, FatLineMaterial, FatLineRenderer, FatLineShader, FatLine_FS, FatLine_VS, FeatureTable, FileLoader, FirstPersonCameraController, Float16ArrayTexture, Float32ArrayTexture, FlyCameraController, FontChar, FontInfo, FontPage, FontParser, ForwardRenderJob, FragmentOutput, FragmentVarying, FrameCache, Frustum, FrustumCSM, FrustumCulling_cs, FullQuad_vert_wgsl, GBufferFrame, GBufferPass, GBufferPost, GBufferStand, GBuffer_pass, GILighting, GIProbeMaterial, GIProbeMaterialType, GIProbeShader, GIRenderCompleteEvent, GIRenderStartEvent, GLBChunk, GLBHeader, GLBParser, GLSLLexer, GLSLLexerToken, GLSLPreprocessor, GLSLSyntax, GLTFBinaryExtension, GLTFMaterial, GLTFParser, GLTFSubParser, GLTFSubParserCamera, GLTFSubParserConverter, GLTFSubParserMaterial, GLTFSubParserMesh, GLTFSubParserSkeleton, GLTFSubParserSkin, GLTFType, GLTF_Accessors, GLTF_Info, GLTF_Light, GLTF_Mesh, GLTF_Node, GLTF_Primitives, GLTF_Scene, GPUAddressMode, GPUBlendFactor, GPUBufferBase, GPUBufferType, GPUCompareFunction, GPUContext, GPUCullMode, GPUFilterMode, GPUPrimitiveTopology, GPUTextureFormat, GPUVertexFormat, GPUVertexStepMode, GSplatFormat, GSplatGeometry, GSplatMaterial, GSplatRenderer, GSplatShader, GSplatStreamRenderer, GSplat_FS, GSplat_VS, GTAOPost, GTAO_cs, GUIAtlasTexture, GUICanvas, GUIConfig, GUIGeometry, GUIGeometryRebuild, GUIMaterial, GUIPassRenderer, GUIPick, GUIPickHelper, GUIQuad, GUIQuadAttrEnum, GUIRenderer, GUIShader, GUISpace, GUISprite, GUITexture, GaussianSplatParser, GenerayRandomDir, GeoJsonParser, GeoJsonUtil, GeoType, GeometryBase, GeometryIndicesBuffer, GeometryUtil, GeometryVertexBuffer, GeometryVertexType, GetComponentClass, GetCountInstanceID, GetRepeat, GetShader, GlassShader, GlobalBindGroup, GlobalBindGroupLayout, GlobalFog, GlobalFog_shader, GlobalIlluminationComponent, GlobalUniform, GlobalUniformGroup, GodRayPost, GodRay_cs, GridObject, HDRTexture, HDRTextureCube, Hair_frag, Hair_shader_op, Hair_shader_tr, HaltonSeq, Horizontal, HoverCameraController, I3DMLoader, I3DMLoaderBase, I3DMParser, IBLEnvMapCreator, IBLEnvMapCreator_cs, IESProfiles, IESProfiles_frag, IKDTreeUserData, ImageType, IndicesGPUBuffer, Inline_vert, InputSystem, InstanceDrawComponent, InstanceUniform, InstancedMesh, Interpolator, InterpolatorEnum, IrradianceDataReaderCompleteEvent, IrradianceVolumeData_frag, Irradiance_frag, IsEditorInspector, IsNonSerialize, Joint, JointPose, JumperInterpolator, KDTreeEntity, KDTreeNode, KDTreeRange, KDTreeSpace, KDTreeUUID, KHR_draco_mesh_compression, KHR_lights_punctual, KHR_materials_clearcoat, KHR_materials_emissive_strength, KHR_materials_ior, KHR_materials_unlit, KMZParser, KV, KelvinUtil, KeyCode, KeyEvent, Keyframe, KeyframeT, LASLoader, LASParser, LASUtils, LASVisualizationMode, LDRTextureCube, LOADED, LOADING, LRUCache, LambertMaterial, Lambert_shader, Light, LightBase, LightData, LightEntries, LightType, LightingFunction_frag, Line, LineClassification, LinearInterpolator, LitMaterial, LitSSSShader, LitShader, Lit_shader, LoaderBase, LoaderEvent, LoaderManager, MAX_VALUE, MIN_VALUE, Material, MaterialDataUniformGPUBuffer, MaterialUtilities, MathShader, MathUtil, Matrix3, Matrix4, MatrixBindGroup, MatrixGPUBuffer, MatrixShader, MemoryDO, MemoryInfo, MergeRGBACreator, MergeRGBA_cs, MeshColliderShape, MeshFilter, MeshRenderer, MinMaxAnimationCurves, MinMaxCurve, MinMaxCurveState, MinMaxPolyCurves, MorePassParser, MorePassShader, MorphTargetBlender, MorphTargetData, MorphTargetFrame, MorphTargetTransformKey, MorphTarget_shader, MouseCode, MultiBouncePass_cs, Navi3DAstar, Navi3DConst, Navi3DEdge, Navi3DFunnel, Navi3DMaskType, Navi3DMesh, Navi3DPoint, Navi3DPoint2D, Navi3DPointFat, Navi3DRouter, Navi3DTriangle, NonSerialize, NormalMap_frag, OAnimationEvent, OBJParser, Object3D, Object3DEvent, Object3DTransformTools, Object3DUtil, ObjectAnimClip, OcclusionSystem, Octree, OctreeEntity, OrbitController, OrderMap, Orientation3D, OutLineBlendColor_cs, OutlineCalcOutline_cs, OutlinePass, OutlinePost, OutlinePostData, OutlinePostManager, OutlinePostSlot, Outline_cs, OvershootInterpolator, PARSING, PBRLItShader, PBRLitSSSShader, PLUGIN_REGISTERED, PNTSLoader, PNTSLoaderBase, PNTSParser, ParserBase, ParserFormat, ParticleSystemCurveEvalMode, ParticleSystemRandomnessIds, PassGenerate, PassShader, PassType, PhysicMaterialUniform_frag, PickCompute, PickFire, PickGUIEvent3D, PickResult, Picker_cs, PingPong, PipelinePool, Plane3D, PlaneClassification, PlaneGeometry, PlyMode, PlyParser, PlyStreamParser, PointClassification, PointCloudGeometry, PointCloudMaterial, PointCloudRenderer, PointCloudShader, PointCloud_FS, PointCloud_VS, PointLight, PointLightShadowRenderer, PointShadowCubeCamera, PointerEvent3D, Polynomial, PolynomialCurve, Polynomials, PoolNode, PostBase, PostProcessingComponent, PostRenderer, PreDepthPassRenderer, PreFilteredEnvironment_cs, PreFilteredEnvironment_cs2, PreIntegratedLut, PreIntegratedLutCompute, PrefabAvatarData, PrefabAvatarParser, PrefabBoneData, PrefabMaterialParser, PrefabMeshData, PrefabMeshParser, PrefabNode, PrefabParser, PrefabStringUtil, PrefabTextureData, PrefabTextureParser, Preprocessor, PriorityQueue, Probe, ProbeEntries, ProbeGBufferFrame, ProfilerUtil, PropertyAnimClip, PropertyAnimTag, PropertyAnimation, PropertyAnimationClip, PropertyAnimationClipState, PropertyAnimationEvent, PropertyHelp, QuadAABB, QuadGlsl_fs, QuadGlsl_vs, QuadRoot, QuadShader, QuadTree, QuadTreeCell, Quad_depth2dArray_frag_wgsl, Quad_depth2d_frag_wgsl, Quad_depthCube_frag_wgsl, Quad_frag_wgsl, Quad_vert_wgsl, Quaternion, R32UintTexture, RADIANS_TO_DEGREES, RGBEErrorCode, RGBEHeader, RGBEParser, RTDescriptor, RTFrame, RTResourceConfig, RTResourceMap, Rand, RandomSeed, Ray, RayCastMeshDetail, Reader, Rect, Reference, Reflection, ReflectionCG, ReflectionEntries, ReflectionMaterial, ReflectionRenderer, ReflectionShader, ReflectionShader_shader, RegisterComponent, RegisterShader, RenderContext, RenderLayer, RenderLayerUtil, RenderNode, RenderShaderCollect, RenderShaderCompute, RenderShaderPass, RenderTexture, RendererBase, RendererJob, RendererMap, RendererMask, RendererMaskUtil, RendererPassState, RepeatSE, Res, RotationControlComponents, SHCommon_frag, SN_ArrayConstant, SN_BinaryOperation, SN_Break, SN_CodeBlock, SN_Constant, SN_Continue, SN_Declaration, SN_Discard, SN_DoWhileLoop, SN_Expression, SN_ForLoop, SN_Function, SN_FunctionArgs, SN_FunctionCall, SN_IFBranch, SN_Identifier, SN_IndexOperation, SN_Layout, SN_ParenExpression, SN_Precision, SN_Return, SN_SelectOperation, SN_Struct, SN_TernaryOperation, SN_UnaryOperation, SN_WhileLoop, SSAO_cs, SSGI2_cs, SSGIPost, SSRPost, SSR_BlendColor_cs, SSR_IS_Kernel, SSR_IS_cs, SSR_RayTrace_cs, ScaleControlComponents, Scene3D, Shader, ShaderAttributeInfo, ShaderConverter, ShaderConverterResult, ShaderLib, ShaderPassBase, ShaderReflection, ShaderStage, ShaderState, ShaderUniformInfo, ShaderUtil, ShadingInput, ShadowLightsCollect, ShadowMapPassRenderer, ShadowMapping_frag, Skeleton, SkeletonAnimationClip, SkeletonAnimationClipState, SkeletonAnimationComponent, SkeletonAnimationCompute, SkeletonAnimation_shader, SkeletonBlendComputeArgs, SkeletonPose, SkeletonTransformComputeArgs, SkinnedMeshRenderer, SkinnedMeshRenderer2, SkyGBufferPass, SkyGBuffer_pass, SkyMaterial, SkyRenderer, SkyShader, SolidColorSky, SphereColliderShape, SphereGeometry, SphereReflection, SpotLight, StandShader, StatementNode, StorageGPUBuffer, StreamLoader, StreamingGaussianSplatParser, StringUtil, Struct, StructStorageGPUBuffer, SubGeometry, TAACopyTex_cs, TAAPost, TAASharpTex_cs, TAA_cs, TestComputeLoadBuffer, TextAnchor, TextFieldLayout, TextFieldLine, Texture, TextureCube, TextureCubeFaceData, TextureCubeStdCreator, TextureCubeUtils, TextureMipmapCompute, TextureMipmapGenerator, TextureScaleCompute, ThirdPersonCameraController, Tile, TileSet, TileSetChild, TileSetChildContent, TileSetChildContentMetaData, TileSetRoot, TilesRenderer, Time, TokenType, TorusGeometry, TouchData, TrailGeometry, Transform, TransformAxisEnum, TransformControllerBaseComponent, TransformMode, TransformSpaceMode, TranslationControlComponents, TranslatorContext, TriGeometry, Triangle, UIButton, UIButtonTransition, UIComponentBase, UIEvent, UIImage, UIImageGroup, UIInteractive, UIInteractiveStyle, UIPanel, UIRenderAble, UIShadow, UITextField, UITransform, UNLOADED, UUID, UV, Uint32ArrayTexture, Uint8ArrayTexture, UnLit, UnLitMaterial, UnLitMaterialUniform_frag, UnLitShader, UnLitTexArrayMaterial, UnLitTexArrayShader, UnLitTextureArray, UnLit_frag, UniformGPUBuffer, UniformNode, UniformType, ValueEnumType, ValueOp, ValueParser, ValueSpread, Vector2, Vector3, Vector3Ex, Vector4, VertexAttribute, VertexAttributeIndexShader, VertexAttributeName, VertexAttributeSize, VertexAttributeStride, VertexAttributes_vert, VertexBufferLayout, VertexFormat, VertexGPUBuffer, Vertical, VideoUniform_frag, View3D, ViewPanel, ViewQuad, VirtualTexture, WGS84_FLATTENING, WGS84_HEIGHT, WGS84_RADIUS, WGSLTranslator, WayLines3D, WayPoint3D, WebGPUDescriptorCreator, WorldMatrixUniform, WorldPanel, WrapMode, WrapTimeMode, ZCullingCompute, ZPassShader_cs, ZPassShader_fs, ZPassShader_vs, ZSorterUtil, append, arrayToString, blendComponent, buildCurves, byteSizeOfType, calculateCurveRangesValue, calculateMinMax, castPointShadowMap_vert, clamp, clampRepeat, computeAABBFromPositions, cos, crossProduct, cubicPolynomialRoot, cubicPolynomialRootsGeneric, curvesSupportProcedural, deg2Rad, detectGSplatFormat, directionShadowCastMap_frag, dot, doubleIntegrateSegment, downSample, fastInvSqrt, floorfToIntPos, fonts, generateRandom, generateRandom3, getFloatFromInt, getGLTypeFromTypedArray, getGLTypeFromTypedArrayType, getGlobalRandomSeed, getTypedArray, getTypedArrayTypeFromGLType, grad1, grad2, grad3, grad4, inferSHOrder, integrateSegment, irradianceDataReader, kPI, lerp, lerpByte, lerpColor, lerpVector3, lruPriorityCallback, magnitude, makeAloneSprite, makeGUISprite, makeMatrix44, markUsedSetLeaves, markUsedTiles, markVisibleTiles, matrixMultiply, matrixRotate, matrixRotateY, mergeFunctions, multiplyMatrices4x4REF, normal_distribution, normalizeFast, normalizeSafe, normalizedToByte, normalizedToWord, outlinePostData, outlinePostManager, parsePlyGaussianSplat, parsePlyHeader, parsePlyMesh, parsePlyPointCloud, perm, post, priorityCallback, quadraticPolynomialRootsGeneric, rad2Deg, random01, randomBarycentricCoord, randomPointBetweenEllipsoid, randomPointBetweenSphere, randomPointInsideCube, randomPointInsideEllipsoid, randomPointInsideUnitCircle, randomPointInsideUnitSphere, randomQuaternion, randomQuaternionUniformDistribution, randomSeed, randomUnitVector, randomUnitVector2, rangedRandomFloat, rangedRandomInt, readByType, readMagicBytes, registerMaterial, repeat, rotMatrix, rotateVectorByQuat, roundfToIntPos, scale, shadowCastMap_frag, shadowCastMap_vert, simplex, sin, snoise1, snoise2, snoise3, snoise4, splatColorProperties, splatProperties, sqrMagnitude, sqrtImpl, stencilStateFace, swap, textureCompress, threshold, throttle, toHalfFloat, toggleTiles, traverseAncestors, traverseSet, tw, uniform_real_distribution, uniform_real_distribution2, upSample$1 as upSample, webGPUContext, zSorterUtil };
|