@babylonjs/core 9.2.0 → 9.2.2
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/Animations/animation.d.ts +9 -0
- package/Animations/animation.js +9 -0
- package/Animations/animation.js.map +1 -1
- package/Animations/runtimeAnimation.js +28 -0
- package/Animations/runtimeAnimation.js.map +1 -1
- package/Cameras/Inputs/geospatialCameraPointersInput.js +10 -8
- package/Cameras/Inputs/geospatialCameraPointersInput.js.map +1 -1
- package/Cameras/geospatialCameraMovement.js +21 -21
- package/Cameras/geospatialCameraMovement.js.map +1 -1
- package/Debug/physicsViewer.js +2 -12
- package/Debug/physicsViewer.js.map +1 -1
- package/Engines/abstractEngine.js +2 -2
- package/Engines/abstractEngine.js.map +1 -1
- package/Engines/webgpuEngine.js +2 -0
- package/Engines/webgpuEngine.js.map +1 -1
- package/FlowGraph/Blocks/flowGraphBlockFactory.js +14 -1
- package/FlowGraph/Blocks/flowGraphBlockFactory.js.map +1 -1
- package/FlowGraph/flowGraph.js +6 -0
- package/FlowGraph/flowGraph.js.map +1 -1
- package/FlowGraph/flowGraphEventBlock.d.ts +10 -0
- package/FlowGraph/flowGraphEventBlock.js +24 -0
- package/FlowGraph/flowGraphEventBlock.js.map +1 -1
- package/FlowGraph/flowGraphParser.js +23 -4
- package/FlowGraph/flowGraphParser.js.map +1 -1
- package/FlowGraph/serialization.js +36 -14
- package/FlowGraph/serialization.js.map +1 -1
- package/FrameGraph/Node/Blocks/Rendering/iblShadowsRendererBlock.d.ts +105 -0
- package/FrameGraph/Node/Blocks/Rendering/iblShadowsRendererBlock.js +318 -0
- package/FrameGraph/Node/Blocks/Rendering/iblShadowsRendererBlock.js.map +1 -0
- package/FrameGraph/Node/Blocks/index.d.ts +1 -0
- package/FrameGraph/Node/Blocks/index.js +1 -0
- package/FrameGraph/Node/Blocks/index.js.map +1 -1
- package/FrameGraph/Tasks/Rendering/iblShadows/iblShadowsAccumulationTask.d.ts +34 -0
- package/FrameGraph/Tasks/Rendering/iblShadows/iblShadowsAccumulationTask.js +144 -0
- package/FrameGraph/Tasks/Rendering/iblShadows/iblShadowsAccumulationTask.js.map +1 -0
- package/FrameGraph/Tasks/Rendering/iblShadows/iblShadowsSpatialBlurTask.d.ts +26 -0
- package/FrameGraph/Tasks/Rendering/iblShadows/iblShadowsSpatialBlurTask.js +82 -0
- package/FrameGraph/Tasks/Rendering/iblShadows/iblShadowsSpatialBlurTask.js.map +1 -0
- package/FrameGraph/Tasks/Rendering/iblShadows/iblShadowsTracingTask.d.ts +61 -0
- package/FrameGraph/Tasks/Rendering/iblShadows/iblShadowsTracingTask.js +207 -0
- package/FrameGraph/Tasks/Rendering/iblShadows/iblShadowsTracingTask.js.map +1 -0
- package/FrameGraph/Tasks/Rendering/iblShadows/iblShadowsVoxelizationTask.d.ts +104 -0
- package/FrameGraph/Tasks/Rendering/iblShadows/iblShadowsVoxelizationTask.js +218 -0
- package/FrameGraph/Tasks/Rendering/iblShadows/iblShadowsVoxelizationTask.js.map +1 -0
- package/FrameGraph/Tasks/Rendering/iblShadowsRendererTask.d.ts +217 -0
- package/FrameGraph/Tasks/Rendering/iblShadowsRendererTask.js +640 -0
- package/FrameGraph/Tasks/Rendering/iblShadowsRendererTask.js.map +1 -0
- package/FrameGraph/frameGraph.js +1 -0
- package/FrameGraph/frameGraph.js.map +1 -1
- package/FrameGraph/index.d.ts +1 -0
- package/FrameGraph/index.js +1 -0
- package/FrameGraph/index.js.map +1 -1
- package/Gizmos/boundingBoxGizmo.js +4 -0
- package/Gizmos/boundingBoxGizmo.js.map +1 -1
- package/Layers/thinEffectLayer.js +8 -1
- package/Layers/thinEffectLayer.js.map +1 -1
- package/Lights/Clustered/clusteredLightContainer.js +8 -5
- package/Lights/Clustered/clusteredLightContainer.js.map +1 -1
- package/Loading/Plugins/babylonFileLoader.js +26 -0
- package/Loading/Plugins/babylonFileLoader.js.map +1 -1
- package/Materials/GaussianSplatting/gaussianSplattingMaterial.js +15 -2
- package/Materials/GaussianSplatting/gaussianSplattingMaterial.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/fragmentOutputBlock.js +3 -1
- package/Materials/Node/Blocks/Fragment/fragmentOutputBlock.js.map +1 -1
- package/Materials/PBR/openpbrMaterial.d.ts +13 -2
- package/Materials/PBR/openpbrMaterial.js +47 -16
- package/Materials/PBR/openpbrMaterial.js.map +1 -1
- package/Materials/PBR/pbrBRDFConfiguration.js +1 -1
- package/Materials/PBR/pbrBRDFConfiguration.js.map +1 -1
- package/Materials/Textures/Filtering/hdrFiltering.js +6 -0
- package/Materials/Textures/Filtering/hdrFiltering.js.map +1 -1
- package/Materials/Textures/envCubeTexture.js +13 -13
- package/Materials/Textures/envCubeTexture.js.map +1 -1
- package/Materials/materialHelper.functions.js +1 -1
- package/Materials/materialHelper.functions.js.map +1 -1
- package/Meshes/GaussianSplatting/gaussianSplattingCompoundMesh.d.ts +18 -4
- package/Meshes/GaussianSplatting/gaussianSplattingCompoundMesh.js +29 -4
- package/Meshes/GaussianSplatting/gaussianSplattingCompoundMesh.js.map +1 -1
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.d.ts +48 -8
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.js +373 -84
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.js.map +1 -1
- package/Meshes/GaussianSplatting/gaussianSplattingMeshBase.d.ts +39 -4
- package/Meshes/GaussianSplatting/gaussianSplattingMeshBase.js +152 -47
- package/Meshes/GaussianSplatting/gaussianSplattingMeshBase.js.map +1 -1
- package/Meshes/GaussianSplatting/gaussianSplattingPartProxyMesh.d.ts +61 -7
- package/Meshes/GaussianSplatting/gaussianSplattingPartProxyMesh.js +94 -11
- package/Meshes/GaussianSplatting/gaussianSplattingPartProxyMesh.js.map +1 -1
- package/Meshes/mesh.d.ts +15 -0
- package/Meshes/mesh.js +40 -1
- package/Meshes/mesh.js.map +1 -1
- package/Meshes/transformNode.js +2 -2
- package/Meshes/transformNode.js.map +1 -1
- package/Misc/sceneSerializer.js +2 -1
- package/Misc/sceneSerializer.js.map +1 -1
- package/Misc/textureTools.d.ts +3 -1
- package/Misc/textureTools.js +74 -13
- package/Misc/textureTools.js.map +1 -1
- package/Misc/tools.js +1 -1
- package/Misc/tools.js.map +1 -1
- package/Particles/baseParticleSystem.d.ts +47 -1
- package/Particles/baseParticleSystem.js +88 -0
- package/Particles/baseParticleSystem.js.map +1 -1
- package/Particles/computeShaderParticleSystem.js +12 -0
- package/Particles/computeShaderParticleSystem.js.map +1 -1
- package/Particles/gpuParticleSystem.d.ts +61 -25
- package/Particles/gpuParticleSystem.js +249 -75
- package/Particles/gpuParticleSystem.js.map +1 -1
- package/Particles/particleSystem.d.ts +0 -6
- package/Particles/particleSystem.js +3 -14
- package/Particles/particleSystem.js.map +1 -1
- package/Particles/thinParticleSystem.d.ts +1 -17
- package/Particles/thinParticleSystem.js +1 -50
- package/Particles/thinParticleSystem.js.map +1 -1
- package/Particles/webgl2ParticleSystem.d.ts +1 -0
- package/Particles/webgl2ParticleSystem.js +18 -2
- package/Particles/webgl2ParticleSystem.js.map +1 -1
- package/Rendering/IBLShadows/iblShadowsAccumulationPass.js +1 -1
- package/Rendering/IBLShadows/iblShadowsAccumulationPass.js.map +1 -1
- package/Rendering/IBLShadows/iblShadowsPluginMaterial.d.ts +3 -1
- package/Rendering/IBLShadows/iblShadowsPluginMaterial.js +11 -1
- package/Rendering/IBLShadows/iblShadowsPluginMaterial.js.map +1 -1
- package/Rendering/IBLShadows/iblShadowsRenderPipeline.d.ts +0 -19
- package/Rendering/IBLShadows/iblShadowsRenderPipeline.js +21 -65
- package/Rendering/IBLShadows/iblShadowsRenderPipeline.js.map +1 -1
- package/Rendering/IBLShadows/iblShadowsVoxelRenderer.d.ts +15 -52
- package/Rendering/IBLShadows/iblShadowsVoxelRenderer.js +129 -220
- package/Rendering/IBLShadows/iblShadowsVoxelRenderer.js.map +1 -1
- package/Rendering/IBLShadows/iblShadowsVoxelTracingPass.js +3 -0
- package/Rendering/IBLShadows/iblShadowsVoxelTracingPass.js.map +1 -1
- package/Rendering/depthRenderer.js +6 -0
- package/Rendering/depthRenderer.js.map +1 -1
- package/Rendering/geometryBufferRenderer.d.ts +14 -5
- package/Rendering/geometryBufferRenderer.js +6 -2
- package/Rendering/geometryBufferRenderer.js.map +1 -1
- package/Rendering/geometryBufferRendererSceneComponent.d.ts +4 -6
- package/Rendering/geometryBufferRendererSceneComponent.js.map +1 -1
- package/Rendering/iblCdfGenerator.d.ts +10 -0
- package/Rendering/iblCdfGenerator.js +52 -17
- package/Rendering/iblCdfGenerator.js.map +1 -1
- package/Rendering/index.d.ts +0 -6
- package/Rendering/index.js +0 -6
- package/Rendering/index.js.map +1 -1
- package/Shaders/ShadersInclude/gaussianSplatting.js +25 -4
- package/Shaders/ShadersInclude/gaussianSplatting.js.map +1 -1
- package/Shaders/ShadersInclude/openpbrDirectLighting.js +6 -1
- package/Shaders/ShadersInclude/openpbrDirectLighting.js.map +1 -1
- package/Shaders/ShadersInclude/openpbrEnvironmentLighting.js +1 -1
- package/Shaders/ShadersInclude/openpbrEnvironmentLighting.js.map +1 -1
- package/Shaders/gaussianSplatting.vertex.js +3 -0
- package/Shaders/gaussianSplatting.vertex.js.map +1 -1
- package/Shaders/gpuRenderParticles.vertex.js +14 -2
- package/Shaders/gpuRenderParticles.vertex.js.map +1 -1
- package/Shaders/gpuUpdateParticles.vertex.js +24 -6
- package/Shaders/gpuUpdateParticles.vertex.js.map +1 -1
- package/Shaders/iblShadowVoxelTracing.fragment.js +5 -1
- package/Shaders/iblShadowVoxelTracing.fragment.js.map +1 -1
- package/Shaders/iblVoxelGrid.fragment.d.ts +1 -0
- package/Shaders/iblVoxelGrid.fragment.js +33 -5
- package/Shaders/iblVoxelGrid.fragment.js.map +1 -1
- package/Shaders/{iblVoxelSlabDebug.fragment.d.ts → lod3D.fragment.d.ts} +1 -1
- package/Shaders/lod3D.fragment.js +13 -0
- package/Shaders/lod3D.fragment.js.map +1 -0
- package/Shaders/openpbr.fragment.js +5 -0
- package/Shaders/openpbr.fragment.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/gaussianSplatting.js +37 -5
- package/ShadersWGSL/ShadersInclude/gaussianSplatting.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/openpbrDirectLighting.js +6 -1
- package/ShadersWGSL/ShadersInclude/openpbrDirectLighting.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/openpbrEnvironmentLighting.js +1 -1
- package/ShadersWGSL/ShadersInclude/openpbrEnvironmentLighting.js.map +1 -1
- package/ShadersWGSL/gaussianSplatting.vertex.js +3 -0
- package/ShadersWGSL/gaussianSplatting.vertex.js.map +1 -1
- package/ShadersWGSL/gpuUpdateParticles.compute.js +29 -8
- package/ShadersWGSL/gpuUpdateParticles.compute.js.map +1 -1
- package/ShadersWGSL/iblShadowVoxelTracing.fragment.js +5 -1
- package/ShadersWGSL/iblShadowVoxelTracing.fragment.js.map +1 -1
- package/ShadersWGSL/iblVoxelGrid.fragment.js +1 -1
- package/ShadersWGSL/iblVoxelGrid.fragment.js.map +1 -1
- package/{Shaders/iblVoxelSlabDebug.vertex.d.ts → ShadersWGSL/lod3D.fragment.d.ts} +1 -1
- package/ShadersWGSL/lod3D.fragment.js +13 -0
- package/ShadersWGSL/lod3D.fragment.js.map +1 -0
- package/ShadersWGSL/openpbr.fragment.js +5 -0
- package/ShadersWGSL/openpbr.fragment.js.map +1 -1
- package/package.json +1 -1
- package/Shaders/iblVoxelGrid3dDebug.fragment.d.ts +0 -5
- package/Shaders/iblVoxelGrid3dDebug.fragment.js +0 -24
- package/Shaders/iblVoxelGrid3dDebug.fragment.js.map +0 -1
- package/Shaders/iblVoxelSlabDebug.fragment.js +0 -13
- package/Shaders/iblVoxelSlabDebug.fragment.js.map +0 -1
- package/Shaders/iblVoxelSlabDebug.vertex.js +0 -11
- package/Shaders/iblVoxelSlabDebug.vertex.js.map +0 -1
- package/ShadersWGSL/iblVoxelGrid3dDebug.fragment.d.ts +0 -5
- package/ShadersWGSL/iblVoxelGrid3dDebug.fragment.js +0 -23
- package/ShadersWGSL/iblVoxelGrid3dDebug.fragment.js.map +0 -1
- package/ShadersWGSL/iblVoxelSlabDebug.fragment.d.ts +0 -5
- package/ShadersWGSL/iblVoxelSlabDebug.fragment.js +0 -14
- package/ShadersWGSL/iblVoxelSlabDebug.fragment.js.map +0 -1
- package/ShadersWGSL/iblVoxelSlabDebug.vertex.d.ts +0 -5
- package/ShadersWGSL/iblVoxelSlabDebug.vertex.js +0 -12
- package/ShadersWGSL/iblVoxelSlabDebug.vertex.js.map +0 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { GaussianSplattingMesh } from "./gaussianSplattingMesh.js";
|
|
2
|
+
import { Mesh } from "../mesh.js";
|
|
2
3
|
/**
|
|
3
4
|
* Class used to compose multiple Gaussian Splatting meshes into a single draw call,
|
|
4
5
|
* with per-part world-matrix and visibility control via addPart/addParts/removePart.
|
|
@@ -21,7 +22,7 @@ export class GaussianSplattingCompoundMesh extends GaussianSplattingMesh {
|
|
|
21
22
|
}
|
|
22
23
|
/**
|
|
23
24
|
* Add another mesh to this compound mesh as a new part.
|
|
24
|
-
* The source mesh's splat data is read directly
|
|
25
|
+
* The source mesh's splat data is read directly and copied into the compound's retained source buffers.
|
|
25
26
|
* @param other - The other mesh to add. Must be fully loaded before calling this method.
|
|
26
27
|
* @param disposeOther - Whether to dispose the other mesh after adding it.
|
|
27
28
|
* @returns a placeholder mesh that can be used to manipulate the part transform
|
|
@@ -31,7 +32,7 @@ export class GaussianSplattingCompoundMesh extends GaussianSplattingMesh {
|
|
|
31
32
|
}
|
|
32
33
|
/**
|
|
33
34
|
* Add multiple meshes to this compound mesh as new parts in a single operation.
|
|
34
|
-
* Splat data is written
|
|
35
|
+
* Splat data is written into texture arrays while the compound refreshes its retained merged source buffers.
|
|
35
36
|
* @param others - The meshes to add. Each must be fully loaded and must not be a compound.
|
|
36
37
|
* @param disposeOthers - Whether to dispose the other meshes after adding them.
|
|
37
38
|
* @returns an array of placeholder meshes that can be used to manipulate the part transforms
|
|
@@ -45,12 +46,36 @@ export class GaussianSplattingCompoundMesh extends GaussianSplattingMesh {
|
|
|
45
46
|
}
|
|
46
47
|
/**
|
|
47
48
|
* Remove a part from this compound mesh.
|
|
48
|
-
* The remaining parts are rebuilt directly from
|
|
49
|
-
* no merged CPU splat buffer is read back.
|
|
49
|
+
* The remaining parts are rebuilt directly from the compound mesh's retained source buffers.
|
|
50
50
|
* @param index - The index of the part to remove
|
|
51
51
|
*/
|
|
52
52
|
removePart(index) {
|
|
53
53
|
super.removePart(index);
|
|
54
54
|
}
|
|
55
|
+
/**
|
|
56
|
+
* Serialize current GaussianSplattingMesh
|
|
57
|
+
* @param serializationObject defines the object which will receive the serialization data
|
|
58
|
+
* @param encoding the encoding of binary data, defaults to base64 for json serialize,
|
|
59
|
+
* kept for future internal use like cloning where base64 encoding wastes cycles and memory
|
|
60
|
+
* @returns the serialized object
|
|
61
|
+
*/
|
|
62
|
+
serialize(serializationObject = {}, encoding = "base64") {
|
|
63
|
+
serializationObject = super.serialize(serializationObject, encoding);
|
|
64
|
+
// Note here, the getClassName() is not overridden,
|
|
65
|
+
// as a lot of code currently depend on `getClassName() === "GaussianSplattingMesh"` check,
|
|
66
|
+
// to not break those code, serialization uses `_isCompound` to mark the type
|
|
67
|
+
serializationObject._isCompound = true;
|
|
68
|
+
return serializationObject;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Parses a serialized GaussianSplattingCompoundMesh
|
|
72
|
+
* @param parsedMesh the serialized mesh
|
|
73
|
+
* @param scene the scene to create the GaussianSplattingCompoundMesh in
|
|
74
|
+
* @returns the created GaussianSplattingCompoundMesh
|
|
75
|
+
*/
|
|
76
|
+
static Parse(parsedMesh, scene) {
|
|
77
|
+
return GaussianSplattingMesh._ParseInternal(parsedMesh, scene, GaussianSplattingCompoundMesh);
|
|
78
|
+
}
|
|
55
79
|
}
|
|
80
|
+
Mesh._GaussianSplattingCompoundMeshParser = GaussianSplattingCompoundMesh.Parse;
|
|
56
81
|
//# sourceMappingURL=gaussianSplattingCompoundMesh.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gaussianSplattingCompoundMesh.js","sourceRoot":"","sources":["../../../../../dev/core/src/Meshes/GaussianSplatting/gaussianSplattingCompoundMesh.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"gaussianSplattingCompoundMesh.js","sourceRoot":"","sources":["../../../../../dev/core/src/Meshes/GaussianSplatting/gaussianSplattingCompoundMesh.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAEhE,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAE/B;;;;;;;;GAQG;AACH,MAAM,OAAO,6BAA8B,SAAQ,qBAAqB;IACpE;;;;;;OAMG;IACH,YAAY,IAAY,EAAE,MAAwB,IAAI,EAAE,QAAyB,IAAI,EAAE,YAAqB,KAAK;QAC7G,KAAK,CAAC,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC;IACvC,CAAC;IAED;;;;;;OAMG;IACa,OAAO,CAAC,KAA4B,EAAE,eAAwB,IAAI;QAC9E,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,YAAY,CAAC,CAAC;IAC9C,CAAC;IAED;;;;;;OAMG;IACI,QAAQ,CAAC,MAA+B,EAAE,gBAAyB,IAAI;QAC1E,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACtB,OAAO,EAAE,CAAC;QACd,CAAC;QACD,MAAM,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC,iBAAiB,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;QACtE,OAAO,WAAW,CAAC;IACvB,CAAC;IAED;;;;OAIG;IACa,UAAU,CAAC,KAAa;QACpC,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;IAC5B,CAAC;IAED;;;;;;OAMG;IACa,SAAS,CAAC,sBAA2B,EAAE,EAAE,WAAmB,QAAQ;QAChF,mBAAmB,GAAG,KAAK,CAAC,SAAS,CAAC,mBAAmB,EAAE,QAAQ,CAAC,CAAC;QACrE,mDAAmD;QACnD,2FAA2F;QAC3F,6EAA6E;QAC7E,mBAAmB,CAAC,WAAW,GAAG,IAAI,CAAC;QACvC,OAAO,mBAAmB,CAAC;IAC/B,CAAC;IAED;;;;;OAKG;IACI,MAAM,CAAU,KAAK,CAAC,UAAe,EAAE,KAAY;QACtD,OAAO,qBAAqB,CAAC,cAAc,CAAC,UAAU,EAAE,KAAK,EAAE,6BAA6B,CAAC,CAAC;IAClG,CAAC;CACJ;AAED,IAAI,CAAC,oCAAoC,GAAG,6BAA6B,CAAC,KAAK,CAAC","sourcesContent":["import { type Nullable } from \"core/types\";\r\nimport { type Scene } from \"core/scene\";\r\nimport { GaussianSplattingMesh } from \"./gaussianSplattingMesh\";\r\nimport { type GaussianSplattingPartProxyMesh } from \"./gaussianSplattingPartProxyMesh\";\r\nimport { Mesh } from \"../mesh\";\r\n\r\n/**\r\n * Class used to compose multiple Gaussian Splatting meshes into a single draw call,\r\n * with per-part world-matrix and visibility control via addPart/addParts/removePart.\r\n *\r\n * This is the recommended class for multi-part Gaussian Splatting use cases.\r\n *\r\n * Next major version: the compound mesh API (addPart/addParts/removePart) will\r\n * move exclusively to this class and will be removed from GaussianSplattingMesh.\r\n */\r\nexport class GaussianSplattingCompoundMesh extends GaussianSplattingMesh {\r\n /**\r\n * Creates a new GaussianSplattingCompoundMesh\r\n * @param name the name of the mesh\r\n * @param url optional URL to load a Gaussian Splatting file from\r\n * @param scene the hosting scene\r\n * @param keepInRam whether to keep the raw splat data in RAM after uploading to GPU\r\n */\r\n constructor(name: string, url: Nullable<string> = null, scene: Nullable<Scene> = null, keepInRam: boolean = false) {\r\n super(name, url, scene, keepInRam);\r\n }\r\n\r\n /**\r\n * Add another mesh to this compound mesh as a new part.\r\n * The source mesh's splat data is read directly and copied into the compound's retained source buffers.\r\n * @param other - The other mesh to add. Must be fully loaded before calling this method.\r\n * @param disposeOther - Whether to dispose the other mesh after adding it.\r\n * @returns a placeholder mesh that can be used to manipulate the part transform\r\n */\r\n public override addPart(other: GaussianSplattingMesh, disposeOther: boolean = true): GaussianSplattingPartProxyMesh {\r\n return super.addPart(other, disposeOther);\r\n }\r\n\r\n /**\r\n * Add multiple meshes to this compound mesh as new parts in a single operation.\r\n * Splat data is written into texture arrays while the compound refreshes its retained merged source buffers.\r\n * @param others - The meshes to add. Each must be fully loaded and must not be a compound.\r\n * @param disposeOthers - Whether to dispose the other meshes after adding them.\r\n * @returns an array of placeholder meshes that can be used to manipulate the part transforms\r\n */\r\n public addParts(others: GaussianSplattingMesh[], disposeOthers: boolean = true): GaussianSplattingPartProxyMesh[] {\r\n if (others.length === 0) {\r\n return [];\r\n }\r\n const { proxyMeshes } = this._addPartsInternal(others, disposeOthers);\r\n return proxyMeshes;\r\n }\r\n\r\n /**\r\n * Remove a part from this compound mesh.\r\n * The remaining parts are rebuilt directly from the compound mesh's retained source buffers.\r\n * @param index - The index of the part to remove\r\n */\r\n public override removePart(index: number): void {\r\n super.removePart(index);\r\n }\r\n\r\n /**\r\n * Serialize current GaussianSplattingMesh\r\n * @param serializationObject defines the object which will receive the serialization data\r\n * @param encoding the encoding of binary data, defaults to base64 for json serialize,\r\n * kept for future internal use like cloning where base64 encoding wastes cycles and memory\r\n * @returns the serialized object\r\n */\r\n public override serialize(serializationObject: any = {}, encoding: string = \"base64\"): any {\r\n serializationObject = super.serialize(serializationObject, encoding);\r\n // Note here, the getClassName() is not overridden,\r\n // as a lot of code currently depend on `getClassName() === \"GaussianSplattingMesh\"` check,\r\n // to not break those code, serialization uses `_isCompound` to mark the type\r\n serializationObject._isCompound = true;\r\n return serializationObject;\r\n }\r\n\r\n /**\r\n * Parses a serialized GaussianSplattingCompoundMesh\r\n * @param parsedMesh the serialized mesh\r\n * @param scene the scene to create the GaussianSplattingCompoundMesh in\r\n * @returns the created GaussianSplattingCompoundMesh\r\n */\r\n public static override Parse(parsedMesh: any, scene: Scene): GaussianSplattingCompoundMesh {\r\n return GaussianSplattingMesh._ParseInternal(parsedMesh, scene, GaussianSplattingCompoundMesh);\r\n }\r\n}\r\n\r\nMesh._GaussianSplattingCompoundMeshParser = GaussianSplattingCompoundMesh.Parse;\r\n"]}
|
|
@@ -5,6 +5,18 @@ import { type Effect } from "../../Materials/effect.js";
|
|
|
5
5
|
import { GaussianSplattingMeshBase } from "./gaussianSplattingMeshBase.js";
|
|
6
6
|
import "../thinInstanceMesh.js";
|
|
7
7
|
import { GaussianSplattingPartProxyMesh } from "./gaussianSplattingPartProxyMesh.js";
|
|
8
|
+
import { type BoundingInfo } from "../../Culling/boundingInfo.js";
|
|
9
|
+
interface IGaussianSplattingPartSource {
|
|
10
|
+
name: string;
|
|
11
|
+
_vertexCount: number;
|
|
12
|
+
_splatsData: Nullable<ArrayBuffer>;
|
|
13
|
+
_shData: Nullable<Uint8Array[]>;
|
|
14
|
+
_shDegree: number;
|
|
15
|
+
isCompound: boolean;
|
|
16
|
+
getWorldMatrix(): Matrix;
|
|
17
|
+
getBoundingInfo(): BoundingInfo;
|
|
18
|
+
dispose(): void;
|
|
19
|
+
}
|
|
8
20
|
/**
|
|
9
21
|
* Class used to render a Gaussian Splatting mesh. Supports both single-cloud and compound
|
|
10
22
|
* (multi-part) rendering. In compound mode, multiple Gaussian Splatting source meshes are
|
|
@@ -140,22 +152,25 @@ export declare class GaussianSplattingMesh extends GaussianSplattingMeshBase {
|
|
|
140
152
|
* @param partIndices - Part index data; if undefined the method is a no-op
|
|
141
153
|
*/
|
|
142
154
|
protected _ensurePartIndicesTexture(textureSize: Vector2, partIndices: Uint8Array | undefined): void;
|
|
155
|
+
private _appendPartSourceToArrays;
|
|
156
|
+
private _createRetainedPartSource;
|
|
157
|
+
private _retainMergedPartData;
|
|
143
158
|
/**
|
|
144
|
-
* Core implementation for adding one or more
|
|
145
|
-
* parts. Writes directly into texture-sized CPU arrays
|
|
146
|
-
*
|
|
159
|
+
* Core implementation for adding one or more source parts as new
|
|
160
|
+
* parts. Writes directly into texture-sized CPU arrays, updates the retained merged source
|
|
161
|
+
* buffers, and uploads in one pass.
|
|
147
162
|
*
|
|
148
163
|
* @param others - Source meshes to append (must each be non-compound and fully loaded)
|
|
149
164
|
* @param disposeOthers - Dispose source meshes after appending
|
|
150
165
|
* @returns Proxy meshes and their assigned part indices
|
|
151
166
|
*/
|
|
152
|
-
protected _addPartsInternal(others:
|
|
167
|
+
protected _addPartsInternal(others: IGaussianSplattingPartSource[], disposeOthers: boolean): {
|
|
153
168
|
proxyMeshes: GaussianSplattingPartProxyMesh[];
|
|
154
169
|
assignedPartIndices: number[];
|
|
155
170
|
};
|
|
156
171
|
/**
|
|
157
172
|
* Add another mesh to this mesh, as a new part. This makes the current mesh a compound, if not already.
|
|
158
|
-
* The source mesh's splat data is read directly
|
|
173
|
+
* The source mesh's splat data is read directly and copied into the compound's retained source buffers.
|
|
159
174
|
* @param other - The other mesh to add. Must be fully loaded before calling this method.
|
|
160
175
|
* @param disposeOther - Whether to dispose the other mesh after adding it to the current mesh.
|
|
161
176
|
* @returns a placeholder mesh that can be used to manipulate the part transform
|
|
@@ -164,11 +179,36 @@ export declare class GaussianSplattingMesh extends GaussianSplattingMeshBase {
|
|
|
164
179
|
addPart(other: GaussianSplattingMesh, disposeOther?: boolean): GaussianSplattingPartProxyMesh;
|
|
165
180
|
/**
|
|
166
181
|
* Remove a part from this compound mesh.
|
|
167
|
-
* The remaining parts are rebuilt directly from
|
|
168
|
-
*
|
|
169
|
-
*
|
|
182
|
+
* The remaining parts are rebuilt directly from the compound mesh's retained source buffers.
|
|
183
|
+
* The current mesh is reset to a plain (single-part) state and then each remaining source is
|
|
184
|
+
* re-added via addParts.
|
|
170
185
|
* @param index - The index of the part to remove
|
|
171
186
|
* @deprecated Use {@link GaussianSplattingCompoundMesh.removePart} instead.
|
|
172
187
|
*/
|
|
173
188
|
removePart(index: number): void;
|
|
189
|
+
/**
|
|
190
|
+
* Serialize current GaussianSplattingMesh
|
|
191
|
+
* @param serializationObject defines the object which will receive the serialization data
|
|
192
|
+
* @param encoding the encoding of binary data, defaults to base64 for json serialize,
|
|
193
|
+
* kept for future internal use like cloning where base64 encoding wastes cycles and memory
|
|
194
|
+
* @returns the serialized object
|
|
195
|
+
*/
|
|
196
|
+
serialize(serializationObject?: any, encoding?: string): any;
|
|
197
|
+
/**
|
|
198
|
+
* Internal helper to parses a serialized GaussianSplattingMesh or GaussianSplattingCompoundMesh
|
|
199
|
+
* @param parsedMesh the serialized mesh
|
|
200
|
+
* @param scene the scene to create the GaussianSplattingMesh or GaussianSplattingCompoundMesh in
|
|
201
|
+
* @param ctor the constructor of the mesh to create
|
|
202
|
+
* @returns the created GaussianSplattingMesh
|
|
203
|
+
* @internal
|
|
204
|
+
*/
|
|
205
|
+
static _ParseInternal<T extends GaussianSplattingMesh>(parsedMesh: any, scene: Scene, ctor: new (name: string, url: Nullable<string>, scene: Nullable<Scene>, keepInRam: boolean) => T): T;
|
|
206
|
+
/**
|
|
207
|
+
* Parses a serialized GaussianSplattingMesh
|
|
208
|
+
* @param parsedMesh the serialized mesh
|
|
209
|
+
* @param scene the scene to create the GaussianSplattingMesh in
|
|
210
|
+
* @returns the created GaussianSplattingMesh
|
|
211
|
+
*/
|
|
212
|
+
static Parse(parsedMesh: any, scene: Scene): GaussianSplattingMesh;
|
|
174
213
|
}
|
|
214
|
+
export {};
|