@babylonjs/core 5.15.1 → 5.16.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 (77) hide show
  1. package/Audio/sound.js +2 -2
  2. package/Audio/sound.js.map +1 -1
  3. package/Cameras/Inputs/BaseCameraMouseWheelInput.d.ts +1 -1
  4. package/Cameras/Inputs/BaseCameraMouseWheelInput.js +8 -2
  5. package/Cameras/Inputs/BaseCameraMouseWheelInput.js.map +1 -1
  6. package/Cameras/Inputs/arcRotateCameraMouseWheelInput.d.ts +0 -1
  7. package/Cameras/Inputs/arcRotateCameraMouseWheelInput.js +7 -2
  8. package/Cameras/Inputs/arcRotateCameraMouseWheelInput.js.map +1 -1
  9. package/Cameras/Inputs/followCameraMouseWheelInput.d.ts +0 -1
  10. package/Cameras/Inputs/followCameraMouseWheelInput.js +7 -2
  11. package/Cameras/Inputs/followCameraMouseWheelInput.js.map +1 -1
  12. package/Cameras/arcRotateCamera.js +3 -2
  13. package/Cameras/arcRotateCamera.js.map +1 -1
  14. package/Cameras/camera.js +15 -0
  15. package/Cameras/camera.js.map +1 -1
  16. package/DeviceInput/InputDevices/webDeviceInputSystem.js +1 -1
  17. package/DeviceInput/InputDevices/webDeviceInputSystem.js.map +1 -1
  18. package/Engines/Extensions/engine.cubeTexture.js +3 -3
  19. package/Engines/Extensions/engine.cubeTexture.js.map +1 -1
  20. package/Engines/Extensions/engine.rawTexture.js +3 -3
  21. package/Engines/Extensions/engine.rawTexture.js.map +1 -1
  22. package/Engines/Native/nativeInterfaces.d.ts +1 -0
  23. package/Engines/Native/nativeInterfaces.js.map +1 -1
  24. package/Engines/WebGPU/Extensions/engine.rawTexture.js +3 -3
  25. package/Engines/WebGPU/Extensions/engine.rawTexture.js.map +1 -1
  26. package/Engines/WebGPU/webgpuShaderProcessorsGLSL.js +6 -6
  27. package/Engines/WebGPU/webgpuShaderProcessorsGLSL.js.map +1 -1
  28. package/Engines/WebGPU/webgpuShaderProcessorsWGSL.js +4 -4
  29. package/Engines/WebGPU/webgpuShaderProcessorsWGSL.js.map +1 -1
  30. package/Engines/nativeEngine.d.ts +1 -0
  31. package/Engines/nativeEngine.js +18 -4
  32. package/Engines/nativeEngine.js.map +1 -1
  33. package/Engines/thinEngine.d.ts +12 -2
  34. package/Engines/thinEngine.js +32 -6
  35. package/Engines/thinEngine.js.map +1 -1
  36. package/Engines/webgpuEngine.js +1 -1
  37. package/Engines/webgpuEngine.js.map +1 -1
  38. package/Inputs/scene.inputManager.js +5 -1
  39. package/Inputs/scene.inputManager.js.map +1 -1
  40. package/Loading/sceneLoader.js +9 -9
  41. package/Loading/sceneLoader.js.map +1 -1
  42. package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.js +2 -1
  43. package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.js.map +1 -1
  44. package/Materials/PBR/pbrBaseMaterial.js +4 -4
  45. package/Materials/PBR/pbrBaseMaterial.js.map +1 -1
  46. package/Materials/Textures/baseTexture.d.ts +1 -1
  47. package/Materials/Textures/baseTexture.js +2 -2
  48. package/Materials/Textures/baseTexture.js.map +1 -1
  49. package/Materials/Textures/videoTexture.js +4 -1
  50. package/Materials/Textures/videoTexture.js.map +1 -1
  51. package/Materials/imageProcessingConfiguration.js.map +1 -1
  52. package/Materials/materialHelper.d.ts +1 -1
  53. package/Materials/materialHelper.js +6 -6
  54. package/Materials/materialHelper.js.map +1 -1
  55. package/Meshes/geometry.js +2 -2
  56. package/Meshes/geometry.js.map +1 -1
  57. package/Meshes/mesh.d.ts +1 -1
  58. package/Meshes/mesh.js +8 -7
  59. package/Meshes/mesh.js.map +1 -1
  60. package/Meshes/transformNode.d.ts +2 -2
  61. package/Meshes/transformNode.js +1 -1
  62. package/Meshes/transformNode.js.map +1 -1
  63. package/Particles/particleHelper.js +4 -4
  64. package/Particles/particleHelper.js.map +1 -1
  65. package/Rendering/geometryBufferRenderer.js +3 -2
  66. package/Rendering/geometryBufferRenderer.js.map +1 -1
  67. package/Shaders/ShadersInclude/helperFunctions.js +1 -1
  68. package/Shaders/ShadersInclude/helperFunctions.js.map +1 -1
  69. package/Shaders/geometry.fragment.js +1 -1
  70. package/Shaders/geometry.fragment.js.map +1 -1
  71. package/assetContainer.d.ts +1 -1
  72. package/assetContainer.js +11 -11
  73. package/assetContainer.js.map +1 -1
  74. package/package.json +1 -1
  75. package/scene.d.ts +6 -6
  76. package/scene.js +8 -6
  77. package/scene.js.map +1 -1
@@ -42,8 +42,8 @@ declare type RenderTargetWrapper = import("./renderTargetWrapper").RenderTargetW
42
42
  * @hidden
43
43
  */
44
44
  export interface ISceneLike {
45
- _addPendingData(data: any): void;
46
- _removePendingData(data: any): void;
45
+ addPendingData(data: any): void;
46
+ removePendingData(data: any): void;
47
47
  offlineProvider: IOfflineProvider;
48
48
  }
49
49
  /**
@@ -126,6 +126,11 @@ export interface EngineOptions extends WebGLContextAttributes {
126
126
  * This will not influence NativeEngine and WebGPUEngine which set the behavior to true during construction.
127
127
  */
128
128
  forceSRGBBufferSupportState?: boolean;
129
+ /**
130
+ * True if the more expensive but exact conversions should be used for transforming colors to and from linear space within shaders.
131
+ * Otherwise, the default is to use a cheaper approximation.
132
+ */
133
+ useExactSrgbConversions?: boolean;
129
134
  }
130
135
  /**
131
136
  * The base engine class (root of all engines)
@@ -463,6 +468,11 @@ export declare class ThinEngine {
463
468
  */
464
469
  get snapshotRenderingMode(): number;
465
470
  set snapshotRenderingMode(mode: number);
471
+ protected _useExactSrgbConversions: boolean;
472
+ /**
473
+ * Gets a boolean indicating if the exact sRGB conversions or faster approximations are used for converting to and from linear space.
474
+ */
475
+ get useExactSrgbConversions(): boolean;
466
476
  /**
467
477
  * Creates a new snapshot at the next frame using the current snapshotRenderingMode
468
478
  */
@@ -183,6 +183,7 @@ var ThinEngine = /** @class */ (function () {
183
183
  /** @hidden */
184
184
  this._isWebGPU = false;
185
185
  this._snapshotRenderingMode = 0;
186
+ this._useExactSrgbConversions = false;
186
187
  this._viewportCached = { x: 0, y: 0, z: 0, w: 0 };
187
188
  this._unpackFlipYCached = null;
188
189
  /**
@@ -239,6 +240,9 @@ var ThinEngine = /** @class */ (function () {
239
240
  if (options.xrCompatible === undefined) {
240
241
  options.xrCompatible = true;
241
242
  }
243
+ if (options.useExactSrgbConversions !== undefined) {
244
+ this._useExactSrgbConversions = options.useExactSrgbConversions;
245
+ }
242
246
  this._doNotHandleContextLost = options.doNotHandleContextLost ? true : false;
243
247
  // Exceptions
244
248
  if (navigator && navigator.userAgent) {
@@ -405,7 +409,7 @@ var ThinEngine = /** @class */ (function () {
405
409
  */
406
410
  // Not mixed with Version for tooling purpose.
407
411
  get: function () {
408
- return "babylonjs@5.15.1";
412
+ return "babylonjs@5.16.0";
409
413
  },
410
414
  enumerable: false,
411
415
  configurable: true
@@ -415,7 +419,7 @@ var ThinEngine = /** @class */ (function () {
415
419
  * Returns the current version of the framework
416
420
  */
417
421
  get: function () {
418
- return "5.15.1";
422
+ return "5.16.0";
419
423
  },
420
424
  enumerable: false,
421
425
  configurable: true
@@ -702,6 +706,16 @@ var ThinEngine = /** @class */ (function () {
702
706
  enumerable: false,
703
707
  configurable: true
704
708
  });
709
+ Object.defineProperty(ThinEngine.prototype, "useExactSrgbConversions", {
710
+ /**
711
+ * Gets a boolean indicating if the exact sRGB conversions or faster approximations are used for converting to and from linear space.
712
+ */
713
+ get: function () {
714
+ return this._useExactSrgbConversions;
715
+ },
716
+ enumerable: false,
717
+ configurable: true
718
+ });
705
719
  /**
706
720
  * Creates a new snapshot at the next frame using the current snapshotRenderingMode
707
721
  */
@@ -2240,6 +2254,12 @@ var ThinEngine = /** @class */ (function () {
2240
2254
  else {
2241
2255
  delete defines["USE_REVERSE_DEPTHBUFFER"];
2242
2256
  }
2257
+ if (this.useExactSrgbConversions) {
2258
+ defines["USE_EXACT_SRGB_CONVERSIONS"] = "";
2259
+ }
2260
+ else {
2261
+ delete defines["USE_EXACT_SRGB_CONVERSIONS"];
2262
+ }
2243
2263
  return;
2244
2264
  }
2245
2265
  else {
@@ -2253,6 +2273,12 @@ var ThinEngine = /** @class */ (function () {
2253
2273
  }
2254
2274
  s += "#define USE_REVERSE_DEPTHBUFFER";
2255
2275
  }
2276
+ if (this.useExactSrgbConversions) {
2277
+ if (s) {
2278
+ s += "\n";
2279
+ }
2280
+ s += "#define USE_EXACT_SRGB_CONVERSIONS";
2281
+ }
2256
2282
  return s;
2257
2283
  }
2258
2284
  };
@@ -3196,7 +3222,7 @@ var ThinEngine = /** @class */ (function () {
3196
3222
  }
3197
3223
  }
3198
3224
  if (scene) {
3199
- scene._addPendingData(texture);
3225
+ scene.addPendingData(texture);
3200
3226
  }
3201
3227
  texture.url = url;
3202
3228
  texture.generateMipMaps = !noMipmap;
@@ -3216,7 +3242,7 @@ var ThinEngine = /** @class */ (function () {
3216
3242
  }
3217
3243
  var onInternalError = function (message, exception) {
3218
3244
  if (scene) {
3219
- scene._removePendingData(texture);
3245
+ scene.removePendingData(texture);
3220
3246
  }
3221
3247
  if (url === originalUrl) {
3222
3248
  if (onLoadObserver) {
@@ -3773,7 +3799,7 @@ var ThinEngine = /** @class */ (function () {
3773
3799
  this._bindTextureDirectly(gl.TEXTURE_2D, null);
3774
3800
  // this.resetTextureCache();
3775
3801
  if (scene) {
3776
- scene._removePendingData(texture);
3802
+ scene.removePendingData(texture);
3777
3803
  }
3778
3804
  texture.onLoadedObservable.notifyObservers(texture);
3779
3805
  texture.onLoadedObservable.clear();
@@ -3791,7 +3817,7 @@ var ThinEngine = /** @class */ (function () {
3791
3817
  if (!texture._hardwareTexture) {
3792
3818
  // this.resetTextureCache();
3793
3819
  if (scene) {
3794
- scene._removePendingData(texture);
3820
+ scene.removePendingData(texture);
3795
3821
  }
3796
3822
  return;
3797
3823
  }