@babylonjs/core 5.14.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.
- package/Audio/sound.js +2 -2
- package/Audio/sound.js.map +1 -1
- package/Cameras/Inputs/BaseCameraMouseWheelInput.d.ts +1 -1
- package/Cameras/Inputs/BaseCameraMouseWheelInput.js +8 -2
- package/Cameras/Inputs/BaseCameraMouseWheelInput.js.map +1 -1
- package/Cameras/Inputs/arcRotateCameraMouseWheelInput.d.ts +0 -1
- package/Cameras/Inputs/arcRotateCameraMouseWheelInput.js +7 -2
- package/Cameras/Inputs/arcRotateCameraMouseWheelInput.js.map +1 -1
- package/Cameras/Inputs/followCameraMouseWheelInput.d.ts +0 -1
- package/Cameras/Inputs/followCameraMouseWheelInput.js +7 -2
- package/Cameras/Inputs/followCameraMouseWheelInput.js.map +1 -1
- package/Cameras/arcRotateCamera.js +8 -2
- package/Cameras/arcRotateCamera.js.map +1 -1
- package/Cameras/camera.d.ts +15 -5
- package/Cameras/camera.js +81 -10
- package/Cameras/camera.js.map +1 -1
- package/Cameras/targetCamera.js +5 -0
- package/Cameras/targetCamera.js.map +1 -1
- package/DeviceInput/InputDevices/deviceSourceManager.js +4 -0
- package/DeviceInput/InputDevices/deviceSourceManager.js.map +1 -1
- package/DeviceInput/InputDevices/internalDeviceSourceManager.d.ts +2 -1
- package/DeviceInput/InputDevices/internalDeviceSourceManager.js.map +1 -1
- package/DeviceInput/InputDevices/webDeviceInputSystem.js +2 -4
- package/DeviceInput/InputDevices/webDeviceInputSystem.js.map +1 -1
- package/Engines/Extensions/engine.cubeTexture.js +3 -3
- package/Engines/Extensions/engine.cubeTexture.js.map +1 -1
- package/Engines/Extensions/engine.rawTexture.js +3 -3
- package/Engines/Extensions/engine.rawTexture.js.map +1 -1
- package/Engines/Native/nativeInterfaces.d.ts +1 -0
- package/Engines/Native/nativeInterfaces.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.rawTexture.js +3 -3
- package/Engines/WebGPU/Extensions/engine.rawTexture.js.map +1 -1
- package/Engines/WebGPU/webgpuShaderProcessorsGLSL.js +6 -6
- package/Engines/WebGPU/webgpuShaderProcessorsGLSL.js.map +1 -1
- package/Engines/WebGPU/webgpuShaderProcessorsWGSL.js +4 -4
- package/Engines/WebGPU/webgpuShaderProcessorsWGSL.js.map +1 -1
- package/Engines/nativeEngine.d.ts +1 -0
- package/Engines/nativeEngine.js +18 -4
- package/Engines/nativeEngine.js.map +1 -1
- package/Engines/thinEngine.d.ts +17 -3
- package/Engines/thinEngine.js +43 -11
- package/Engines/thinEngine.js.map +1 -1
- package/Engines/webgpuEngine.js +1 -1
- package/Engines/webgpuEngine.js.map +1 -1
- package/Inputs/scene.inputManager.js +5 -1
- package/Inputs/scene.inputManager.js.map +1 -1
- package/Legacy/legacy.js +10 -6
- package/Legacy/legacy.js.map +1 -1
- package/Loading/sceneLoader.js +9 -9
- package/Loading/sceneLoader.js.map +1 -1
- package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.js +2 -1
- package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.js.map +1 -1
- package/Materials/Node/Blocks/elbowBlock.js +5 -3
- package/Materials/Node/Blocks/elbowBlock.js.map +1 -1
- package/Materials/PBR/pbrBaseMaterial.js +4 -4
- package/Materials/PBR/pbrBaseMaterial.js.map +1 -1
- package/Materials/PBR/pbrClearCoatConfiguration.d.ts +1 -1
- package/Materials/PBR/pbrClearCoatConfiguration.js +1 -1
- package/Materials/PBR/pbrClearCoatConfiguration.js.map +1 -1
- package/Materials/PBR/pbrIridescenceConfiguration.d.ts +1 -1
- package/Materials/PBR/pbrIridescenceConfiguration.js +1 -1
- package/Materials/PBR/pbrIridescenceConfiguration.js.map +1 -1
- package/Materials/PBR/pbrSheenConfiguration.d.ts +1 -1
- package/Materials/PBR/pbrSheenConfiguration.js +1 -1
- package/Materials/PBR/pbrSheenConfiguration.js.map +1 -1
- package/Materials/PBR/pbrSubSurfaceConfiguration.d.ts +1 -1
- package/Materials/PBR/pbrSubSurfaceConfiguration.js +1 -1
- package/Materials/PBR/pbrSubSurfaceConfiguration.js.map +1 -1
- package/Materials/Textures/Loaders/basisTextureLoader.js +6 -1
- package/Materials/Textures/Loaders/basisTextureLoader.js.map +1 -1
- package/Materials/Textures/baseTexture.d.ts +1 -1
- package/Materials/Textures/baseTexture.js +2 -2
- package/Materials/Textures/baseTexture.js.map +1 -1
- package/Materials/Textures/videoTexture.js +4 -1
- package/Materials/Textures/videoTexture.js.map +1 -1
- package/Materials/imageProcessingConfiguration.js.map +1 -1
- package/Materials/materialHelper.d.ts +1 -1
- package/Materials/materialHelper.js +6 -6
- package/Materials/materialHelper.js.map +1 -1
- package/Maths/math.color.d.ts +15 -3
- package/Maths/math.color.js +26 -3
- package/Maths/math.color.js.map +1 -1
- package/Meshes/Builders/discBuilder.d.ts +26 -0
- package/Meshes/Builders/discBuilder.js +1 -1
- package/Meshes/Builders/discBuilder.js.map +1 -1
- package/Meshes/geometry.js +2 -2
- package/Meshes/geometry.js.map +1 -1
- package/Meshes/mesh.d.ts +1 -1
- package/Meshes/mesh.js +8 -7
- package/Meshes/mesh.js.map +1 -1
- package/Meshes/transformNode.d.ts +3 -3
- package/Meshes/transformNode.js +2 -2
- package/Meshes/transformNode.js.map +1 -1
- package/Misc/basis.d.ts +8 -0
- package/Misc/basis.js +74 -32
- package/Misc/basis.js.map +1 -1
- package/Misc/screenshotTools.js +3 -0
- package/Misc/screenshotTools.js.map +1 -1
- package/Particles/particleHelper.js +4 -4
- package/Particles/particleHelper.js.map +1 -1
- package/PostProcesses/volumetricLightScatteringPostProcess.d.ts +0 -2
- package/PostProcesses/volumetricLightScatteringPostProcess.js +22 -15
- package/PostProcesses/volumetricLightScatteringPostProcess.js.map +1 -1
- package/Rendering/geometryBufferRenderer.js +3 -2
- package/Rendering/geometryBufferRenderer.js.map +1 -1
- package/Shaders/ShadersInclude/helperFunctions.js +1 -1
- package/Shaders/ShadersInclude/helperFunctions.js.map +1 -1
- package/Shaders/geometry.fragment.js +1 -1
- package/Shaders/geometry.fragment.js.map +1 -1
- package/XR/webXREnterExitUI.js +1 -1
- package/XR/webXREnterExitUI.js.map +1 -1
- package/assetContainer.d.ts +1 -1
- package/assetContainer.js +11 -11
- package/assetContainer.js.map +1 -1
- package/package.json +1 -1
- package/scene.d.ts +6 -6
- package/scene.js +8 -6
- package/scene.js.map +1 -1
package/Engines/thinEngine.d.ts
CHANGED
|
@@ -42,8 +42,8 @@ declare type RenderTargetWrapper = import("./renderTargetWrapper").RenderTargetW
|
|
|
42
42
|
* @hidden
|
|
43
43
|
*/
|
|
44
44
|
export interface ISceneLike {
|
|
45
|
-
|
|
46
|
-
|
|
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)
|
|
@@ -388,8 +393,12 @@ export declare class ThinEngine {
|
|
|
388
393
|
private _maxSimultaneousTextures;
|
|
389
394
|
private _maxMSAASamplesOverride;
|
|
390
395
|
private _activeRequests;
|
|
396
|
+
/**
|
|
397
|
+
* If set to true zooming in and out in the browser will rescale the hardware-scaling correctly.
|
|
398
|
+
*/
|
|
399
|
+
adaptToDeviceRatio: boolean;
|
|
391
400
|
/** @hidden */
|
|
392
|
-
private
|
|
401
|
+
private _lastDevicePixelRatio;
|
|
393
402
|
/** @hidden */
|
|
394
403
|
_transformTextureUrl: Nullable<(url: string) => string>;
|
|
395
404
|
/**
|
|
@@ -459,6 +468,11 @@ export declare class ThinEngine {
|
|
|
459
468
|
*/
|
|
460
469
|
get snapshotRenderingMode(): number;
|
|
461
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;
|
|
462
476
|
/**
|
|
463
477
|
* Creates a new snapshot at the next frame using the current snapshotRenderingMode
|
|
464
478
|
*/
|
package/Engines/thinEngine.js
CHANGED
|
@@ -158,8 +158,12 @@ var ThinEngine = /** @class */ (function () {
|
|
|
158
158
|
this._maxSimultaneousTextures = 0;
|
|
159
159
|
this._maxMSAASamplesOverride = null;
|
|
160
160
|
this._activeRequests = new Array();
|
|
161
|
+
/**
|
|
162
|
+
* If set to true zooming in and out in the browser will rescale the hardware-scaling correctly.
|
|
163
|
+
*/
|
|
164
|
+
this.adaptToDeviceRatio = false;
|
|
161
165
|
/** @hidden */
|
|
162
|
-
this.
|
|
166
|
+
this._lastDevicePixelRatio = 1.0;
|
|
163
167
|
/** @hidden */
|
|
164
168
|
this._transformTextureUrl = null;
|
|
165
169
|
/**
|
|
@@ -179,6 +183,7 @@ var ThinEngine = /** @class */ (function () {
|
|
|
179
183
|
/** @hidden */
|
|
180
184
|
this._isWebGPU = false;
|
|
181
185
|
this._snapshotRenderingMode = 0;
|
|
186
|
+
this._useExactSrgbConversions = false;
|
|
182
187
|
this._viewportCached = { x: 0, y: 0, z: 0, w: 0 };
|
|
183
188
|
this._unpackFlipYCached = null;
|
|
184
189
|
/**
|
|
@@ -192,7 +197,7 @@ var ThinEngine = /** @class */ (function () {
|
|
|
192
197
|
options = options || {};
|
|
193
198
|
this._creationOptions = options;
|
|
194
199
|
// Save this off for use in resize().
|
|
195
|
-
this.
|
|
200
|
+
this.adaptToDeviceRatio = adaptToDeviceRatio !== null && adaptToDeviceRatio !== void 0 ? adaptToDeviceRatio : false;
|
|
196
201
|
this._stencilStateComposer.stencilGlobal = this._stencilState;
|
|
197
202
|
PerformanceConfigurator.SetMatrixPrecision(!!options.useHighPrecisionMatrix);
|
|
198
203
|
if (!canvasOrContext) {
|
|
@@ -235,6 +240,9 @@ var ThinEngine = /** @class */ (function () {
|
|
|
235
240
|
if (options.xrCompatible === undefined) {
|
|
236
241
|
options.xrCompatible = true;
|
|
237
242
|
}
|
|
243
|
+
if (options.useExactSrgbConversions !== undefined) {
|
|
244
|
+
this._useExactSrgbConversions = options.useExactSrgbConversions;
|
|
245
|
+
}
|
|
238
246
|
this._doNotHandleContextLost = options.doNotHandleContextLost ? true : false;
|
|
239
247
|
// Exceptions
|
|
240
248
|
if (navigator && navigator.userAgent) {
|
|
@@ -368,6 +376,7 @@ var ThinEngine = /** @class */ (function () {
|
|
|
368
376
|
var devicePixelRatio = IsWindowObjectExist() ? window.devicePixelRatio || 1.0 : 1.0;
|
|
369
377
|
var limitDeviceRatio = options.limitDeviceRatio || devicePixelRatio;
|
|
370
378
|
this._hardwareScalingLevel = adaptToDeviceRatio ? 1.0 / Math.min(limitDeviceRatio, devicePixelRatio) : 1.0;
|
|
379
|
+
this._lastDevicePixelRatio = devicePixelRatio;
|
|
371
380
|
this.resize();
|
|
372
381
|
this._isStencilEnable = options.stencil ? true : false;
|
|
373
382
|
this._initGLContext();
|
|
@@ -400,7 +409,7 @@ var ThinEngine = /** @class */ (function () {
|
|
|
400
409
|
*/
|
|
401
410
|
// Not mixed with Version for tooling purpose.
|
|
402
411
|
get: function () {
|
|
403
|
-
return "babylonjs@5.
|
|
412
|
+
return "babylonjs@5.16.0";
|
|
404
413
|
},
|
|
405
414
|
enumerable: false,
|
|
406
415
|
configurable: true
|
|
@@ -410,7 +419,7 @@ var ThinEngine = /** @class */ (function () {
|
|
|
410
419
|
* Returns the current version of the framework
|
|
411
420
|
*/
|
|
412
421
|
get: function () {
|
|
413
|
-
return "5.
|
|
422
|
+
return "5.16.0";
|
|
414
423
|
},
|
|
415
424
|
enumerable: false,
|
|
416
425
|
configurable: true
|
|
@@ -697,6 +706,16 @@ var ThinEngine = /** @class */ (function () {
|
|
|
697
706
|
enumerable: false,
|
|
698
707
|
configurable: true
|
|
699
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
|
+
});
|
|
700
719
|
/**
|
|
701
720
|
* Creates a new snapshot at the next frame using the current snapshotRenderingMode
|
|
702
721
|
*/
|
|
@@ -1400,10 +1419,11 @@ var ThinEngine = /** @class */ (function () {
|
|
|
1400
1419
|
var width;
|
|
1401
1420
|
var height;
|
|
1402
1421
|
// Requery hardware scaling level to handle zoomed-in resizing.
|
|
1403
|
-
if (this.
|
|
1422
|
+
if (this.adaptToDeviceRatio) {
|
|
1404
1423
|
var devicePixelRatio_1 = IsWindowObjectExist() ? window.devicePixelRatio || 1.0 : 1.0;
|
|
1405
|
-
var
|
|
1406
|
-
this.
|
|
1424
|
+
var changeRatio = this._lastDevicePixelRatio / devicePixelRatio_1;
|
|
1425
|
+
this._lastDevicePixelRatio = devicePixelRatio_1;
|
|
1426
|
+
this._hardwareScalingLevel *= changeRatio;
|
|
1407
1427
|
}
|
|
1408
1428
|
if (IsWindowObjectExist()) {
|
|
1409
1429
|
width = this._renderingCanvas ? this._renderingCanvas.clientWidth || this._renderingCanvas.width : window.innerWidth;
|
|
@@ -2234,6 +2254,12 @@ var ThinEngine = /** @class */ (function () {
|
|
|
2234
2254
|
else {
|
|
2235
2255
|
delete defines["USE_REVERSE_DEPTHBUFFER"];
|
|
2236
2256
|
}
|
|
2257
|
+
if (this.useExactSrgbConversions) {
|
|
2258
|
+
defines["USE_EXACT_SRGB_CONVERSIONS"] = "";
|
|
2259
|
+
}
|
|
2260
|
+
else {
|
|
2261
|
+
delete defines["USE_EXACT_SRGB_CONVERSIONS"];
|
|
2262
|
+
}
|
|
2237
2263
|
return;
|
|
2238
2264
|
}
|
|
2239
2265
|
else {
|
|
@@ -2247,6 +2273,12 @@ var ThinEngine = /** @class */ (function () {
|
|
|
2247
2273
|
}
|
|
2248
2274
|
s += "#define USE_REVERSE_DEPTHBUFFER";
|
|
2249
2275
|
}
|
|
2276
|
+
if (this.useExactSrgbConversions) {
|
|
2277
|
+
if (s) {
|
|
2278
|
+
s += "\n";
|
|
2279
|
+
}
|
|
2280
|
+
s += "#define USE_EXACT_SRGB_CONVERSIONS";
|
|
2281
|
+
}
|
|
2250
2282
|
return s;
|
|
2251
2283
|
}
|
|
2252
2284
|
};
|
|
@@ -3190,7 +3222,7 @@ var ThinEngine = /** @class */ (function () {
|
|
|
3190
3222
|
}
|
|
3191
3223
|
}
|
|
3192
3224
|
if (scene) {
|
|
3193
|
-
scene.
|
|
3225
|
+
scene.addPendingData(texture);
|
|
3194
3226
|
}
|
|
3195
3227
|
texture.url = url;
|
|
3196
3228
|
texture.generateMipMaps = !noMipmap;
|
|
@@ -3210,7 +3242,7 @@ var ThinEngine = /** @class */ (function () {
|
|
|
3210
3242
|
}
|
|
3211
3243
|
var onInternalError = function (message, exception) {
|
|
3212
3244
|
if (scene) {
|
|
3213
|
-
scene.
|
|
3245
|
+
scene.removePendingData(texture);
|
|
3214
3246
|
}
|
|
3215
3247
|
if (url === originalUrl) {
|
|
3216
3248
|
if (onLoadObserver) {
|
|
@@ -3767,7 +3799,7 @@ var ThinEngine = /** @class */ (function () {
|
|
|
3767
3799
|
this._bindTextureDirectly(gl.TEXTURE_2D, null);
|
|
3768
3800
|
// this.resetTextureCache();
|
|
3769
3801
|
if (scene) {
|
|
3770
|
-
scene.
|
|
3802
|
+
scene.removePendingData(texture);
|
|
3771
3803
|
}
|
|
3772
3804
|
texture.onLoadedObservable.notifyObservers(texture);
|
|
3773
3805
|
texture.onLoadedObservable.clear();
|
|
@@ -3785,7 +3817,7 @@ var ThinEngine = /** @class */ (function () {
|
|
|
3785
3817
|
if (!texture._hardwareTexture) {
|
|
3786
3818
|
// this.resetTextureCache();
|
|
3787
3819
|
if (scene) {
|
|
3788
|
-
scene.
|
|
3820
|
+
scene.removePendingData(texture);
|
|
3789
3821
|
}
|
|
3790
3822
|
return;
|
|
3791
3823
|
}
|