@babylonjs/core 5.4.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/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 +11 -7
- 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/thinEngine.js +2 -2
- package/Engines/thinEngine.js.map +1 -1
- package/Engines/webgpuEngine.js +34 -27
- package/Engines/webgpuEngine.js.map +1 -1
- package/Gizmos/axisDragGizmo.js +1 -0
- package/Gizmos/axisDragGizmo.js.map +1 -1
- package/Gizmos/axisScaleGizmo.js +1 -0
- package/Gizmos/axisScaleGizmo.js.map +1 -1
- package/Loading/Plugins/babylonFileLoader.js +1 -1
- package/Loading/Plugins/babylonFileLoader.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/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/Maths/math.vector.js +2 -0
- package/Maths/math.vector.js.map +1 -1
- package/Meshes/instancedMesh.js +0 -1
- package/Meshes/instancedMesh.js.map +1 -1
- package/Meshes/thinInstanceMesh.js +32 -4
- 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/package.json +1 -1
- package/scene.js +2 -2
- package/scene.js.map +1 -1
package/Engines/webgpuEngine.js
CHANGED
|
@@ -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));
|
|
@@ -2127,18 +2132,23 @@ var WebGPUEngine = /** @class */ (function (_super) {
|
|
|
2127
2132
|
else {
|
|
2128
2133
|
// single render target
|
|
2129
2134
|
var internalTexture = rtWrapper.texture;
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
|
|
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
|
+
}
|
|
2142
2152
|
}
|
|
2143
2153
|
(_a = this._debugPushGroup) === null || _a === void 0 ? void 0 : _a.call(this, "render target pass", 1);
|
|
2144
2154
|
this._rttRenderPassWrapper.renderPassDescriptor = {
|
|
@@ -2182,10 +2192,10 @@ var WebGPUEngine = /** @class */ (function (_super) {
|
|
|
2182
2192
|
};
|
|
2183
2193
|
/** @hidden */
|
|
2184
2194
|
WebGPUEngine.prototype._endRenderTargetRenderPass = function () {
|
|
2185
|
-
var _a, _b, _c;
|
|
2195
|
+
var _a, _b, _c, _d;
|
|
2186
2196
|
if (this._currentRenderPass) {
|
|
2187
|
-
var gpuWrapper = this._currentRenderTarget.texture._hardwareTexture;
|
|
2188
|
-
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) {
|
|
2189
2199
|
this._bundleListRenderTarget.run(this._currentRenderPass);
|
|
2190
2200
|
this._bundleListRenderTarget.reset();
|
|
2191
2201
|
}
|
|
@@ -2195,10 +2205,10 @@ var WebGPUEngine = /** @class */ (function (_super) {
|
|
|
2195
2205
|
this._count = 0;
|
|
2196
2206
|
}
|
|
2197
2207
|
if (!this._count || this._count < this.dbgVerboseLogsNumFrames) {
|
|
2198
|
-
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);
|
|
2199
2209
|
}
|
|
2200
2210
|
}
|
|
2201
|
-
(
|
|
2211
|
+
(_d = this._debugPopGroup) === null || _d === void 0 ? void 0 : _d.call(this, 1);
|
|
2202
2212
|
this._resetCurrentViewport(1);
|
|
2203
2213
|
this._resetCurrentScissor(1);
|
|
2204
2214
|
this._resetCurrentStencilRef(1);
|
|
@@ -2320,17 +2330,13 @@ var WebGPUEngine = /** @class */ (function (_super) {
|
|
|
2320
2330
|
if (lodLevel === void 0) { lodLevel = 0; }
|
|
2321
2331
|
if (layer === void 0) { layer = 0; }
|
|
2322
2332
|
var hardwareTexture = (_a = texture.texture) === null || _a === void 0 ? void 0 : _a._hardwareTexture;
|
|
2323
|
-
if (!hardwareTexture) {
|
|
2324
|
-
if (this.dbgSanityChecks) {
|
|
2325
|
-
console.error("bindFramebuffer: Trying to bind a texture that does not have a hardware texture!", texture, hardwareTexture);
|
|
2326
|
-
}
|
|
2327
|
-
return;
|
|
2328
|
-
}
|
|
2329
2333
|
if (this._currentRenderTarget) {
|
|
2330
2334
|
this.unBindFramebuffer(this._currentRenderTarget);
|
|
2331
2335
|
}
|
|
2332
2336
|
this._currentRenderTarget = texture;
|
|
2333
|
-
hardwareTexture
|
|
2337
|
+
if (hardwareTexture) {
|
|
2338
|
+
hardwareTexture._currentLayer = texture.isCube ? layer * 6 + faceIndex : layer;
|
|
2339
|
+
}
|
|
2334
2340
|
this._rttRenderPassWrapper.colorAttachmentGPUTextures[0] = hardwareTexture;
|
|
2335
2341
|
this._rttRenderPassWrapper.depthTextureFormat = this._currentRenderTarget._depthStencilTexture
|
|
2336
2342
|
? WebGPUTextureHelper.GetWebGPUTextureFormat(-1, this._currentRenderTarget._depthStencilTexture.format)
|
|
@@ -2453,7 +2459,8 @@ var WebGPUEngine = /** @class */ (function (_super) {
|
|
|
2453
2459
|
* @hidden
|
|
2454
2460
|
*/
|
|
2455
2461
|
WebGPUEngine.prototype._setColorFormat = function (wrapper) {
|
|
2456
|
-
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;
|
|
2457
2464
|
this._cacheRenderPipeline.setColorFormat(format);
|
|
2458
2465
|
if (this._colorFormat === format) {
|
|
2459
2466
|
return;
|