@babylonjs/core 5.2.0 → 5.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.
- package/Animations/animatable.js +1 -1
- package/Animations/animatable.js.map +1 -1
- package/Behaviors/Cameras/autoRotationBehavior.d.ts +7 -0
- package/Behaviors/Cameras/autoRotationBehavior.js +15 -0
- package/Behaviors/Cameras/autoRotationBehavior.js.map +1 -1
- package/Behaviors/Meshes/pointerDragBehavior.js +1 -0
- package/Behaviors/Meshes/pointerDragBehavior.js.map +1 -1
- package/Bones/skeleton.js +2 -0
- package/Bones/skeleton.js.map +1 -1
- package/Cameras/camera.d.ts +2 -1
- package/Cameras/camera.js +4 -1
- package/Cameras/camera.js.map +1 -1
- package/DeviceInput/Helpers/eventFactory.js +14 -3
- package/DeviceInput/Helpers/eventFactory.js.map +1 -1
- package/DeviceInput/InputDevices/deviceTypes.d.ts +1 -1
- package/DeviceInput/InputDevices/deviceTypes.js.map +1 -1
- package/DeviceInput/InputDevices/nativeDeviceInputSystem.js +2 -8
- package/DeviceInput/InputDevices/nativeDeviceInputSystem.js.map +1 -1
- package/Engines/Extensions/engine.renderTarget.js +4 -2
- package/Engines/Extensions/engine.renderTarget.js.map +1 -1
- package/Engines/Processors/shaderProcessor.js +1 -1
- package/Engines/Processors/shaderProcessor.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.renderTarget.js +13 -9
- package/Engines/WebGPU/Extensions/engine.renderTarget.js.map +1 -1
- package/Engines/WebGPU/webgpuBundleList.d.ts +1 -1
- package/Engines/WebGPU/webgpuBundleList.js.map +1 -1
- package/Engines/WebGPU/webgpuCacheRenderPipeline.d.ts +2 -2
- package/Engines/WebGPU/webgpuCacheRenderPipeline.js +28 -17
- package/Engines/WebGPU/webgpuCacheRenderPipeline.js.map +1 -1
- package/Engines/WebGPU/webgpuClearQuad.d.ts +1 -1
- package/Engines/WebGPU/webgpuClearQuad.js +3 -3
- package/Engines/WebGPU/webgpuClearQuad.js.map +1 -1
- package/Engines/WebGPU/webgpuRenderPassWrapper.d.ts +1 -1
- package/Engines/WebGPU/webgpuRenderPassWrapper.js.map +1 -1
- package/Engines/WebGPU/webgpuShaderProcessorsWGSL.js +1 -1
- package/Engines/WebGPU/webgpuShaderProcessorsWGSL.js.map +1 -1
- package/Engines/WebGPU/webgpuTextureHelper.d.ts +1 -0
- package/Engines/WebGPU/webgpuTextureHelper.js +16 -3
- package/Engines/WebGPU/webgpuTextureHelper.js.map +1 -1
- package/Engines/constants.d.ts +4 -0
- package/Engines/constants.js +4 -0
- package/Engines/constants.js.map +1 -1
- package/Engines/engine.d.ts +2 -2
- package/Engines/engine.js +1 -0
- package/Engines/engine.js.map +1 -1
- package/Engines/thinEngine.js +2 -2
- package/Engines/thinEngine.js.map +1 -1
- package/Engines/webgpuEngine.js +48 -32
- package/Engines/webgpuEngine.js.map +1 -1
- package/Gizmos/axisDragGizmo.js +1 -0
- package/Gizmos/axisDragGizmo.js.map +1 -1
- package/Gizmos/axisScaleGizmo.js +4 -2
- package/Gizmos/axisScaleGizmo.js.map +1 -1
- package/Gizmos/boundingBoxGizmo.js +5 -5
- package/Gizmos/boundingBoxGizmo.js.map +1 -1
- package/Gizmos/gizmo.js +3 -2
- package/Gizmos/gizmo.js.map +1 -1
- package/Gizmos/planeRotationGizmo.js +3 -3
- package/Gizmos/planeRotationGizmo.js.map +1 -1
- package/Layers/effectLayer.js +1 -1
- package/Layers/effectLayer.js.map +1 -1
- package/Lights/Shadows/shadowGenerator.d.ts +4 -0
- package/Lights/Shadows/shadowGenerator.js +5 -1
- package/Lights/Shadows/shadowGenerator.js.map +1 -1
- package/Loading/Plugins/babylonFileLoader.js +3 -3
- package/Loading/Plugins/babylonFileLoader.js.map +1 -1
- package/Materials/Background/backgroundMaterial.js +1 -1
- package/Materials/Background/backgroundMaterial.js.map +1 -1
- package/Materials/Node/Blocks/Dual/TBNBlock.d.ts +47 -0
- package/Materials/Node/Blocks/Dual/TBNBlock.js +154 -0
- package/Materials/Node/Blocks/Dual/TBNBlock.js.map +1 -0
- package/Materials/Node/Blocks/Dual/index.d.ts +1 -0
- package/Materials/Node/Blocks/Dual/index.js +1 -0
- package/Materials/Node/Blocks/Dual/index.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/perturbNormalBlock.d.ts +5 -1
- package/Materials/Node/Blocks/Fragment/perturbNormalBlock.js +20 -1
- package/Materials/Node/Blocks/Fragment/perturbNormalBlock.js.map +1 -1
- package/Materials/Node/Blocks/Input/inputBlock.js +1 -1
- package/Materials/Node/Blocks/Input/inputBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/anisotropyBlock.d.ts +4 -0
- package/Materials/Node/Blocks/PBR/anisotropyBlock.js +18 -1
- package/Materials/Node/Blocks/PBR/anisotropyBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/clearCoatBlock.d.ts +4 -0
- package/Materials/Node/Blocks/PBR/clearCoatBlock.js +18 -1
- package/Materials/Node/Blocks/PBR/clearCoatBlock.js.map +1 -1
- package/Materials/Node/Blocks/Vertex/morphTargetsBlock.js +2 -1
- package/Materials/Node/Blocks/Vertex/morphTargetsBlock.js.map +1 -1
- package/Materials/PBR/pbrBaseSimpleMaterial.d.ts +6 -5
- package/Materials/PBR/pbrBaseSimpleMaterial.js.map +1 -1
- package/Materials/PBR/pbrMaterial.d.ts +9 -9
- package/Materials/PBR/pbrMaterial.js.map +1 -1
- package/Materials/PBR/pbrMetallicRoughnessMaterial.d.ts +3 -2
- package/Materials/PBR/pbrMetallicRoughnessMaterial.js.map +1 -1
- package/Materials/PBR/pbrSpecularGlossinessMaterial.d.ts +3 -2
- package/Materials/PBR/pbrSpecularGlossinessMaterial.js.map +1 -1
- package/Materials/Textures/cubeTexture.js +3 -0
- package/Materials/Textures/cubeTexture.js.map +1 -1
- package/Materials/Textures/renderTargetTexture.d.ts +2 -1
- package/Materials/Textures/renderTargetTexture.js +24 -20
- package/Materials/Textures/renderTargetTexture.js.map +1 -1
- package/Materials/Textures/textureCreationOptions.d.ts +2 -0
- package/Materials/Textures/textureCreationOptions.js.map +1 -1
- package/Materials/materialHelper.js +1 -1
- package/Materials/materialHelper.js.map +1 -1
- package/Materials/shaderMaterial.js +1 -0
- package/Materials/shaderMaterial.js.map +1 -1
- package/Materials/uniformBuffer.d.ts +2 -1
- package/Materials/uniformBuffer.js +2 -1
- package/Materials/uniformBuffer.js.map +1 -1
- package/Maths/math.vector.d.ts +4 -0
- package/Maths/math.vector.js +12 -0
- package/Maths/math.vector.js.map +1 -1
- package/Meshes/instancedMesh.js +0 -1
- package/Meshes/instancedMesh.js.map +1 -1
- package/Meshes/subMesh.js +1 -1
- package/Meshes/subMesh.js.map +1 -1
- package/Meshes/thinInstanceMesh.js +34 -5
- package/Meshes/thinInstanceMesh.js.map +1 -1
- package/Misc/sceneOptimizer.d.ts +3 -2
- package/Misc/sceneOptimizer.js +4 -1
- package/Misc/sceneOptimizer.js.map +1 -1
- package/Misc/screenshotTools.js +6 -6
- package/Misc/screenshotTools.js.map +1 -1
- package/Physics/Plugins/oimoJSPlugin.js +1 -1
- package/Physics/Plugins/oimoJSPlugin.js.map +1 -1
- package/PostProcesses/volumetricLightScatteringPostProcess.js +6 -1
- package/PostProcesses/volumetricLightScatteringPostProcess.js.map +1 -1
- package/Rendering/renderingGroup.js +8 -0
- package/Rendering/renderingGroup.js.map +1 -1
- package/Shaders/pbr.vertex.js +1 -1
- package/Shaders/pbr.vertex.js.map +1 -1
- package/Shaders/spriteMap.fragment.js +1 -1
- package/Shaders/spriteMap.fragment.js.map +1 -1
- package/XR/features/WebXRControllerPointerSelection.js +1 -0
- package/XR/features/WebXRControllerPointerSelection.js.map +1 -1
- package/package.json +1 -1
- package/scene.d.ts +3 -1
- package/scene.js +9 -5
- package/scene.js.map +1 -1
package/Engines/webgpuEngine.js
CHANGED
|
@@ -675,8 +675,8 @@ var WebGPUEngine = /** @class */ (function (_super) {
|
|
|
675
675
|
depthLoadOp: WebGPUConstants.LoadOp.Clear,
|
|
676
676
|
depthStoreOp: WebGPUConstants.StoreOp.Store,
|
|
677
677
|
stencilClearValue: this._clearStencilValue,
|
|
678
|
-
stencilLoadOp: WebGPUConstants.LoadOp.Clear,
|
|
679
|
-
stencilStoreOp: WebGPUConstants.StoreOp.Store,
|
|
678
|
+
stencilLoadOp: !this.isStencilEnable ? undefined : WebGPUConstants.LoadOp.Clear,
|
|
679
|
+
stencilStoreOp: !this.isStencilEnable ? undefined : WebGPUConstants.StoreOp.Store,
|
|
680
680
|
};
|
|
681
681
|
this._mainRenderPassWrapper.renderPassDescriptor = {
|
|
682
682
|
colorAttachments: mainColorAttachments,
|
|
@@ -1952,8 +1952,13 @@ var WebGPUEngine = /** @class */ (function (_super) {
|
|
|
1952
1952
|
if (hasAlpha === void 0) { hasAlpha = true; }
|
|
1953
1953
|
if (flushRenderer === void 0) { flushRenderer = true; }
|
|
1954
1954
|
var renderPassWrapper = this._rttRenderPassWrapper.renderPass ? this._rttRenderPassWrapper : this._mainRenderPassWrapper;
|
|
1955
|
-
var
|
|
1956
|
-
|
|
1955
|
+
var hardwareTexture = renderPassWrapper.colorAttachmentGPUTextures[0];
|
|
1956
|
+
if (!hardwareTexture) {
|
|
1957
|
+
// we are calling readPixels for a render pass with no color texture bound
|
|
1958
|
+
return Promise.resolve(new Uint8Array(0));
|
|
1959
|
+
}
|
|
1960
|
+
var gpuTexture = hardwareTexture.underlyingResource;
|
|
1961
|
+
var gpuTextureFormat = hardwareTexture.format;
|
|
1957
1962
|
if (!gpuTexture) {
|
|
1958
1963
|
// we are calling readPixels before startMainRenderPass has been called and no RTT is bound, so swapChainTexture is not setup yet!
|
|
1959
1964
|
return Promise.resolve(new Uint8Array(0));
|
|
@@ -2089,6 +2094,7 @@ var WebGPUEngine = /** @class */ (function (_super) {
|
|
|
2089
2094
|
var gpuDepthStencilMSAATexture = gpuDepthStencilWrapper === null || gpuDepthStencilWrapper === void 0 ? void 0 : gpuDepthStencilWrapper.msaaTexture;
|
|
2090
2095
|
var depthTextureView = gpuDepthStencilTexture === null || gpuDepthStencilTexture === void 0 ? void 0 : gpuDepthStencilTexture.createView(this._rttRenderPassWrapper.depthAttachmentViewDescriptor);
|
|
2091
2096
|
var depthMSAATextureView = gpuDepthStencilMSAATexture === null || gpuDepthStencilMSAATexture === void 0 ? void 0 : gpuDepthStencilMSAATexture.createView(this._rttRenderPassWrapper.depthAttachmentViewDescriptor);
|
|
2097
|
+
var depthTextureHasStencil = gpuDepthStencilWrapper ? WebGPUTextureHelper.HasStencilAspect(gpuDepthStencilWrapper.format) : false;
|
|
2092
2098
|
var colorAttachments = [];
|
|
2093
2099
|
if (this.useReverseDepthBuffer) {
|
|
2094
2100
|
this.setDepthFunctionToGreaterOrEqual();
|
|
@@ -2126,18 +2132,23 @@ var WebGPUEngine = /** @class */ (function (_super) {
|
|
|
2126
2132
|
else {
|
|
2127
2133
|
// single render target
|
|
2128
2134
|
var internalTexture = rtWrapper.texture;
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2135
|
+
if (internalTexture) {
|
|
2136
|
+
var gpuWrapper = internalTexture._hardwareTexture;
|
|
2137
|
+
var gpuTexture = gpuWrapper.underlyingResource;
|
|
2138
|
+
var gpuMSAATexture = gpuWrapper.msaaTexture;
|
|
2139
|
+
var colorTextureView = gpuTexture.createView(this._rttRenderPassWrapper.colorAttachmentViewDescriptor);
|
|
2140
|
+
var colorMSAATextureView = gpuMSAATexture === null || gpuMSAATexture === void 0 ? void 0 : gpuMSAATexture.createView(this._rttRenderPassWrapper.colorAttachmentViewDescriptor);
|
|
2141
|
+
colorAttachments.push({
|
|
2142
|
+
view: colorMSAATextureView ? colorMSAATextureView : colorTextureView,
|
|
2143
|
+
resolveTarget: gpuMSAATexture ? colorTextureView : undefined,
|
|
2144
|
+
clearValue: mustClearColor ? clearColor : undefined,
|
|
2145
|
+
loadOp: mustClearColor ? WebGPUConstants.LoadOp.Clear : WebGPUConstants.LoadOp.Load,
|
|
2146
|
+
storeOp: WebGPUConstants.StoreOp.Store,
|
|
2147
|
+
});
|
|
2148
|
+
}
|
|
2149
|
+
else {
|
|
2150
|
+
colorAttachments.push(null);
|
|
2151
|
+
}
|
|
2141
2152
|
}
|
|
2142
2153
|
(_a = this._debugPushGroup) === null || _a === void 0 ? void 0 : _a.call(this, "render target pass", 1);
|
|
2143
2154
|
this._rttRenderPassWrapper.renderPassDescriptor = {
|
|
@@ -2149,8 +2160,12 @@ var WebGPUEngine = /** @class */ (function (_super) {
|
|
|
2149
2160
|
depthLoadOp: mustClearDepth ? WebGPUConstants.LoadOp.Clear : WebGPUConstants.LoadOp.Load,
|
|
2150
2161
|
depthStoreOp: WebGPUConstants.StoreOp.Store,
|
|
2151
2162
|
stencilClearValue: rtWrapper._depthStencilTextureWithStencil && mustClearStencil ? this._clearStencilValue : undefined,
|
|
2152
|
-
stencilLoadOp:
|
|
2153
|
-
|
|
2163
|
+
stencilLoadOp: !depthTextureHasStencil
|
|
2164
|
+
? undefined
|
|
2165
|
+
: rtWrapper._depthStencilTextureWithStencil && mustClearStencil
|
|
2166
|
+
? WebGPUConstants.LoadOp.Clear
|
|
2167
|
+
: WebGPUConstants.LoadOp.Load,
|
|
2168
|
+
stencilStoreOp: !depthTextureHasStencil ? undefined : WebGPUConstants.StoreOp.Store,
|
|
2154
2169
|
}
|
|
2155
2170
|
: undefined,
|
|
2156
2171
|
occlusionQuerySet: ((_b = this._occlusionQuery) === null || _b === void 0 ? void 0 : _b.hasQueries) ? this._occlusionQuery.querySet : undefined,
|
|
@@ -2177,10 +2192,10 @@ var WebGPUEngine = /** @class */ (function (_super) {
|
|
|
2177
2192
|
};
|
|
2178
2193
|
/** @hidden */
|
|
2179
2194
|
WebGPUEngine.prototype._endRenderTargetRenderPass = function () {
|
|
2180
|
-
var _a, _b, _c;
|
|
2195
|
+
var _a, _b, _c, _d;
|
|
2181
2196
|
if (this._currentRenderPass) {
|
|
2182
|
-
var gpuWrapper = this._currentRenderTarget.texture._hardwareTexture;
|
|
2183
|
-
if (!this._snapshotRendering.endRenderTargetPass(this._currentRenderPass, gpuWrapper) && !this.compatibilityMode) {
|
|
2197
|
+
var gpuWrapper = (_a = this._currentRenderTarget.texture) === null || _a === void 0 ? void 0 : _a._hardwareTexture;
|
|
2198
|
+
if (gpuWrapper && !this._snapshotRendering.endRenderTargetPass(this._currentRenderPass, gpuWrapper) && !this.compatibilityMode) {
|
|
2184
2199
|
this._bundleListRenderTarget.run(this._currentRenderPass);
|
|
2185
2200
|
this._bundleListRenderTarget.reset();
|
|
2186
2201
|
}
|
|
@@ -2190,10 +2205,10 @@ var WebGPUEngine = /** @class */ (function (_super) {
|
|
|
2190
2205
|
this._count = 0;
|
|
2191
2206
|
}
|
|
2192
2207
|
if (!this._count || this._count < this.dbgVerboseLogsNumFrames) {
|
|
2193
|
-
console.log("frame #" + this._count + " - render target end pass - internalTexture.uniqueId=", (
|
|
2208
|
+
console.log("frame #" + this._count + " - render target end pass - internalTexture.uniqueId=", (_c = (_b = this._currentRenderTarget) === null || _b === void 0 ? void 0 : _b.texture) === null || _c === void 0 ? void 0 : _c.uniqueId);
|
|
2194
2209
|
}
|
|
2195
2210
|
}
|
|
2196
|
-
(
|
|
2211
|
+
(_d = this._debugPopGroup) === null || _d === void 0 ? void 0 : _d.call(this, 1);
|
|
2197
2212
|
this._resetCurrentViewport(1);
|
|
2198
2213
|
this._resetCurrentScissor(1);
|
|
2199
2214
|
this._resetCurrentStencilRef(1);
|
|
@@ -2236,7 +2251,11 @@ var WebGPUEngine = /** @class */ (function (_super) {
|
|
|
2236
2251
|
: undefined;
|
|
2237
2252
|
this._mainRenderPassWrapper.renderPassDescriptor.depthStencilAttachment.depthLoadOp = mustClearDepth ? WebGPUConstants.LoadOp.Clear : WebGPUConstants.LoadOp.Load;
|
|
2238
2253
|
this._mainRenderPassWrapper.renderPassDescriptor.depthStencilAttachment.stencilClearValue = mustClearStencil ? this._clearStencilValue : undefined;
|
|
2239
|
-
this._mainRenderPassWrapper.renderPassDescriptor.depthStencilAttachment.stencilLoadOp =
|
|
2254
|
+
this._mainRenderPassWrapper.renderPassDescriptor.depthStencilAttachment.stencilLoadOp = !this.isStencilEnable
|
|
2255
|
+
? undefined
|
|
2256
|
+
: mustClearStencil
|
|
2257
|
+
? WebGPUConstants.LoadOp.Clear
|
|
2258
|
+
: WebGPUConstants.LoadOp.Load;
|
|
2240
2259
|
this._mainRenderPassWrapper.renderPassDescriptor.occlusionQuerySet = ((_a = this._occlusionQuery) === null || _a === void 0 ? void 0 : _a.hasQueries) ? this._occlusionQuery.querySet : undefined;
|
|
2241
2260
|
this._swapChainTexture = this._context.getCurrentTexture();
|
|
2242
2261
|
this._mainRenderPassWrapper.colorAttachmentGPUTextures[0].set(this._swapChainTexture);
|
|
@@ -2311,17 +2330,13 @@ var WebGPUEngine = /** @class */ (function (_super) {
|
|
|
2311
2330
|
if (lodLevel === void 0) { lodLevel = 0; }
|
|
2312
2331
|
if (layer === void 0) { layer = 0; }
|
|
2313
2332
|
var hardwareTexture = (_a = texture.texture) === null || _a === void 0 ? void 0 : _a._hardwareTexture;
|
|
2314
|
-
if (!hardwareTexture) {
|
|
2315
|
-
if (this.dbgSanityChecks) {
|
|
2316
|
-
console.error("bindFramebuffer: Trying to bind a texture that does not have a hardware texture!", texture, hardwareTexture);
|
|
2317
|
-
}
|
|
2318
|
-
return;
|
|
2319
|
-
}
|
|
2320
2333
|
if (this._currentRenderTarget) {
|
|
2321
2334
|
this.unBindFramebuffer(this._currentRenderTarget);
|
|
2322
2335
|
}
|
|
2323
2336
|
this._currentRenderTarget = texture;
|
|
2324
|
-
hardwareTexture
|
|
2337
|
+
if (hardwareTexture) {
|
|
2338
|
+
hardwareTexture._currentLayer = texture.isCube ? layer * 6 + faceIndex : layer;
|
|
2339
|
+
}
|
|
2325
2340
|
this._rttRenderPassWrapper.colorAttachmentGPUTextures[0] = hardwareTexture;
|
|
2326
2341
|
this._rttRenderPassWrapper.depthTextureFormat = this._currentRenderTarget._depthStencilTexture
|
|
2327
2342
|
? WebGPUTextureHelper.GetWebGPUTextureFormat(-1, this._currentRenderTarget._depthStencilTexture.format)
|
|
@@ -2444,7 +2459,8 @@ var WebGPUEngine = /** @class */ (function (_super) {
|
|
|
2444
2459
|
* @hidden
|
|
2445
2460
|
*/
|
|
2446
2461
|
WebGPUEngine.prototype._setColorFormat = function (wrapper) {
|
|
2447
|
-
var
|
|
2462
|
+
var _a, _b;
|
|
2463
|
+
var format = (_b = (_a = wrapper.colorAttachmentGPUTextures[0]) === null || _a === void 0 ? void 0 : _a.format) !== null && _b !== void 0 ? _b : null;
|
|
2448
2464
|
this._cacheRenderPipeline.setColorFormat(format);
|
|
2449
2465
|
if (this._colorFormat === format) {
|
|
2450
2466
|
return;
|