@babylonjs/core 7.3.3 → 7.5.0

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 (71) hide show
  1. package/Engines/abstractEngine.d.ts +11 -12
  2. package/Engines/abstractEngine.js +7 -7
  3. package/Engines/abstractEngine.js.map +1 -1
  4. package/Engines/thinEngine.d.ts +2 -2
  5. package/Engines/thinEngine.functions.d.ts +2 -0
  6. package/Engines/thinEngine.functions.js +1 -1
  7. package/Engines/thinEngine.functions.js.map +1 -1
  8. package/Engines/thinEngine.js +9 -10
  9. package/Engines/thinEngine.js.map +1 -1
  10. package/Loading/Plugins/babylonFileLoader.js +25 -14
  11. package/Loading/Plugins/babylonFileLoader.js.map +1 -1
  12. package/Materials/Background/backgroundMaterial.js +1 -2
  13. package/Materials/Background/backgroundMaterial.js.map +1 -1
  14. package/Materials/GreasedLine/greasedLinePluginMaterial.js +7 -3
  15. package/Materials/GreasedLine/greasedLinePluginMaterial.js.map +1 -1
  16. package/Materials/Node/Blocks/modBlock.js +7 -1
  17. package/Materials/Node/Blocks/modBlock.js.map +1 -1
  18. package/Materials/Node/nodeMaterial.d.ts +2 -4
  19. package/Materials/Node/nodeMaterial.js +1 -3
  20. package/Materials/Node/nodeMaterial.js.map +1 -1
  21. package/Materials/PBR/pbrBaseMaterial.d.ts +1 -2
  22. package/Materials/PBR/pbrBaseMaterial.js +1 -2
  23. package/Materials/PBR/pbrBaseMaterial.js.map +1 -1
  24. package/Materials/effect.d.ts +4 -0
  25. package/Materials/effect.functions.js +2 -0
  26. package/Materials/effect.functions.js.map +1 -1
  27. package/Materials/effect.js.map +1 -1
  28. package/Materials/effect.webgl.functions.js +1 -1
  29. package/Materials/effect.webgl.functions.js.map +1 -1
  30. package/Materials/imageProcessingConfiguration.d.ts +5 -0
  31. package/Materials/imageProcessingConfiguration.defines.d.ts +2 -4
  32. package/Materials/imageProcessingConfiguration.defines.js +1 -2
  33. package/Materials/imageProcessingConfiguration.defines.js.map +1 -1
  34. package/Materials/imageProcessingConfiguration.js +23 -11
  35. package/Materials/imageProcessingConfiguration.js.map +1 -1
  36. package/Materials/meshDebugPluginMaterial.js +2 -2
  37. package/Materials/meshDebugPluginMaterial.js.map +1 -1
  38. package/Materials/standardMaterial.d.ts +1 -2
  39. package/Materials/standardMaterial.js +1 -2
  40. package/Materials/standardMaterial.js.map +1 -1
  41. package/Meshes/Node/nodeGeometryBlockConnectionPoint.js +6 -0
  42. package/Meshes/Node/nodeGeometryBlockConnectionPoint.js.map +1 -1
  43. package/Misc/fileTools.d.ts +6 -0
  44. package/Misc/fileTools.js +4 -3
  45. package/Misc/fileTools.js.map +1 -1
  46. package/Misc/greasedLineTools.js +7 -1
  47. package/Misc/greasedLineTools.js.map +1 -1
  48. package/Misc/sceneSerializer.js +9 -1
  49. package/Misc/sceneSerializer.js.map +1 -1
  50. package/Misc/textureTools.d.ts +2 -0
  51. package/Misc/textureTools.js +2 -0
  52. package/Misc/textureTools.js.map +1 -1
  53. package/Misc/tools.d.ts +0 -6
  54. package/Misc/tools.js +0 -9
  55. package/Misc/tools.js.map +1 -1
  56. package/PostProcesses/imageProcessingPostProcess.js +14 -5
  57. package/PostProcesses/imageProcessingPostProcess.js.map +1 -1
  58. package/Rendering/GlobalIllumination/giRSMManager.d.ts +6 -0
  59. package/Rendering/GlobalIllumination/giRSMManager.js +15 -1
  60. package/Rendering/GlobalIllumination/giRSMManager.js.map +1 -1
  61. package/Rendering/renderingGroup.js +1 -1
  62. package/Rendering/renderingGroup.js.map +1 -1
  63. package/Shaders/ShadersInclude/imageProcessingFunctions.js +8 -5
  64. package/Shaders/ShadersInclude/imageProcessingFunctions.js.map +1 -1
  65. package/Shaders/lod.fragment.d.ts +5 -0
  66. package/Shaders/lod.fragment.js +12 -0
  67. package/Shaders/lod.fragment.js.map +1 -0
  68. package/Shaders/lodCube.fragment.d.ts +5 -0
  69. package/Shaders/lodCube.fragment.js +30 -0
  70. package/Shaders/lodCube.fragment.js.map +1 -0
  71. package/package.json +1 -1
@@ -135,6 +135,14 @@ export interface HostInformation {
135
135
  */
136
136
  isMobile: boolean;
137
137
  }
138
+ export type PrepareTextureProcessFunction = (width: number, height: number, img: HTMLImageElement | ImageBitmap | {
139
+ width: number;
140
+ height: number;
141
+ }, extension: string, texture: InternalTexture, continuationCallback: () => void) => boolean;
142
+ export type PrepareTextureFunction = (texture: InternalTexture, extension: string, scene: Nullable<ISceneLike>, img: HTMLImageElement | ImageBitmap | {
143
+ width: number;
144
+ height: number;
145
+ }, invertY: boolean, noMipmap: boolean, isCompressed: boolean, processFunction: PrepareTextureProcessFunction, samplingMode: number) => void;
138
146
  /**
139
147
  * The parent class for specialized engines (WebGL, WebGPU)
140
148
  */
@@ -961,16 +969,7 @@ export declare abstract class AbstractEngine {
961
969
  * Returns a string describing the current engine
962
970
  */
963
971
  get description(): string;
964
- protected _createTextureBase(url: Nullable<string>, noMipmap: boolean, invertY: boolean, scene: Nullable<ISceneLike>, samplingMode: number | undefined, onLoad: Nullable<(texture: InternalTexture) => void> | undefined, onError: Nullable<(message: string, exception: any) => void> | undefined, prepareTexture: (texture: InternalTexture, extension: string, scene: Nullable<ISceneLike>, img: HTMLImageElement | ImageBitmap | {
965
- width: number;
966
- height: number;
967
- }, invertY: boolean, noMipmap: boolean, isCompressed: boolean, processFunction: (width: number, height: number, img: HTMLImageElement | ImageBitmap | {
968
- width: number;
969
- height: number;
970
- }, extension: string, texture: InternalTexture, continuationCallback: () => void) => boolean, samplingMode: number) => void, prepareTextureProcessFunction: (width: number, height: number, img: HTMLImageElement | ImageBitmap | {
971
- width: number;
972
- height: number;
973
- }, extension: string, texture: InternalTexture, continuationCallback: () => void) => boolean, buffer?: Nullable<string | ArrayBuffer | ArrayBufferView | HTMLImageElement | Blob | ImageBitmap>, fallback?: Nullable<InternalTexture>, format?: Nullable<number>, forcedExtension?: Nullable<string>, mimeType?: string, loaderOptions?: any, useSRGBBuffer?: boolean): InternalTexture;
972
+ protected _createTextureBase(url: Nullable<string>, noMipmap: boolean, invertY: boolean, scene: Nullable<ISceneLike>, samplingMode: number | undefined, onLoad: Nullable<(texture: InternalTexture) => void> | undefined, onError: Nullable<(message: string, exception: any) => void> | undefined, prepareTexture: PrepareTextureFunction, prepareTextureProcess: PrepareTextureProcessFunction, buffer?: Nullable<string | ArrayBuffer | ArrayBufferView | HTMLImageElement | Blob | ImageBitmap>, fallback?: Nullable<InternalTexture>, format?: Nullable<number>, forcedExtension?: Nullable<string>, mimeType?: string, loaderOptions?: any, useSRGBBuffer?: boolean): InternalTexture;
974
973
  /**
975
974
  * Creates a new pipeline context
976
975
  * @param shaderProcessingContext defines the shader processing context used during the processing if available
@@ -1152,11 +1151,11 @@ export declare abstract class AbstractEngine {
1152
1151
  getCreationOptions(): AbstractEngineOptions;
1153
1152
  /**
1154
1153
  * Creates a new engine
1155
- * @param antialias defines enable antialiasing (default: false)
1154
+ * @param antialias defines whether anti-aliasing should be enabled. If undefined, it means that the underlying engine is free to enable it or not
1156
1155
  * @param options defines further options to be sent to the creation context
1157
1156
  * @param adaptToDeviceRatio defines whether to adapt to the device's viewport characteristics (default: false)
1158
1157
  */
1159
- constructor(antialias: boolean, options: AbstractEngineOptions, adaptToDeviceRatio?: boolean);
1158
+ constructor(antialias: boolean | undefined, options: AbstractEngineOptions, adaptToDeviceRatio?: boolean);
1160
1159
  /**
1161
1160
  * Resize the view according to the canvas' size
1162
1161
  * @param forceSetSize true to force setting the sizes of the underlying canvas
@@ -527,7 +527,7 @@ export class AbstractEngine {
527
527
  }
528
528
  return description;
529
529
  }
530
- _createTextureBase(url, noMipmap, invertY, scene, samplingMode = 3, onLoad = null, onError = null, prepareTexture, prepareTextureProcessFunction, buffer = null, fallback = null, format = null, forcedExtension = null, mimeType, loaderOptions, useSRGBBuffer) {
530
+ _createTextureBase(url, noMipmap, invertY, scene, samplingMode = 3, onLoad = null, onError = null, prepareTexture, prepareTextureProcess, buffer = null, fallback = null, format = null, forcedExtension = null, mimeType, loaderOptions, useSRGBBuffer) {
531
531
  url = url || "";
532
532
  const fromData = url.substr(0, 5) === "data:";
533
533
  const fromBlob = url.substr(0, 5) === "blob:";
@@ -586,7 +586,7 @@ export class AbstractEngine {
586
586
  texture.onLoadedObservable.remove(onLoadObserver);
587
587
  }
588
588
  if (EngineStore.UseFallbackTexture && url !== EngineStore.FallbackTexture) {
589
- this._createTextureBase(EngineStore.FallbackTexture, noMipmap, texture.invertY, scene, samplingMode, null, onError, prepareTexture, prepareTextureProcessFunction, buffer, texture);
589
+ this._createTextureBase(EngineStore.FallbackTexture, noMipmap, texture.invertY, scene, samplingMode, null, onError, prepareTexture, prepareTextureProcess, buffer, texture);
590
590
  }
591
591
  message = (message || "Unknown error") + (EngineStore.UseFallbackTexture ? " - Fallback texture was used" : "");
592
592
  texture.onErrorObservable.notifyObservers({ message, exception });
@@ -597,7 +597,7 @@ export class AbstractEngine {
597
597
  else {
598
598
  // fall back to the original url if the transformed url fails to load
599
599
  Logger.Warn(`Failed to load ${url}, falling back to ${originalUrl}`);
600
- this._createTextureBase(originalUrl, noMipmap, texture.invertY, scene, samplingMode, onLoad, onError, prepareTexture, prepareTextureProcessFunction, buffer, texture, format, forcedExtension, mimeType, loaderOptions, useSRGBBuffer);
600
+ this._createTextureBase(originalUrl, noMipmap, texture.invertY, scene, samplingMode, onLoad, onError, prepareTexture, prepareTextureProcess, buffer, texture, format, forcedExtension, mimeType, loaderOptions, useSRGBBuffer);
601
601
  }
602
602
  };
603
603
  // processing for non-image formats
@@ -641,7 +641,7 @@ export class AbstractEngine {
641
641
  // in case of a webgl context lost
642
642
  texture._buffer = img;
643
643
  }
644
- prepareTexture(texture, extension, scene, img, texture.invertY, noMipmap, false, prepareTextureProcessFunction, samplingMode);
644
+ prepareTexture(texture, extension, scene, img, texture.invertY, noMipmap, false, prepareTextureProcess, samplingMode);
645
645
  };
646
646
  // According to the WebGL spec section 6.10, ImageBitmaps must be inverted on creation.
647
647
  // So, we pass imageOrientation to _FileToolsLoadImage() as it may create an ImageBitmap.
@@ -729,13 +729,13 @@ export class AbstractEngine {
729
729
  */
730
730
  // Not mixed with Version for tooling purpose.
731
731
  static get NpmPackage() {
732
- return "babylonjs@7.3.3";
732
+ return "babylonjs@7.5.0";
733
733
  }
734
734
  /**
735
735
  * Returns the current version of the framework
736
736
  */
737
737
  static get Version() {
738
- return "7.3.3";
738
+ return "7.5.0";
739
739
  }
740
740
  /**
741
741
  * Gets the HTML canvas attached with the current webGL context
@@ -802,7 +802,7 @@ export class AbstractEngine {
802
802
  }
803
803
  /**
804
804
  * Creates a new engine
805
- * @param antialias defines enable antialiasing (default: false)
805
+ * @param antialias defines whether anti-aliasing should be enabled. If undefined, it means that the underlying engine is free to enable it or not
806
806
  * @param options defines further options to be sent to the creation context
807
807
  * @param adaptToDeviceRatio defines whether to adapt to the device's viewport characteristics (default: false)
808
808
  */