@babylonjs/core 8.47.0 → 8.47.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/Behaviors/Cameras/geospatialClippingBehavior.d.ts +39 -0
- package/Behaviors/Cameras/geospatialClippingBehavior.js +75 -0
- package/Behaviors/Cameras/geospatialClippingBehavior.js.map +1 -0
- package/Behaviors/Cameras/index.d.ts +2 -0
- package/Behaviors/Cameras/index.js +2 -0
- package/Behaviors/Cameras/index.js.map +1 -1
- package/Cameras/Inputs/geospatialCameraPointersInput.js +6 -4
- package/Cameras/Inputs/geospatialCameraPointersInput.js.map +1 -1
- package/Cameras/Limits/geospatialLimits.d.ts +25 -1
- package/Cameras/Limits/geospatialLimits.js +60 -3
- package/Cameras/Limits/geospatialLimits.js.map +1 -1
- package/Cameras/geospatialCamera.d.ts +33 -9
- package/Cameras/geospatialCamera.js +114 -42
- package/Cameras/geospatialCamera.js.map +1 -1
- package/Cameras/geospatialCameraMovement.d.ts +1 -3
- package/Cameras/geospatialCameraMovement.js +10 -4
- package/Cameras/geospatialCameraMovement.js.map +1 -1
- package/Debug/debugLayer.js +11 -3
- package/Debug/debugLayer.js.map +1 -1
- package/Engines/abstractEngine.js +2 -2
- package/Engines/abstractEngine.js.map +1 -1
- package/Engines/thinEngine.d.ts +3 -2
- package/Engines/thinEngine.js.map +1 -1
- package/IAssetContainer.d.ts +5 -0
- package/IAssetContainer.js.map +1 -1
- package/Lights/Clustered/clusteredLightContainer.js +1 -1
- package/Lights/Clustered/clusteredLightContainer.js.map +1 -1
- package/Loading/Plugins/babylonFileLoader.js +2 -0
- package/Loading/Plugins/babylonFileLoader.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/fragmentOutputBlock.js +1 -1
- package/Materials/Node/Blocks/Fragment/fragmentOutputBlock.js.map +1 -1
- package/Materials/PBR/openpbrMaterial.d.ts +135 -5
- package/Materials/PBR/openpbrMaterial.js +205 -22
- package/Materials/PBR/openpbrMaterial.js.map +1 -1
- package/Materials/effectRenderer.d.ts +2 -1
- package/Materials/effectRenderer.js +2 -12
- package/Materials/effectRenderer.js.map +1 -1
- package/Materials/materialHelper.functions.js +1 -0
- package/Materials/materialHelper.functions.js.map +1 -1
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.d.ts +6 -1
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.js +21 -17
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.js.map +1 -1
- package/Misc/sceneRecorder.d.ts +6 -2
- package/Misc/sceneRecorder.js +7 -0
- package/Misc/sceneRecorder.js.map +1 -1
- package/Particles/Node/Blocks/index.d.ts +3 -0
- package/Particles/Node/Blocks/index.js +3 -0
- package/Particles/Node/Blocks/index.js.map +1 -1
- package/Particles/Node/Blocks/particleNLerpBlock.d.ts +35 -0
- package/Particles/Node/Blocks/particleNLerpBlock.js +97 -0
- package/Particles/Node/Blocks/particleNLerpBlock.js.map +1 -0
- package/Particles/Node/Blocks/particleSmoothStepBlock.d.ts +34 -0
- package/Particles/Node/Blocks/particleSmoothStepBlock.js +91 -0
- package/Particles/Node/Blocks/particleSmoothStepBlock.js.map +1 -0
- package/Particles/Node/Blocks/particleStepBlock.d.ts +30 -0
- package/Particles/Node/Blocks/particleStepBlock.js +84 -0
- package/Particles/Node/Blocks/particleStepBlock.js.map +1 -0
- package/Particles/solidParticleSystem.d.ts +3 -0
- package/Particles/solidParticleSystem.js +7 -4
- package/Particles/solidParticleSystem.js.map +1 -1
- package/Rendering/IBLShadows/iblShadowsPluginMaterial.js +8 -10
- package/Rendering/IBLShadows/iblShadowsPluginMaterial.js.map +1 -1
- package/Shaders/ShadersInclude/hdrFilteringFunctions.js +7 -9
- package/Shaders/ShadersInclude/hdrFilteringFunctions.js.map +1 -1
- package/Shaders/ShadersInclude/helperFunctions.js +4 -0
- package/Shaders/ShadersInclude/helperFunctions.js.map +1 -1
- package/Shaders/ShadersInclude/{openpbrBlockAmbientOcclusion.d.ts → openpbrAmbientOcclusionData.d.ts} +1 -1
- package/Shaders/ShadersInclude/openpbrAmbientOcclusionData.js +15 -0
- package/Shaders/ShadersInclude/openpbrAmbientOcclusionData.js.map +1 -0
- package/{ShadersWGSL/ShadersInclude/openpbrBlockAmbientOcclusion.d.ts → Shaders/ShadersInclude/openpbrAmbientOcclusionFunctions.d.ts} +1 -1
- package/Shaders/ShadersInclude/openpbrAmbientOcclusionFunctions.js +13 -0
- package/Shaders/ShadersInclude/openpbrAmbientOcclusionFunctions.js.map +1 -0
- package/Shaders/ShadersInclude/openpbrBackgroundTransmission.d.ts +5 -0
- package/Shaders/ShadersInclude/openpbrBackgroundTransmission.js +26 -0
- package/Shaders/ShadersInclude/openpbrBackgroundTransmission.js.map +1 -0
- package/Shaders/ShadersInclude/openpbrBaseLayerData.js +18 -7
- package/Shaders/ShadersInclude/openpbrBaseLayerData.js.map +1 -1
- package/Shaders/ShadersInclude/openpbrDirectLighting.js +52 -6
- package/Shaders/ShadersInclude/openpbrDirectLighting.js.map +1 -1
- package/Shaders/ShadersInclude/openpbrEnvironmentLighting.js +109 -6
- package/Shaders/ShadersInclude/openpbrEnvironmentLighting.js.map +1 -1
- package/Shaders/ShadersInclude/openpbrFragmentDeclaration.d.ts +1 -0
- package/Shaders/ShadersInclude/openpbrFragmentDeclaration.js +24 -4
- package/Shaders/ShadersInclude/openpbrFragmentDeclaration.js.map +1 -1
- package/Shaders/ShadersInclude/openpbrFragmentSamplersDeclaration.js +10 -1
- package/Shaders/ShadersInclude/openpbrFragmentSamplersDeclaration.js.map +1 -1
- package/Shaders/ShadersInclude/openpbrIblFunctions.js +9 -2
- package/Shaders/ShadersInclude/openpbrIblFunctions.js.map +1 -1
- package/Shaders/ShadersInclude/openpbrThinFilmLayerData.js +1 -0
- package/Shaders/ShadersInclude/openpbrThinFilmLayerData.js.map +1 -1
- package/Shaders/ShadersInclude/openpbrTransmissionLayerData.d.ts +5 -0
- package/Shaders/ShadersInclude/openpbrTransmissionLayerData.js +47 -0
- package/Shaders/ShadersInclude/openpbrTransmissionLayerData.js.map +1 -0
- package/Shaders/ShadersInclude/openpbrUboDeclaration.js +1 -1
- package/Shaders/ShadersInclude/openpbrUboDeclaration.js.map +1 -1
- package/Shaders/ShadersInclude/openpbrVertexDeclaration.d.ts +1 -0
- package/Shaders/ShadersInclude/openpbrVertexDeclaration.js +17 -4
- package/Shaders/ShadersInclude/openpbrVertexDeclaration.js.map +1 -1
- package/Shaders/ShadersInclude/pbrDirectLightingFunctions.js +1 -1
- package/Shaders/ShadersInclude/pbrDirectLightingFunctions.js.map +1 -1
- package/Shaders/ShadersInclude/pbrHelperFunctions.js +1 -1
- package/Shaders/ShadersInclude/pbrHelperFunctions.js.map +1 -1
- package/Shaders/openpbr.fragment.d.ts +4 -1
- package/Shaders/openpbr.fragment.js +33 -15
- package/Shaders/openpbr.fragment.js.map +1 -1
- package/Shaders/openpbr.vertex.js +30 -18
- package/Shaders/openpbr.vertex.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/hdrFilteringFunctions.js +10 -12
- package/ShadersWGSL/ShadersInclude/hdrFilteringFunctions.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/helperFunctions.js +4 -0
- package/ShadersWGSL/ShadersInclude/helperFunctions.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/importanceSampling.js +1 -1
- package/ShadersWGSL/ShadersInclude/importanceSampling.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/openpbrAmbientOcclusionData.d.ts +5 -0
- package/ShadersWGSL/ShadersInclude/openpbrAmbientOcclusionData.js +15 -0
- package/ShadersWGSL/ShadersInclude/openpbrAmbientOcclusionData.js.map +1 -0
- package/ShadersWGSL/ShadersInclude/openpbrAmbientOcclusionFunctions.d.ts +5 -0
- package/ShadersWGSL/ShadersInclude/openpbrAmbientOcclusionFunctions.js +13 -0
- package/ShadersWGSL/ShadersInclude/openpbrAmbientOcclusionFunctions.js.map +1 -0
- package/ShadersWGSL/ShadersInclude/openpbrBackgroundTransmission.d.ts +5 -0
- package/ShadersWGSL/ShadersInclude/openpbrBackgroundTransmission.js +25 -0
- package/ShadersWGSL/ShadersInclude/openpbrBackgroundTransmission.js.map +1 -0
- package/ShadersWGSL/ShadersInclude/openpbrBaseLayerData.js +18 -7
- package/ShadersWGSL/ShadersInclude/openpbrBaseLayerData.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/openpbrDirectLighting.js +52 -6
- package/ShadersWGSL/ShadersInclude/openpbrDirectLighting.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/openpbrEnvironmentLighting.js +115 -7
- package/ShadersWGSL/ShadersInclude/openpbrEnvironmentLighting.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/openpbrFragmentSamplersDeclaration.js +10 -1
- package/ShadersWGSL/ShadersInclude/openpbrFragmentSamplersDeclaration.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/openpbrFuzzLayerData.js +4 -4
- package/ShadersWGSL/ShadersInclude/openpbrFuzzLayerData.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/openpbrIblFunctions.js +10 -3
- package/ShadersWGSL/ShadersInclude/openpbrIblFunctions.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/openpbrThinFilmLayerData.js +1 -0
- package/ShadersWGSL/ShadersInclude/openpbrThinFilmLayerData.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/openpbrTransmissionLayerData.d.ts +5 -0
- package/ShadersWGSL/ShadersInclude/openpbrTransmissionLayerData.js +47 -0
- package/ShadersWGSL/ShadersInclude/openpbrTransmissionLayerData.js.map +1 -0
- package/ShadersWGSL/ShadersInclude/openpbrUboDeclaration.js +1 -1
- package/ShadersWGSL/ShadersInclude/openpbrUboDeclaration.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/pbrDirectLightingFunctions.js +1 -1
- package/ShadersWGSL/ShadersInclude/pbrDirectLightingFunctions.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/pbrHelperFunctions.js +1 -1
- package/ShadersWGSL/ShadersInclude/pbrHelperFunctions.js.map +1 -1
- package/ShadersWGSL/openpbr.fragment.d.ts +4 -1
- package/ShadersWGSL/openpbr.fragment.js +33 -15
- package/ShadersWGSL/openpbr.fragment.js.map +1 -1
- package/ShadersWGSL/openpbr.vertex.js +12 -0
- package/ShadersWGSL/openpbr.vertex.js.map +1 -1
- package/Sprites/spriteManager.d.ts +3 -0
- package/Sprites/spriteManager.js +9 -0
- package/Sprites/spriteManager.js.map +1 -1
- package/assetContainer.d.ts +5 -0
- package/assetContainer.js +32 -0
- package/assetContainer.js.map +1 -1
- package/package.json +2 -2
- package/Shaders/ShadersInclude/openpbrBlockAmbientOcclusion.js +0 -35
- package/Shaders/ShadersInclude/openpbrBlockAmbientOcclusion.js.map +0 -1
- package/ShadersWGSL/ShadersInclude/openpbrBlockAmbientOcclusion.js +0 -36
- package/ShadersWGSL/ShadersInclude/openpbrBlockAmbientOcclusion.js.map +0 -1
|
@@ -296,7 +296,7 @@ export class GaussianSplattingMesh extends Mesh {
|
|
|
296
296
|
super(name, scene);
|
|
297
297
|
this._vertexCount = 0;
|
|
298
298
|
this._worker = null;
|
|
299
|
-
this.
|
|
299
|
+
this._modelViewProjectionMatrix = Matrix.Identity();
|
|
300
300
|
this._canPostToWorker = true;
|
|
301
301
|
this._readyToDisplay = false;
|
|
302
302
|
this._covariancesATexture = null;
|
|
@@ -315,6 +315,10 @@ export class GaussianSplattingMesh extends Mesh {
|
|
|
315
315
|
this._sortIsDirty = false;
|
|
316
316
|
this._shDegree = 0;
|
|
317
317
|
this._cameraViewInfos = new Map();
|
|
318
|
+
/**
|
|
319
|
+
* Cosine value of the angle threshold to update view dependent splat sorting. Default is 0.0001.
|
|
320
|
+
*/
|
|
321
|
+
this.viewUpdateThreshold = GaussianSplattingMesh._DefaultViewUpdateThreshold;
|
|
318
322
|
this._disableDepthSort = false;
|
|
319
323
|
this._loadingPromise = null;
|
|
320
324
|
this.subMeshes = [];
|
|
@@ -378,11 +382,14 @@ export class GaussianSplattingMesh extends Mesh {
|
|
|
378
382
|
return true;
|
|
379
383
|
}
|
|
380
384
|
_getCameraDirection(camera) {
|
|
381
|
-
const
|
|
382
|
-
|
|
385
|
+
const cameraViewMatrix = camera.getViewMatrix();
|
|
386
|
+
const cameraProjectionMatrix = camera.getProjectionMatrix();
|
|
387
|
+
const cameraViewProjectionMatrix = TmpVectors.Matrix[0];
|
|
388
|
+
cameraViewMatrix.multiplyToRef(cameraProjectionMatrix, cameraViewProjectionMatrix);
|
|
389
|
+
this.getWorldMatrix().multiplyToRef(cameraViewProjectionMatrix, this._modelViewProjectionMatrix);
|
|
383
390
|
// return vector used to compute distance to camera
|
|
384
391
|
const localDirection = TmpVectors.Vector3[1];
|
|
385
|
-
localDirection.set(this.
|
|
392
|
+
localDirection.set(this._modelViewProjectionMatrix.m[8], this._modelViewProjectionMatrix.m[9], this._modelViewProjectionMatrix.m[10]);
|
|
386
393
|
localDirection.normalize();
|
|
387
394
|
return localDirection;
|
|
388
395
|
}
|
|
@@ -439,20 +446,19 @@ export class GaussianSplattingMesh extends Mesh {
|
|
|
439
446
|
const cameraDirection = this._getCameraDirection(camera);
|
|
440
447
|
const previousCameraDirection = cameraViewInfos.cameraDirection;
|
|
441
448
|
const dot = Vector3.Dot(cameraDirection, previousCameraDirection);
|
|
442
|
-
if ((forced || Math.abs(dot - 1) >=
|
|
449
|
+
if ((forced || Math.abs(dot - 1) >= this.viewUpdateThreshold) && this._canPostToWorker) {
|
|
443
450
|
cameraViewInfos.cameraDirection.copyFrom(cameraDirection);
|
|
444
451
|
cameraViewInfos.frameIdLastUpdate = frameId;
|
|
445
452
|
this._canPostToWorker = false;
|
|
446
453
|
if (this._worker) {
|
|
447
454
|
this._worker.postMessage({
|
|
448
|
-
|
|
455
|
+
modelViewProjection: this._modelViewProjectionMatrix.m,
|
|
449
456
|
depthMix: this._depthMix,
|
|
450
|
-
useRightHandedSystem: this._scene.useRightHandedSystem,
|
|
451
457
|
cameraId: camera.uniqueId,
|
|
452
458
|
}, [this._depthMix.buffer]);
|
|
453
459
|
}
|
|
454
460
|
else if (_native && _native.sortSplats) {
|
|
455
|
-
_native.sortSplats(this.
|
|
461
|
+
_native.sortSplats(this._modelViewProjectionMatrix, this._splatPositions, this._splatIndex, this._scene.useRightHandedSystem);
|
|
456
462
|
if (cameraViewInfos.splatIndexBufferSet) {
|
|
457
463
|
cameraViewInfos.mesh.thinInstanceBufferUpdated("splatIndex");
|
|
458
464
|
}
|
|
@@ -1220,7 +1226,7 @@ export class GaussianSplattingMesh extends Mesh {
|
|
|
1220
1226
|
newGS.makeGeometryUnique();
|
|
1221
1227
|
newGS._vertexCount = this._vertexCount;
|
|
1222
1228
|
newGS._copyTextures(this);
|
|
1223
|
-
newGS.
|
|
1229
|
+
newGS._modelViewProjectionMatrix = Matrix.Identity();
|
|
1224
1230
|
newGS._splatPositions = this._splatPositions;
|
|
1225
1231
|
newGS._readyToDisplay = false;
|
|
1226
1232
|
newGS._disableDepthSort = this._disableDepthSort;
|
|
@@ -1555,6 +1561,7 @@ GaussianSplattingMesh._SplatBatchSize = 327680;
|
|
|
1555
1561
|
// batch size between 2 yield calls during the PLY to splat conversion.
|
|
1556
1562
|
GaussianSplattingMesh._PlyConversionBatchSize = 32768;
|
|
1557
1563
|
GaussianSplattingMesh._BatchSize = 16; // 16 splats per instance
|
|
1564
|
+
GaussianSplattingMesh._DefaultViewUpdateThreshold = 1e-4;
|
|
1558
1565
|
/**
|
|
1559
1566
|
* Set the number of batch (a batch is 16384 splats) after which a display update is performed
|
|
1560
1567
|
* A value of 0 (default) means display update will not happens before splat is ready.
|
|
@@ -1573,11 +1580,11 @@ GaussianSplattingMesh._CreateWorker = function (self) {
|
|
|
1573
1580
|
// udpate on view changed
|
|
1574
1581
|
else {
|
|
1575
1582
|
const cameraId = e.data.cameraId;
|
|
1576
|
-
const
|
|
1583
|
+
const modelViewProjection = e.data.modelViewProjection;
|
|
1577
1584
|
const vertexCountPadded = (positions.length / 4 + 15) & ~0xf;
|
|
1578
|
-
if (!positions || !
|
|
1585
|
+
if (!positions || !modelViewProjection) {
|
|
1579
1586
|
// Sanity check, it shouldn't happen!
|
|
1580
|
-
throw new Error("positions or
|
|
1587
|
+
throw new Error("positions or modelViewProjection matrix is not defined!");
|
|
1581
1588
|
}
|
|
1582
1589
|
depthMix = e.data.depthMix;
|
|
1583
1590
|
indices = new Uint32Array(depthMix.buffer);
|
|
@@ -1586,12 +1593,9 @@ GaussianSplattingMesh._CreateWorker = function (self) {
|
|
|
1586
1593
|
for (let j = 0; j < vertexCountPadded; j++) {
|
|
1587
1594
|
indices[2 * j] = j;
|
|
1588
1595
|
}
|
|
1589
|
-
let depthFactor = -1;
|
|
1590
|
-
if (e.data.useRightHandedSystem) {
|
|
1591
|
-
depthFactor = 1;
|
|
1592
|
-
}
|
|
1593
1596
|
for (let j = 0; j < vertexCountPadded; j++) {
|
|
1594
|
-
floatMix[2 * j + 1] =
|
|
1597
|
+
floatMix[2 * j + 1] =
|
|
1598
|
+
10000 - (modelViewProjection[2] * positions[4 * j + 0] + modelViewProjection[6] * positions[4 * j + 1] + modelViewProjection[10] * positions[4 * j + 2]);
|
|
1595
1599
|
}
|
|
1596
1600
|
depthMix.sort();
|
|
1597
1601
|
self.postMessage({ depthMix, cameraId }, [depthMix.buffer]);
|