@babylonjs/core 9.12.0 → 9.12.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.
Files changed (90) hide show
  1. package/Behaviors/Cameras/interpolatingBehavior.d.ts +17 -2
  2. package/Behaviors/Cameras/interpolatingBehavior.js +53 -23
  3. package/Behaviors/Cameras/interpolatingBehavior.js.map +1 -1
  4. package/Cameras/Inputs/flyCameraKeyboardInput.js +9 -1
  5. package/Cameras/Inputs/flyCameraKeyboardInput.js.map +1 -1
  6. package/Cameras/Inputs/flyCameraMouseInput.d.ts +2 -0
  7. package/Cameras/Inputs/flyCameraMouseInput.js +14 -2
  8. package/Cameras/Inputs/flyCameraMouseInput.js.map +1 -1
  9. package/Cameras/Inputs/freeCameraKeyboardMoveInput.js +25 -5
  10. package/Cameras/Inputs/freeCameraKeyboardMoveInput.js.map +1 -1
  11. package/Cameras/Inputs/freeCameraMouseInput.d.ts +14 -0
  12. package/Cameras/Inputs/freeCameraMouseInput.js +26 -4
  13. package/Cameras/Inputs/freeCameraMouseInput.js.map +1 -1
  14. package/Cameras/Inputs/freeCameraTouchInput.js +16 -5
  15. package/Cameras/Inputs/freeCameraTouchInput.js.map +1 -1
  16. package/Cameras/Inputs/geospatialCameraKeyboardInput.js +8 -1
  17. package/Cameras/Inputs/geospatialCameraKeyboardInput.js.map +1 -1
  18. package/Cameras/arcRotateCamera.pure.js.map +1 -1
  19. package/Cameras/flyCamera.pure.d.ts +8 -0
  20. package/Cameras/flyCamera.pure.js.map +1 -1
  21. package/Cameras/freeCamera.pure.d.ts +8 -0
  22. package/Cameras/freeCamera.pure.js.map +1 -1
  23. package/Cameras/geospatialCamera.pure.d.ts +30 -7
  24. package/Cameras/geospatialCamera.pure.js +39 -14
  25. package/Cameras/geospatialCamera.pure.js.map +1 -1
  26. package/Cameras/geospatialCameraMovement.js +2 -2
  27. package/Cameras/geospatialCameraMovement.js.map +1 -1
  28. package/Cameras/index.d.ts +1 -0
  29. package/Cameras/index.js +1 -0
  30. package/Cameras/index.js.map +1 -1
  31. package/Cameras/pure.d.ts +1 -0
  32. package/Cameras/pure.js +1 -0
  33. package/Cameras/pure.js.map +1 -1
  34. package/Cameras/targetCamera.pure.d.ts +25 -0
  35. package/Cameras/targetCamera.pure.js +83 -25
  36. package/Cameras/targetCamera.pure.js.map +1 -1
  37. package/Cameras/targetCameraMovement.d.ts +56 -0
  38. package/Cameras/targetCameraMovement.js +63 -0
  39. package/Cameras/targetCameraMovement.js.map +1 -0
  40. package/Engines/AbstractEngine/abstractEngine.scissor.d.ts +18 -0
  41. package/Engines/AbstractEngine/abstractEngine.scissor.js +2 -0
  42. package/Engines/AbstractEngine/abstractEngine.scissor.js.map +1 -0
  43. package/Engines/abstractEngine.pure.js +2 -2
  44. package/Engines/abstractEngine.pure.js.map +1 -1
  45. package/Engines/engine.d.ts +1 -0
  46. package/Engines/engine.js +1 -0
  47. package/Engines/engine.js.map +1 -1
  48. package/Engines/engine.pure.d.ts +0 -12
  49. package/Engines/engine.pure.js +0 -20
  50. package/Engines/engine.pure.js.map +1 -1
  51. package/Engines/nullEngine.pure.d.ts +66 -0
  52. package/Engines/nullEngine.pure.js +93 -0
  53. package/Engines/nullEngine.pure.js.map +1 -1
  54. package/Engines/pure.d.ts +1 -0
  55. package/Engines/pure.js +1 -0
  56. package/Engines/pure.js.map +1 -1
  57. package/Engines/thinEngine.scissor.d.ts +6 -0
  58. package/Engines/thinEngine.scissor.js +9 -0
  59. package/Engines/thinEngine.scissor.js.map +1 -0
  60. package/Engines/thinEngine.scissor.pure.d.ts +6 -0
  61. package/Engines/thinEngine.scissor.pure.js +24 -0
  62. package/Engines/thinEngine.scissor.pure.js.map +1 -0
  63. package/Engines/thinNativeEngine.d.ts +0 -1
  64. package/Engines/thinNativeEngine.js +0 -1
  65. package/Engines/thinNativeEngine.js.map +1 -1
  66. package/Engines/thinNativeEngine.pure.js +7 -0
  67. package/Engines/thinNativeEngine.pure.js.map +1 -1
  68. package/Engines/webgpuEngine.pure.js.map +1 -1
  69. package/Materials/GreasedLine/greasedLinePluginMaterialShadersGLSL.js +10 -3
  70. package/Materials/GreasedLine/greasedLinePluginMaterialShadersGLSL.js.map +1 -1
  71. package/Meshes/GaussianSplatting/gaussianSplattingMesh.pure.js +18 -8
  72. package/Meshes/GaussianSplatting/gaussianSplattingMesh.pure.js.map +1 -1
  73. package/Meshes/GaussianSplatting/gaussianSplattingMeshBase.pure.d.ts +50 -1
  74. package/Meshes/GaussianSplatting/gaussianSplattingMeshBase.pure.js +199 -104
  75. package/Meshes/GaussianSplatting/gaussianSplattingMeshBase.pure.js.map +1 -1
  76. package/Meshes/GaussianSplatting/gaussianSplattingSortWorker.d.ts +37 -0
  77. package/Meshes/GaussianSplatting/gaussianSplattingSortWorker.js +160 -0
  78. package/Meshes/GaussianSplatting/gaussianSplattingSortWorker.js.map +1 -0
  79. package/Meshes/geometry.js +30 -15
  80. package/Meshes/geometry.js.map +1 -1
  81. package/Meshes/mesh.pure.js +26 -14
  82. package/Meshes/mesh.pure.js.map +1 -1
  83. package/Misc/tools.pure.js +1 -1
  84. package/Misc/tools.pure.js.map +1 -1
  85. package/Shaders/greasedLine.vertex.js +19 -3
  86. package/Shaders/greasedLine.vertex.js.map +1 -1
  87. package/package.json +3 -2
  88. package/scene.pure.d.ts +12 -0
  89. package/scene.pure.js +36 -0
  90. package/scene.pure.js.map +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"greasedLine.vertex.js","sourceRoot":"","sources":["../../../../dev/core/src/Shaders/greasedLine.vertex.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAC7E,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAEnE,MAAM,IAAI,GAAG,yBAAyB,CAAC;AACvC,MAAM,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;CAwBd,CAAC;AACF,aAAa;AACb,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,CAAC;IAClC,WAAW,CAAC,YAAY,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AAC5C,CAAC;AACD,MAAM,QAAQ,GAAG,CAAC,oBAAoB,EAAE,eAAe,CAAC,CAAC;AACzD,KAAK,MAAM,GAAG,IAAI,QAAQ,EAAE,CAAC;IACzB,IAAI,CAAC,WAAW,CAAC,oBAAoB,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;QAC9C,WAAW,CAAC,oBAAoB,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC,MAAM,CAAC;IAC5D,CAAC;AACL,CAAC;AAED,gBAAgB;AAChB,MAAM,CAAC,MAAM,uBAAuB,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"../Engines/shaderStore\";\nimport { instancesDeclaration } from \"./ShadersInclude/instancesDeclaration\";\nimport { instancesVertex } from \"./ShadersInclude/instancesVertex\";\n\nconst name = \"greasedLineVertexShader\";\nconst shader = `precision highp float;\n#include<instancesDeclaration>\nattribute float grl_widths;attribute vec3 grl_offsets;attribute float grl_colorPointers;attribute vec3 position;uniform mat4 viewProjection;uniform mat4 projection;varying float grlCounters;varying float grlColorPointer;\n#ifdef GREASED_LINE_CAMERA_FACING\nattribute vec4 grl_nextAndCounters;attribute vec4 grl_previousAndSide;uniform vec2 grlResolution;uniform float grlAspect;uniform float grlWidth;uniform float grlSizeAttenuation;vec2 grlFix( vec4 i,float aspect ) {vec2 res=i.xy/i.w;res.x*=aspect;return res;}\n#else\nattribute vec3 grl_slopes;attribute float grl_counters;\n#endif\nvoid main() {\n#include<instancesVertex>\ngrlColorPointer=grl_colorPointers;mat4 grlMatrix=viewProjection*finalWorld ;\n#ifdef GREASED_LINE_CAMERA_FACING\nfloat grlBaseWidth=grlWidth;vec3 grlPrevious=grl_previousAndSide.xyz;float grlSide=grl_previousAndSide.w;vec3 grlNext=grl_nextAndCounters.xyz;grlCounters=grl_nextAndCounters.w;float grlWidth=grlBaseWidth*grl_widths;vec3 positionUpdated=position+grl_offsets;vec3 worldDir=normalize(grlNext-grlPrevious);vec3 nearPosition=positionUpdated+(worldDir*0.01);vec4 grlFinalPosition=grlMatrix*vec4( positionUpdated ,1.0);vec4 screenNearPos=grlMatrix*vec4(nearPosition,1.0);vec2 grlLinePosition=grlFix(grlFinalPosition,grlAspect);vec2 grlLineNearPosition=grlFix(screenNearPos,grlAspect);vec2 grlDir=normalize(grlLineNearPosition-grlLinePosition);vec4 grlNormal=vec4( -grlDir.y,grlDir.x,0.,1. );\n#ifdef GREASED_LINE_RIGHT_HANDED_COORDINATE_SYSTEM\ngrlNormal.xy*=-.5*grlWidth;\n#else\ngrlNormal.xy*=.5*grlWidth;\n#endif\ngrlNormal*=projection;if (grlSizeAttenuation==1.) {grlNormal.xy*=grlFinalPosition.w;grlNormal.xy/=( vec4( grlResolution,0.,1. )*projection ).xy;}\ngrlFinalPosition.xy+=grlNormal.xy*grlSide;gl_Position=grlFinalPosition;\n#else\ngrlCounters=grl_counters;vec4 grlFinalPosition=grlMatrix*vec4( (position+grl_offsets)+grl_slopes*grl_widths ,1.0 ) ;gl_Position=grlFinalPosition;\n#endif\n}\n`;\n// Sideeffect\nif (!ShaderStore.ShadersStore[name]) {\n ShaderStore.ShadersStore[name] = shader;\n}\nconst includes = [instancesDeclaration, instancesVertex];\nfor (const inc of includes) {\n if (!ShaderStore.IncludesShadersStore[inc.name]) {\n ShaderStore.IncludesShadersStore[inc.name] = inc.shader;\n }\n}\n\n/** @internal */\nexport const greasedLineVertexShader = { name, shader };\n"]}
1
+ {"version":3,"file":"greasedLine.vertex.js","sourceRoot":"","sources":["../../../../dev/core/src/Shaders/greasedLine.vertex.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAC7E,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAEnE,MAAM,IAAI,GAAG,yBAAyB,CAAC;AACvC,MAAM,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwCd,CAAC;AACF,aAAa;AACb,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,CAAC;IAClC,WAAW,CAAC,YAAY,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AAC5C,CAAC;AACD,MAAM,QAAQ,GAAG,CAAC,oBAAoB,EAAE,eAAe,CAAC,CAAC;AACzD,KAAK,MAAM,GAAG,IAAI,QAAQ,EAAE,CAAC;IACzB,IAAI,CAAC,WAAW,CAAC,oBAAoB,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;QAC9C,WAAW,CAAC,oBAAoB,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC,MAAM,CAAC;IAC5D,CAAC;AACL,CAAC;AAED,gBAAgB;AAChB,MAAM,CAAC,MAAM,uBAAuB,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"../Engines/shaderStore\";\nimport { instancesDeclaration } from \"./ShadersInclude/instancesDeclaration\";\nimport { instancesVertex } from \"./ShadersInclude/instancesVertex\";\n\nconst name = \"greasedLineVertexShader\";\nconst shader = `precision highp float;\n#include<instancesDeclaration>\nattribute float grl_widths;\n#ifdef GREASED_LINE_USE_OFFSETS\nattribute vec3 grl_offsets;\n#endif\nattribute float grl_colorPointers;attribute vec3 position;uniform mat4 viewProjection;uniform mat4 projection;varying float grlCounters;varying float grlColorPointer;\n#ifdef GREASED_LINE_CAMERA_FACING\nattribute vec4 grl_nextAndCounters;attribute vec4 grl_previousAndSide;uniform vec2 grlResolution;uniform float grlAspect;uniform float grlWidth;uniform float grlSizeAttenuation;vec2 grlFix( vec4 i,float aspect ) {vec2 res=i.xy/i.w;res.x*=aspect;return res;}\n#else\nattribute vec3 grl_slopes;attribute float grl_counters;\n#endif\nvoid main() {\n#include<instancesVertex>\ngrlColorPointer=grl_colorPointers;mat4 grlMatrix=viewProjection*finalWorld ;\n#ifdef GREASED_LINE_CAMERA_FACING\nfloat grlBaseWidth=grlWidth;vec3 grlPrevious=grl_previousAndSide.xyz;float grlSide=grl_previousAndSide.w;vec3 grlNext=grl_nextAndCounters.xyz;grlCounters=grl_nextAndCounters.w;float grlWidth=grlBaseWidth*grl_widths;\n#ifdef GREASED_LINE_USE_OFFSETS\nvec3 grlPositionOffset=grl_offsets;\n#else\nvec3 grlPositionOffset=vec3(0.);\n#endif\nvec3 positionUpdated=position+grlPositionOffset;vec3 worldDir=normalize(grlNext-grlPrevious);vec3 nearPosition=positionUpdated+(worldDir*0.01);vec4 grlFinalPosition=grlMatrix*vec4( positionUpdated ,1.0);vec4 screenNearPos=grlMatrix*vec4(nearPosition,1.0);vec2 grlLinePosition=grlFix(grlFinalPosition,grlAspect);vec2 grlLineNearPosition=grlFix(screenNearPos,grlAspect);vec2 grlDir=normalize(grlLineNearPosition-grlLinePosition);vec4 grlNormal=vec4( -grlDir.y,grlDir.x,0.,1. );\n#ifdef GREASED_LINE_RIGHT_HANDED_COORDINATE_SYSTEM\ngrlNormal.xy*=-.5*grlWidth;\n#else\ngrlNormal.xy*=.5*grlWidth;\n#endif\ngrlNormal*=projection;if (grlSizeAttenuation==1.) {grlNormal.xy*=grlFinalPosition.w;grlNormal.xy/=( vec4( grlResolution,0.,1. )*projection ).xy;}\ngrlFinalPosition.xy+=grlNormal.xy*grlSide;gl_Position=grlFinalPosition;\n#else\ngrlCounters=grl_counters;\n#ifdef GREASED_LINE_USE_OFFSETS\nvec3 grlPositionOffset=grl_offsets;\n#else\nvec3 grlPositionOffset=vec3(0.);\n#endif\nvec4 grlFinalPosition=grlMatrix*vec4( (position+grlPositionOffset)+grl_slopes*grl_widths ,1.0 ) ;gl_Position=grlFinalPosition;\n#endif\n}\n`;\n// Sideeffect\nif (!ShaderStore.ShadersStore[name]) {\n ShaderStore.ShadersStore[name] = shader;\n}\nconst includes = [instancesDeclaration, instancesVertex];\nfor (const inc of includes) {\n if (!ShaderStore.IncludesShadersStore[inc.name]) {\n ShaderStore.IncludesShadersStore[inc.name] = inc.shader;\n }\n}\n\n/** @internal */\nexport const greasedLineVertexShader = { name, shader };\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@babylonjs/core",
3
- "version": "9.12.0",
3
+ "version": "9.12.1",
4
4
  "main": "index.js",
5
5
  "module": "index.js",
6
6
  "types": "index.d.ts",
@@ -136,6 +136,7 @@
136
136
  "Engines/AbstractEngine/abstractEngine.loadFile.js",
137
137
  "Engines/AbstractEngine/abstractEngine.query.js",
138
138
  "Engines/AbstractEngine/abstractEngine.renderPass.js",
139
+ "Engines/AbstractEngine/abstractEngine.scissor.js",
139
140
  "Engines/AbstractEngine/abstractEngine.states.js",
140
141
  "Engines/AbstractEngine/abstractEngine.stencil.js",
141
142
  "Engines/AbstractEngine/abstractEngine.texture.js",
@@ -154,7 +155,7 @@
154
155
  "Engines/engine.js",
155
156
  "Engines/nativeEngine.js",
156
157
  "Engines/nullEngine.js",
157
- "Engines/thinNativeEngine.js",
158
+ "Engines/thinEngine.scissor.js",
158
159
  "Engines/thinNativeEngine.types.js",
159
160
  "Engines/webgpuEngine.js",
160
161
  "FlowGraph/Blocks/Data/Audio/flowGraphGetSoundVolumeBlock.js",
package/scene.pure.d.ts CHANGED
@@ -1108,6 +1108,7 @@ export declare class Scene implements IAnimatable, IClipPlanesHolder, IAssetCont
1108
1108
  /** @internal */
1109
1109
  _toBeDisposed: Nullable<IDisposable>[];
1110
1110
  private _activeRequests;
1111
+ private _delayedFileRequests;
1111
1112
  /** @internal */
1112
1113
  _pendingData: any[];
1113
1114
  private _isDisposed;
@@ -2553,6 +2554,17 @@ export declare class Scene implements IAnimatable, IClipPlanesHolder, IAssetCont
2553
2554
  _loadFile(fileOrUrl: File | string, onSuccess: (data: string | ArrayBuffer, responseURL?: string) => void, onProgress?: (ev: ProgressEvent) => void, useOfflineSupport?: boolean, useArrayBuffer?: boolean, onError?: (request?: WebRequest, exception?: LoadFileError) => void, onOpened?: (request: WebRequest) => void): IFileRequest;
2554
2555
  _loadFileAsync(fileOrUrl: File | string, onProgress?: (data: any) => void, useOfflineSupport?: boolean, useArrayBuffer?: false, onOpened?: (request: WebRequest) => void): Promise<string>;
2555
2556
  _loadFileAsync(fileOrUrl: File | string, onProgress?: (data: any) => void, useOfflineSupport?: boolean, useArrayBuffer?: true, onOpened?: (request: WebRequest) => void): Promise<ArrayBuffer>;
2557
+ /**
2558
+ * Loads a delay-loading file (e.g. a `.babylonbinarymeshdata` geometry file), coalescing concurrent
2559
+ * requests for the same url so the file is only fetched once even when many meshes or geometries share it.
2560
+ * The same loaded data is resolved to every caller that requested it while the request was in flight.
2561
+ * @param url defines the url of the file to load
2562
+ * @param useArrayBuffer defines whether the file must be loaded as an ArrayBuffer (binary) or a string
2563
+ * @param useOfflineSupport defines whether the offline provider should be used when available
2564
+ * @returns a promise that resolves with the loaded data (shared across coalesced callers)
2565
+ * @internal
2566
+ */
2567
+ _loadDelayedFileAsync(url: string, useArrayBuffer: boolean, useOfflineSupport: boolean): Promise<string | ArrayBuffer>;
2556
2568
  /**
2557
2569
  * @internal
2558
2570
  */
package/scene.pure.js CHANGED
@@ -1292,6 +1292,7 @@ export class Scene {
1292
1292
  /** @internal */
1293
1293
  this._toBeDisposed = new Array(256);
1294
1294
  this._activeRequests = new Array();
1295
+ this._delayedFileRequests = null;
1295
1296
  /** @internal */
1296
1297
  this._pendingData = [];
1297
1298
  this._isDisposed = false;
@@ -5198,6 +5199,41 @@ export class Scene {
5198
5199
  }, onOpened);
5199
5200
  });
5200
5201
  }
5202
+ /**
5203
+ * Loads a delay-loading file (e.g. a `.babylonbinarymeshdata` geometry file), coalescing concurrent
5204
+ * requests for the same url so the file is only fetched once even when many meshes or geometries share it.
5205
+ * The same loaded data is resolved to every caller that requested it while the request was in flight.
5206
+ * @param url defines the url of the file to load
5207
+ * @param useArrayBuffer defines whether the file must be loaded as an ArrayBuffer (binary) or a string
5208
+ * @param useOfflineSupport defines whether the offline provider should be used when available
5209
+ * @returns a promise that resolves with the loaded data (shared across coalesced callers)
5210
+ * @internal
5211
+ */
5212
+ async _loadDelayedFileAsync(url, useArrayBuffer, useOfflineSupport) {
5213
+ if (!this._delayedFileRequests) {
5214
+ this._delayedFileRequests = new Map();
5215
+ }
5216
+ // The same url can be requested both as binary and as string, so the cache key must include the data type.
5217
+ const key = `${url}|${useArrayBuffer ? "binary" : "string"}`;
5218
+ let request = this._delayedFileRequests.get(key);
5219
+ if (!request) {
5220
+ // Branch on the literal type so the correct _loadFileAsync overload is selected without an unsafe cast.
5221
+ request = useArrayBuffer ? this._loadFileAsync(url, undefined, useOfflineSupport, true) : this._loadFileAsync(url, undefined, useOfflineSupport, false);
5222
+ // Only coalesce while the request is in flight: remove it once settled so later loads can re-fetch.
5223
+ const requestToClear = request;
5224
+ void (async () => {
5225
+ try {
5226
+ await requestToClear;
5227
+ }
5228
+ catch {
5229
+ // The failure is surfaced to the awaiting callers; here we only need to clear the in-flight entry.
5230
+ }
5231
+ this._delayedFileRequests?.delete(key);
5232
+ })();
5233
+ this._delayedFileRequests.set(key, request);
5234
+ }
5235
+ return await request;
5236
+ }
5201
5237
  /**
5202
5238
  * @internal
5203
5239
  */