@onerjs/core 8.54.3 → 8.54.4

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.
Files changed (45) hide show
  1. package/DeviceInput/webDeviceInputSystem.js +4 -0
  2. package/DeviceInput/webDeviceInputSystem.js.map +1 -1
  3. package/Engines/abstractEngine.pure.js +2 -2
  4. package/Engines/abstractEngine.pure.js.map +1 -1
  5. package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.pure.js +3 -1
  6. package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.pure.js.map +1 -1
  7. package/Meshes/GaussianSplatting/gaussianSplattingMeshBase.pure.js +21 -2
  8. package/Meshes/GaussianSplatting/gaussianSplattingMeshBase.pure.js.map +1 -1
  9. package/Meshes/GaussianSplatting/gaussianSplattingSortWorker.js +17 -4
  10. package/Meshes/GaussianSplatting/gaussianSplattingSortWorker.js.map +1 -1
  11. package/Meshes/abstractMesh.pure.js +5 -3
  12. package/Meshes/abstractMesh.pure.js.map +1 -1
  13. package/Misc/tools.pure.js +1 -1
  14. package/Misc/tools.pure.js.map +1 -1
  15. package/Physics/v2/Plugins/havokPlugin.d.ts +15 -0
  16. package/Physics/v2/Plugins/havokPlugin.js +16 -6
  17. package/Physics/v2/Plugins/havokPlugin.js.map +1 -1
  18. package/Physics/v2/characterController.js +2 -2
  19. package/Physics/v2/characterController.js.map +1 -1
  20. package/ShadersWGSL/ShadersInclude/clusteredLightingCompute.d.ts +5 -0
  21. package/ShadersWGSL/ShadersInclude/clusteredLightingCompute.js +29 -0
  22. package/ShadersWGSL/ShadersInclude/clusteredLightingCompute.js.map +1 -0
  23. package/ShadersWGSL/ShadersInclude/lightFragment.js +2 -3
  24. package/ShadersWGSL/ShadersInclude/lightFragment.js.map +1 -1
  25. package/ShadersWGSL/ShadersInclude/lightsFragmentFunctions.d.ts +1 -0
  26. package/ShadersWGSL/ShadersInclude/lightsFragmentFunctions.js +2 -17
  27. package/ShadersWGSL/ShadersInclude/lightsFragmentFunctions.js.map +1 -1
  28. package/ShadersWGSL/ShadersInclude/pbrClusteredLightingFunctions.d.ts +6 -0
  29. package/ShadersWGSL/ShadersInclude/pbrClusteredLightingFunctions.js +123 -0
  30. package/ShadersWGSL/ShadersInclude/pbrClusteredLightingFunctions.js.map +1 -0
  31. package/ShadersWGSL/ShadersInclude/pbrDirectLightingFunctions.d.ts +1 -1
  32. package/ShadersWGSL/ShadersInclude/pbrDirectLightingFunctions.js +2 -111
  33. package/ShadersWGSL/ShadersInclude/pbrDirectLightingFunctions.js.map +1 -1
  34. package/ShadersWGSL/background.fragment.js +2 -1
  35. package/ShadersWGSL/background.fragment.js.map +1 -1
  36. package/ShadersWGSL/default.fragment.js +2 -1
  37. package/ShadersWGSL/default.fragment.js.map +1 -1
  38. package/ShadersWGSL/openpbr.fragment.js +2 -1
  39. package/ShadersWGSL/openpbr.fragment.js.map +1 -1
  40. package/ShadersWGSL/pbr.fragment.js +2 -1
  41. package/ShadersWGSL/pbr.fragment.js.map +1 -1
  42. package/package.json +1 -1
  43. package/scene.pure.d.ts +7 -0
  44. package/scene.pure.js +8 -0
  45. package/scene.pure.js.map +1 -1
@@ -2476,8 +2476,10 @@ export class GaussianSplattingMeshBase extends Mesh {
2476
2476
  splatIndex[index++] = sourceIndex;
2477
2477
  }
2478
2478
  }
2479
+ // Pad with `vertexCount` itself, not 0: splat 0 is real data, not a reserved empty slot, and
2480
+ // range filtering can leave it fully visible — see gaussianSplattingSortWorker.ts.
2479
2481
  for (; index < paddedVertexCount; index++) {
2480
- splatIndex[index] = 0;
2482
+ splatIndex[index] = vertexCount;
2481
2483
  }
2482
2484
  }
2483
2485
  else {
@@ -2588,7 +2590,8 @@ export class GaussianSplattingMeshBase extends Mesh {
2588
2590
  type: "application/javascript",
2589
2591
  })));
2590
2592
  const positions = Float32Array.from(this._splatPositions);
2591
- this._worker.postMessage({ command: GaussianSplattingSortWorkerCommand.POSITIONS, positions }, [positions.buffer]);
2593
+ const vertexCount = this._vertexCount;
2594
+ this._worker.postMessage({ command: GaussianSplattingSortWorkerCommand.POSITIONS, positions, vertexCount }, [positions.buffer]);
2592
2595
  // The main thread owns the active interval set: send it explicitly (covering all indices when
2593
2596
  // no LOD filter is active) rather than letting the worker assume the full source set.
2594
2597
  this._postIntervalsToWorker();
@@ -2672,9 +2675,25 @@ export class GaussianSplattingMeshBase extends Mesh {
2672
2675
  while (width * height < length) {
2673
2676
  height *= 2;
2674
2677
  }
2678
+ // See the WebGL2/WebGPU branch below for why this guarantees an extra row when `length`
2679
+ // exactly fills every row. A power-of-2 height has to double to add any slack at all.
2680
+ // Usually this is a no-op since it is rare that the asset exactly contains a power-of-2
2681
+ // number of splats.
2682
+ if (length > 0 && width * height === length) {
2683
+ height *= 2;
2684
+ }
2675
2685
  }
2676
2686
  else {
2677
2687
  height = Math.ceil(length / width);
2688
+ // When `length` exactly fills every row, force one extra (fully zeroed) row so the atlas
2689
+ // always has at least one genuinely-empty splat slot past the real data, at index `length`.
2690
+ // The sort worker (gaussianSplattingSortWorker.ts) relies on that slot always existing to
2691
+ // safely pad the 16-aligned draw order — without it, the only "spare" index would be the
2692
+ // last real splat, which range-filtering (setSplatIndexRanges/opacity/size culling) can
2693
+ // leave fully visible and opaque, reproducing the same "stuck in front" bug on that splat.
2694
+ if (length > 0 && height * width === length) {
2695
+ height += 1;
2696
+ }
2678
2697
  }
2679
2698
  if (height > width) {
2680
2699
  Logger.Error("GaussianSplatting texture size: (" + width + ", " + height + "), maxTextureSize: " + width);