@babylonjs/core 9.4.1 → 9.5.1
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/Cameras/Inputs/freeCameraTouchInput.js +5 -3
- package/Cameras/Inputs/freeCameraTouchInput.js.map +1 -1
- package/Cameras/Inputs/freeCameraVirtualJoystickInput.js +11 -7
- package/Cameras/Inputs/freeCameraVirtualJoystickInput.js.map +1 -1
- package/Cameras/arcRotateCamera.js +2 -1
- package/Cameras/arcRotateCamera.js.map +1 -1
- package/Cameras/camera.js +1 -0
- package/Cameras/camera.js.map +1 -1
- package/Cameras/followCamera.js +1 -1
- package/Cameras/followCamera.js.map +1 -1
- package/Collisions/gpuPicker.d.ts +12 -0
- package/Collisions/gpuPicker.js +51 -0
- package/Collisions/gpuPicker.js.map +1 -1
- package/Compute/computeEffect.js +2 -2
- package/Compute/computeEffect.js.map +1 -1
- package/Culling/ray.core.js +46 -2
- package/Culling/ray.core.js.map +1 -1
- package/Debug/debugLayer.js +1 -1
- package/Debug/debugLayer.js.map +1 -1
- package/Engines/Native/nativeHelpers.js +26 -0
- package/Engines/Native/nativeHelpers.js.map +1 -1
- package/Engines/WebGPU/webgpuTextureHelper.js +26 -0
- package/Engines/WebGPU/webgpuTextureHelper.js.map +1 -1
- package/Engines/abstractEngine.js +2 -2
- package/Engines/abstractEngine.js.map +1 -1
- package/Engines/constants.d.ts +52 -0
- package/Engines/constants.js +52 -0
- package/Engines/constants.js.map +1 -1
- package/Engines/engine.d.ts +13 -0
- package/Engines/thinEngine.js +52 -0
- package/Engines/thinEngine.js.map +1 -1
- package/FlowGraph/Blocks/Event/flowGraphMeshPickEventBlock.js +10 -3
- package/FlowGraph/Blocks/Event/flowGraphMeshPickEventBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/flowGraphConsoleLogBlock.d.ts +1 -0
- package/FlowGraph/Blocks/Execution/flowGraphConsoleLogBlock.js +36 -3
- package/FlowGraph/Blocks/Execution/flowGraphConsoleLogBlock.js.map +1 -1
- package/FlowGraph/flowGraphEventBlock.d.ts +13 -0
- package/FlowGraph/flowGraphEventBlock.js +21 -2
- package/FlowGraph/flowGraphEventBlock.js.map +1 -1
- package/FrameGraph/Node/nodeRenderGraph.js +11 -3
- package/FrameGraph/Node/nodeRenderGraph.js.map +1 -1
- package/FrameGraph/frameGraphTextureManager.js +26 -0
- package/FrameGraph/frameGraphTextureManager.js.map +1 -1
- package/Layers/layer.js +5 -1
- package/Layers/layer.js.map +1 -1
- package/LensFlares/lensFlareSystem.js +1 -0
- package/LensFlares/lensFlareSystem.js.map +1 -1
- package/Lights/Clustered/clusteredLightContainer.js +19 -1
- package/Lights/Clustered/clusteredLightContainer.js.map +1 -1
- package/Lights/light.d.ts +5 -0
- package/Lights/light.js +18 -2
- package/Lights/light.js.map +1 -1
- package/Loading/Plugins/babylonFileLoader.js +14 -0
- package/Loading/Plugins/babylonFileLoader.js.map +1 -1
- package/Materials/GaussianSplatting/gaussianSplattingGpuPickingMaterialPlugin.d.ts +1 -0
- package/Materials/GaussianSplatting/gaussianSplattingGpuPickingMaterialPlugin.js +6 -3
- package/Materials/GaussianSplatting/gaussianSplattingGpuPickingMaterialPlugin.js.map +1 -1
- package/Materials/GaussianSplatting/gaussianSplattingMaterial.d.ts +2 -0
- package/Materials/GaussianSplatting/gaussianSplattingMaterial.js +10 -3
- package/Materials/GaussianSplatting/gaussianSplattingMaterial.js.map +1 -1
- package/Materials/GaussianSplatting/gaussianSplattingSolidColorMaterialPlugin.d.ts +2 -1
- package/Materials/GaussianSplatting/gaussianSplattingSolidColorMaterialPlugin.js +10 -4
- package/Materials/GaussianSplatting/gaussianSplattingSolidColorMaterialPlugin.js.map +1 -1
- package/Materials/Node/nodeMaterial.js +10 -2
- package/Materials/Node/nodeMaterial.js.map +1 -1
- package/Materials/PBR/openpbrMaterial.d.ts +42 -0
- package/Materials/PBR/openpbrMaterial.js +108 -13
- package/Materials/PBR/openpbrMaterial.js.map +1 -1
- package/Materials/Textures/Loaders/ktxTextureLoader.js +26 -0
- package/Materials/Textures/Loaders/ktxTextureLoader.js.map +1 -1
- package/Materials/Textures/envCubeTexture.js +33 -15
- package/Materials/Textures/envCubeTexture.js.map +1 -1
- package/Materials/effect.functions.js +4 -4
- package/Materials/effect.functions.js.map +1 -1
- package/Materials/material.d.ts +16 -1
- package/Materials/material.js +16 -1
- package/Materials/material.js.map +1 -1
- package/Materials/standardMaterial.js +4 -2
- package/Materials/standardMaterial.js.map +1 -1
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.d.ts +1 -1
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.js +16 -18
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.js.map +1 -1
- package/Meshes/GaussianSplatting/gaussianSplattingMeshBase.d.ts +24 -0
- package/Meshes/GaussianSplatting/gaussianSplattingMeshBase.js +93 -18
- package/Meshes/GaussianSplatting/gaussianSplattingMeshBase.js.map +1 -1
- package/Meshes/Node/nodeGeometry.js +10 -2
- package/Meshes/Node/nodeGeometry.js.map +1 -1
- package/Meshes/abstractMesh.js +1 -0
- package/Meshes/abstractMesh.js.map +1 -1
- package/Meshes/mesh.js +3 -0
- package/Meshes/mesh.js.map +1 -1
- package/Meshes/transformNode.d.ts +6 -0
- package/Meshes/transformNode.js +6 -0
- package/Meshes/transformNode.js.map +1 -1
- package/Misc/brdfTextureTools.d.ts +12 -0
- package/Misc/brdfTextureTools.js +22 -0
- package/Misc/brdfTextureTools.js.map +1 -1
- package/Misc/depthReducer.js +1 -1
- package/Misc/depthReducer.js.map +1 -1
- package/Misc/snapshotRenderingHelper.d.ts +29 -2
- package/Misc/snapshotRenderingHelper.js +108 -1
- package/Misc/snapshotRenderingHelper.js.map +1 -1
- package/Misc/textureTools.js +26 -0
- package/Misc/textureTools.js.map +1 -1
- package/Misc/tools.js +1 -1
- package/Misc/tools.js.map +1 -1
- package/Particles/Node/Blocks/Update/updateFlowMapBlock.js +17 -10
- package/Particles/Node/Blocks/Update/updateFlowMapBlock.js.map +1 -1
- package/Particles/Node/Blocks/Update/updateNoiseBlock.js +14 -0
- package/Particles/Node/Blocks/Update/updateNoiseBlock.js.map +1 -1
- package/Particles/Node/Blocks/particleSourceTextureBlock.js +114 -12
- package/Particles/Node/Blocks/particleSourceTextureBlock.js.map +1 -1
- package/Particles/Node/nodeParticleBuildState.d.ts +11 -0
- package/Particles/Node/nodeParticleBuildState.js +15 -0
- package/Particles/Node/nodeParticleBuildState.js.map +1 -1
- package/Particles/Node/nodeParticleSystemSet.js +33 -24
- package/Particles/Node/nodeParticleSystemSet.js.map +1 -1
- package/Particles/gpuParticleSystem.js +1 -0
- package/Particles/gpuParticleSystem.js.map +1 -1
- package/Particles/thinParticleSystem.d.ts +13 -0
- package/Particles/thinParticleSystem.js +42 -6
- package/Particles/thinParticleSystem.js.map +1 -1
- package/PostProcesses/postProcessManager.d.ts +2 -0
- package/PostProcesses/postProcessManager.js +14 -8
- package/PostProcesses/postProcessManager.js.map +1 -1
- package/Rendering/IBLShadows/iblShadowsVoxelRenderer.js +12 -9
- package/Rendering/IBLShadows/iblShadowsVoxelRenderer.js.map +1 -1
- package/Rendering/depthRendererSceneComponent.js +6 -6
- package/Rendering/depthRendererSceneComponent.js.map +1 -1
- package/Rendering/iblCdfGeneratorSceneComponent.d.ts +6 -0
- package/Rendering/iblCdfGeneratorSceneComponent.js +16 -0
- package/Rendering/iblCdfGeneratorSceneComponent.js.map +1 -1
- package/Rendering/prePassRenderer.d.ts +4 -1
- package/Rendering/prePassRenderer.js +31 -9
- package/Rendering/prePassRenderer.js.map +1 -1
- package/Shaders/ShadersInclude/hdrFilteringFunctions.js +1 -1
- package/Shaders/ShadersInclude/hdrFilteringFunctions.js.map +1 -1
- package/Shaders/ShadersInclude/openpbrBackgroundTransmission.js +20 -7
- package/Shaders/ShadersInclude/openpbrBackgroundTransmission.js.map +1 -1
- package/Shaders/ShadersInclude/openpbrDirectLighting.js +20 -12
- package/Shaders/ShadersInclude/openpbrDirectLighting.js.map +1 -1
- package/Shaders/ShadersInclude/openpbrEnvironmentLighting.js +44 -16
- package/Shaders/ShadersInclude/openpbrEnvironmentLighting.js.map +1 -1
- package/Shaders/ShadersInclude/openpbrFragmentDeclaration.js +4 -1
- package/Shaders/ShadersInclude/openpbrFragmentDeclaration.js.map +1 -1
- package/Shaders/ShadersInclude/openpbrIblFunctions.js +8 -5
- package/Shaders/ShadersInclude/openpbrIblFunctions.js.map +1 -1
- package/Shaders/ShadersInclude/openpbrNormalMapFragment.js +2 -0
- package/Shaders/ShadersInclude/openpbrNormalMapFragment.js.map +1 -1
- package/Shaders/ShadersInclude/openpbrVolumeFunctions.js +1 -1
- package/Shaders/ShadersInclude/openpbrVolumeFunctions.js.map +1 -1
- package/Shaders/ShadersInclude/pbrBRDFFunctions.js +12 -7
- package/Shaders/ShadersInclude/pbrBRDFFunctions.js.map +1 -1
- package/Shaders/openpbr.fragment.js +14 -15
- package/Shaders/openpbr.fragment.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/hdrFilteringFunctions.js +1 -1
- package/ShadersWGSL/ShadersInclude/hdrFilteringFunctions.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/openpbrBackgroundTransmission.js +20 -7
- package/ShadersWGSL/ShadersInclude/openpbrBackgroundTransmission.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/openpbrDirectLighting.js +21 -13
- package/ShadersWGSL/ShadersInclude/openpbrDirectLighting.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/openpbrDirectLightingInit.js +3 -3
- package/ShadersWGSL/ShadersInclude/openpbrDirectLightingInit.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/openpbrEnvironmentLighting.js +44 -16
- package/ShadersWGSL/ShadersInclude/openpbrEnvironmentLighting.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/openpbrIblFunctions.js +5 -3
- package/ShadersWGSL/ShadersInclude/openpbrIblFunctions.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/openpbrNormalMapFragment.js +2 -0
- package/ShadersWGSL/ShadersInclude/openpbrNormalMapFragment.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/openpbrNormalMapFragmentMainFunctions.js +1 -1
- package/ShadersWGSL/ShadersInclude/openpbrNormalMapFragmentMainFunctions.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/openpbrVolumeFunctions.js +1 -1
- package/ShadersWGSL/ShadersInclude/openpbrVolumeFunctions.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/pbrBRDFFunctions.js +10 -10
- package/ShadersWGSL/ShadersInclude/pbrBRDFFunctions.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/shadowsVertex.js +4 -0
- package/ShadersWGSL/ShadersInclude/shadowsVertex.js.map +1 -1
- package/ShadersWGSL/openpbr.fragment.js +16 -17
- package/ShadersWGSL/openpbr.fragment.js.map +1 -1
- package/Sprites/spriteManager.js +1 -0
- package/Sprites/spriteManager.js.map +1 -1
- package/package.json +1 -1
- package/scene.d.ts +16 -0
- package/scene.js +13 -0
- package/scene.js.map +1 -1
|
@@ -107,6 +107,19 @@ export declare class ThinParticleSystem extends BaseParticleSystem implements ID
|
|
|
107
107
|
private _alive;
|
|
108
108
|
private _useInstancing;
|
|
109
109
|
private _vertexArrayObject;
|
|
110
|
+
private _useFixedCapacityForSnapshot;
|
|
111
|
+
private _fixedCapacityHighWaterMark;
|
|
112
|
+
/**
|
|
113
|
+
* Gets or sets a boolean indicating that the particle system should always render at full capacity.
|
|
114
|
+
* When enabled, the draw call always emits `getCapacity()` quads/instances and inactive slots are zero-filled in the
|
|
115
|
+
* vertex buffer (collapsing them to degenerate triangles that produce no fragments).
|
|
116
|
+
* This makes the particle system compatible with FAST snapshot rendering, where the recorded draw call parameters
|
|
117
|
+
* are baked into the GPU bundle. Activate via `SnapshotRenderingHelper.fixParticleSystem(ps)`.
|
|
118
|
+
* Note: vertex shader cost scales with capacity rather than the live particle count, so size capacity realistically.
|
|
119
|
+
* This property is runtime-only and is not persisted by `serialize()` / `Parse()`.
|
|
120
|
+
*/
|
|
121
|
+
get useFixedCapacityForSnapshot(): boolean;
|
|
122
|
+
set useFixedCapacityForSnapshot(value: boolean);
|
|
110
123
|
private _isDisposed;
|
|
111
124
|
/**
|
|
112
125
|
* Gets a boolean indicating that the particle system was disposed
|
|
@@ -72,6 +72,21 @@ export class ThinParticleSystem extends BaseParticleSystem {
|
|
|
72
72
|
}
|
|
73
73
|
this._onDisposeObserver = this.onDisposeObservable.add(callback);
|
|
74
74
|
}
|
|
75
|
+
/**
|
|
76
|
+
* Gets or sets a boolean indicating that the particle system should always render at full capacity.
|
|
77
|
+
* When enabled, the draw call always emits `getCapacity()` quads/instances and inactive slots are zero-filled in the
|
|
78
|
+
* vertex buffer (collapsing them to degenerate triangles that produce no fragments).
|
|
79
|
+
* This makes the particle system compatible with FAST snapshot rendering, where the recorded draw call parameters
|
|
80
|
+
* are baked into the GPU bundle. Activate via `SnapshotRenderingHelper.fixParticleSystem(ps)`.
|
|
81
|
+
* Note: vertex shader cost scales with capacity rather than the live particle count, so size capacity realistically.
|
|
82
|
+
* This property is runtime-only and is not persisted by `serialize()` / `Parse()`.
|
|
83
|
+
*/
|
|
84
|
+
get useFixedCapacityForSnapshot() {
|
|
85
|
+
return this._useFixedCapacityForSnapshot;
|
|
86
|
+
}
|
|
87
|
+
set useFixedCapacityForSnapshot(value) {
|
|
88
|
+
this._useFixedCapacityForSnapshot = value;
|
|
89
|
+
}
|
|
75
90
|
/**
|
|
76
91
|
* Gets a boolean indicating that the particle system was disposed
|
|
77
92
|
*/
|
|
@@ -319,6 +334,8 @@ export class ThinParticleSystem extends BaseParticleSystem {
|
|
|
319
334
|
this._scaledGravity = Vector3.Zero();
|
|
320
335
|
this._currentRenderId = -1;
|
|
321
336
|
this._useInstancing = false;
|
|
337
|
+
this._useFixedCapacityForSnapshot = false;
|
|
338
|
+
this._fixedCapacityHighWaterMark = 0;
|
|
322
339
|
this._isDisposed = false;
|
|
323
340
|
this._started = false;
|
|
324
341
|
this._stopped = false;
|
|
@@ -389,6 +406,7 @@ export class ThinParticleSystem extends BaseParticleSystem {
|
|
|
389
406
|
this._scene = sceneOrEngine || EngineStore.LastCreatedScene;
|
|
390
407
|
this._engine = this._scene.getEngine();
|
|
391
408
|
this.uniqueId = this._scene.getUniqueId();
|
|
409
|
+
this.layerMask = this._scene.defaultRenderableLayerMask;
|
|
392
410
|
this._scene.particleSystems.push(this);
|
|
393
411
|
}
|
|
394
412
|
else {
|
|
@@ -1584,7 +1602,25 @@ export class ThinParticleSystem extends BaseParticleSystem {
|
|
|
1584
1602
|
offset += this._useInstancing ? 1 : 4;
|
|
1585
1603
|
}
|
|
1586
1604
|
if (this._vertexBuffer) {
|
|
1587
|
-
|
|
1605
|
+
if (this._useFixedCapacityForSnapshot) {
|
|
1606
|
+
// The vertex buffer is uploaded at full capacity so the FAST-snapshot bundle's draw call stays valid.
|
|
1607
|
+
// Inactive slots must be zeroed so they collapse to degenerate (size=0) quads that emit no fragments.
|
|
1608
|
+
// Float32Array starts zeroed and `_appendParticleVertices` overwrites only the active range, so we
|
|
1609
|
+
// only need to clear slots that were active in a previous frame and aren't anymore — i.e. the range
|
|
1610
|
+
// [currentCount, highWaterMark). When the active count grows we just bump the high-water mark.
|
|
1611
|
+
const stride = this._vertexBufferSize * (this._useInstancing ? 1 : 4);
|
|
1612
|
+
const currentCount = this._particles.length;
|
|
1613
|
+
if (currentCount < this._fixedCapacityHighWaterMark) {
|
|
1614
|
+
this._vertexData.fill(0, currentCount * stride, this._fixedCapacityHighWaterMark * stride);
|
|
1615
|
+
}
|
|
1616
|
+
if (currentCount > this._fixedCapacityHighWaterMark) {
|
|
1617
|
+
this._fixedCapacityHighWaterMark = currentCount;
|
|
1618
|
+
}
|
|
1619
|
+
this._vertexBuffer.updateDirectly(this._vertexData, 0, this._capacity);
|
|
1620
|
+
}
|
|
1621
|
+
else {
|
|
1622
|
+
this._vertexBuffer.updateDirectly(this._vertexData, 0, this._particles.length);
|
|
1623
|
+
}
|
|
1588
1624
|
}
|
|
1589
1625
|
}
|
|
1590
1626
|
if (this.manualEmitCount === 0 && this.disposeOnStop) {
|
|
@@ -1741,18 +1777,18 @@ export class ThinParticleSystem extends BaseParticleSystem {
|
|
|
1741
1777
|
}
|
|
1742
1778
|
if (this._useInstancing) {
|
|
1743
1779
|
if (this._scene?.forceWireframe) {
|
|
1744
|
-
engine.drawElementsType(6, 0, 10, this._particles.length);
|
|
1780
|
+
engine.drawElementsType(6, 0, 10, this._useFixedCapacityForSnapshot ? this._capacity : this._particles.length);
|
|
1745
1781
|
}
|
|
1746
1782
|
else {
|
|
1747
|
-
engine.drawArraysType(7, 0, 4, this._particles.length);
|
|
1783
|
+
engine.drawArraysType(7, 0, 4, this._useFixedCapacityForSnapshot ? this._capacity : this._particles.length);
|
|
1748
1784
|
}
|
|
1749
1785
|
}
|
|
1750
1786
|
else {
|
|
1751
1787
|
if (this._scene?.forceWireframe) {
|
|
1752
|
-
engine.drawElementsType(1, 0, this._particles.length * 10);
|
|
1788
|
+
engine.drawElementsType(1, 0, (this._useFixedCapacityForSnapshot ? this._capacity : this._particles.length) * 10);
|
|
1753
1789
|
}
|
|
1754
1790
|
else {
|
|
1755
|
-
engine.drawElementsType(0, 0, this._particles.length * 6);
|
|
1791
|
+
engine.drawElementsType(0, 0, (this._useFixedCapacityForSnapshot ? this._capacity : this._particles.length) * 6);
|
|
1756
1792
|
}
|
|
1757
1793
|
}
|
|
1758
1794
|
return this._particles.length;
|
|
@@ -1763,7 +1799,7 @@ export class ThinParticleSystem extends BaseParticleSystem {
|
|
|
1763
1799
|
*/
|
|
1764
1800
|
render() {
|
|
1765
1801
|
// Check
|
|
1766
|
-
if (!this.isReady() || !this._particles.length) {
|
|
1802
|
+
if (!this.isReady() || (!this._particles.length && !this._useFixedCapacityForSnapshot)) {
|
|
1767
1803
|
return 0;
|
|
1768
1804
|
}
|
|
1769
1805
|
const engine = this._engine;
|