@babylonjs/core 8.37.3 → 8.39.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/animation.d.ts +3 -1
- package/Animations/animation.js +5 -4
- package/Animations/animation.js.map +1 -1
- package/Behaviors/Cameras/autoRotationBehavior.d.ts +4 -0
- package/Behaviors/Cameras/autoRotationBehavior.js +7 -0
- package/Behaviors/Cameras/autoRotationBehavior.js.map +1 -1
- package/Behaviors/Cameras/bouncingBehavior.d.ts +5 -0
- package/Behaviors/Cameras/bouncingBehavior.js +8 -0
- package/Behaviors/Cameras/bouncingBehavior.js.map +1 -1
- package/Behaviors/Cameras/framingBehavior.d.ts +4 -0
- package/Behaviors/Cameras/framingBehavior.js +7 -0
- package/Behaviors/Cameras/framingBehavior.js.map +1 -1
- package/Behaviors/Cameras/interpolatingBehavior.d.ts +7 -1
- package/Behaviors/Cameras/interpolatingBehavior.js +21 -6
- package/Behaviors/Cameras/interpolatingBehavior.js.map +1 -1
- package/Behaviors/Meshes/attachToBoxBehavior.d.ts +5 -0
- package/Behaviors/Meshes/attachToBoxBehavior.js +8 -1
- package/Behaviors/Meshes/attachToBoxBehavior.js.map +1 -1
- package/Behaviors/Meshes/baseSixDofDragBehavior.d.ts +5 -2
- package/Behaviors/Meshes/baseSixDofDragBehavior.js +8 -0
- package/Behaviors/Meshes/baseSixDofDragBehavior.js.map +1 -1
- package/Behaviors/Meshes/fadeInOutBehavior.d.ts +5 -0
- package/Behaviors/Meshes/fadeInOutBehavior.js +6 -0
- package/Behaviors/Meshes/fadeInOutBehavior.js.map +1 -1
- package/Behaviors/Meshes/handConstraintBehavior.d.ts +5 -0
- package/Behaviors/Meshes/handConstraintBehavior.js +8 -0
- package/Behaviors/Meshes/handConstraintBehavior.js.map +1 -1
- package/Behaviors/Meshes/multiPointerScaleBehavior.d.ts +5 -0
- package/Behaviors/Meshes/multiPointerScaleBehavior.js +8 -0
- package/Behaviors/Meshes/multiPointerScaleBehavior.js.map +1 -1
- package/Behaviors/Meshes/sixDofDragBehavior.js +1 -1
- package/Behaviors/Meshes/sixDofDragBehavior.js.map +1 -1
- package/Behaviors/Meshes/surfaceMagnetismBehavior.d.ts +5 -0
- package/Behaviors/Meshes/surfaceMagnetismBehavior.js +7 -0
- package/Behaviors/Meshes/surfaceMagnetismBehavior.js.map +1 -1
- package/Behaviors/behavior.d.ts +4 -0
- package/Behaviors/behavior.js.map +1 -1
- package/Cameras/Inputs/geospatialCameraPointersInput.js +3 -5
- package/Cameras/Inputs/geospatialCameraPointersInput.js.map +1 -1
- package/Cameras/geospatialCamera.d.ts +19 -1
- package/Cameras/geospatialCamera.js +117 -28
- package/Cameras/geospatialCamera.js.map +1 -1
- package/Cameras/geospatialCameraMovement.d.ts +7 -2
- package/Cameras/geospatialCameraMovement.js +46 -10
- package/Cameras/geospatialCameraMovement.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.multiRender.d.ts +2 -1
- package/Engines/WebGPU/Extensions/engine.multiRender.js +5 -2
- package/Engines/WebGPU/Extensions/engine.multiRender.js.map +1 -1
- package/Engines/WebGPU/webgpuTextureHelper.d.ts +1 -0
- package/Engines/WebGPU/webgpuTextureHelper.js +11 -0
- package/Engines/WebGPU/webgpuTextureHelper.js.map +1 -1
- package/Engines/WebGPU/webgpuTextureManager.d.ts +1 -0
- package/Engines/WebGPU/webgpuTextureManager.js +100 -9
- package/Engines/WebGPU/webgpuTextureManager.js.map +1 -1
- package/Engines/abstractEngine.js +2 -2
- package/Engines/abstractEngine.js.map +1 -1
- package/Engines/renderTargetWrapper.js +6 -1
- package/Engines/renderTargetWrapper.js.map +1 -1
- package/Engines/thinEngine.js +1 -1
- package/Engines/thinEngine.js.map +1 -1
- package/Engines/webgpuEngine.d.ts +7 -4
- package/Engines/webgpuEngine.js +45 -16
- package/Engines/webgpuEngine.js.map +1 -1
- package/FrameGraph/Node/nodeRenderGraph.d.ts +22 -5
- package/FrameGraph/Node/nodeRenderGraph.js +39 -18
- package/FrameGraph/Node/nodeRenderGraph.js.map +1 -1
- package/FrameGraph/Passes/pass.d.ts +2 -0
- package/FrameGraph/Passes/pass.js +2 -0
- package/FrameGraph/Passes/pass.js.map +1 -1
- package/FrameGraph/Passes/renderPass.d.ts +2 -0
- package/FrameGraph/Passes/renderPass.js +4 -0
- package/FrameGraph/Passes/renderPass.js.map +1 -1
- package/FrameGraph/frameGraph.d.ts +13 -4
- package/FrameGraph/frameGraph.js +45 -5
- package/FrameGraph/frameGraph.js.map +1 -1
- package/FrameGraph/frameGraphRenderTarget.d.ts +1 -0
- package/FrameGraph/frameGraphRenderTarget.js +3 -0
- package/FrameGraph/frameGraphRenderTarget.js.map +1 -1
- package/FrameGraph/frameGraphTask.d.ts +6 -0
- package/FrameGraph/frameGraphTask.js +15 -0
- package/FrameGraph/frameGraphTask.js.map +1 -1
- package/FrameGraph/frameGraphTypes.d.ts +2 -0
- package/FrameGraph/frameGraphTypes.js.map +1 -1
- package/Helpers/sceneHelpers.js +1 -1
- package/Helpers/sceneHelpers.js.map +1 -1
- package/Lights/index.d.ts +1 -0
- package/Lights/index.js +1 -0
- package/Lights/index.js.map +1 -1
- package/Lights/lightingVolume.d.ts +89 -0
- package/Lights/lightingVolume.js +426 -0
- package/Lights/lightingVolume.js.map +1 -0
- package/Materials/Node/nodeMaterial.js +8 -2
- package/Materials/Node/nodeMaterial.js.map +1 -1
- package/Materials/floatingOriginMatrixOverrides.js +6 -5
- package/Materials/floatingOriginMatrixOverrides.js.map +1 -1
- package/Meshes/mesh.js +1 -1
- package/Meshes/mesh.js.map +1 -1
- package/Misc/screenshotTools.js +2 -8
- package/Misc/screenshotTools.js.map +1 -1
- package/Particles/Node/Blocks/index.d.ts +1 -0
- package/Particles/Node/Blocks/index.js +1 -0
- package/Particles/Node/Blocks/index.js.map +1 -1
- package/Particles/Node/Blocks/particleFloatToIntBlock.d.ts +46 -0
- package/Particles/Node/Blocks/particleFloatToIntBlock.js +120 -0
- package/Particles/Node/Blocks/particleFloatToIntBlock.js.map +1 -0
- package/Particles/Node/Blocks/systemBlock.d.ts +4 -4
- package/Particles/Node/Blocks/systemBlock.js +22 -16
- package/Particles/Node/Blocks/systemBlock.js.map +1 -1
- package/Particles/Node/nodeParticleBuildState.js +1 -1
- package/Particles/Node/nodeParticleBuildState.js.map +1 -1
- package/Particles/Node/nodeParticleSystemSet.helper.js +61 -30
- package/Particles/Node/nodeParticleSystemSet.helper.js.map +1 -1
- package/Particles/solidParticle.d.ts +9 -0
- package/Particles/solidParticle.js +11 -0
- package/Particles/solidParticle.js.map +1 -1
- package/Particles/solidParticleSystem.d.ts +28 -0
- package/Particles/solidParticleSystem.js +75 -0
- package/Particles/solidParticleSystem.js.map +1 -1
- package/Particles/thinParticleSystem.d.ts +6 -0
- package/Particles/thinParticleSystem.js +21 -12
- package/Particles/thinParticleSystem.js.map +1 -1
- package/ShadersWGSL/lightingVolume.compute.d.ts +5 -0
- package/ShadersWGSL/lightingVolume.compute.js +27 -0
- package/ShadersWGSL/lightingVolume.compute.js.map +1 -0
- package/package.json +1 -1
- package/scene.js +6 -4
- package/scene.js.map +1 -1
|
@@ -863,7 +863,8 @@ export declare class WebGPUEngine extends ThinWebGPUEngine {
|
|
|
863
863
|
flushFramebuffer(): void;
|
|
864
864
|
/** @internal */
|
|
865
865
|
_currentFrameBufferIsDefaultFrameBuffer(): boolean;
|
|
866
|
-
|
|
866
|
+
/** @internal */
|
|
867
|
+
_startRenderTargetRenderPass(renderTargetWrapper: RenderTargetWrapper, setClearStates: boolean, clearColor: Nullable<IColor4Like>, clearDepth: boolean, clearStencil: boolean): void;
|
|
867
868
|
private _startMainRenderPass;
|
|
868
869
|
/**
|
|
869
870
|
* Binds the frame buffer to the specified texture.
|
|
@@ -883,17 +884,19 @@ export declare class WebGPUEngine extends ThinWebGPUEngine {
|
|
|
883
884
|
* @param onBeforeUnbind defines a function which will be called before the effective unbind
|
|
884
885
|
*/
|
|
885
886
|
unBindFramebuffer(texture: RenderTargetWrapper, disableGenerateMipMaps?: boolean, onBeforeUnbind?: () => void): void;
|
|
887
|
+
private _resolveAndGenerateMipMapsFramebuffer;
|
|
886
888
|
/**
|
|
887
889
|
* Generates mipmaps for the texture of the (single) render target
|
|
888
890
|
* @param texture The render target containing the texture to generate the mipmaps for
|
|
889
891
|
*/
|
|
890
892
|
generateMipMapsFramebuffer(texture: RenderTargetWrapper): void;
|
|
891
893
|
/**
|
|
892
|
-
* Resolves the MSAA texture of the
|
|
894
|
+
* Resolves the MSAA texture of the render target into its non-MSAA version.
|
|
893
895
|
* Note that if "texture" is not a MSAA render target, no resolve is performed.
|
|
894
|
-
* @param
|
|
896
|
+
* @param texture The render target texture containing the MSAA texture to resolve
|
|
897
|
+
* @param resolveColors If true, resolve the color textures (default: true) - still subject to texture.resolveMSAAColors
|
|
895
898
|
*/
|
|
896
|
-
resolveFramebuffer(
|
|
899
|
+
resolveFramebuffer(texture: RenderTargetWrapper, resolveColors?: boolean): void;
|
|
897
900
|
/**
|
|
898
901
|
* Unbind the current render target and bind the default framebuffer
|
|
899
902
|
*/
|
package/Engines/webgpuEngine.js
CHANGED
|
@@ -2374,6 +2374,7 @@ export class WebGPUEngine extends ThinWebGPUEngine {
|
|
|
2374
2374
|
//------------------------------------------------------------------------------
|
|
2375
2375
|
// Render Pass
|
|
2376
2376
|
//------------------------------------------------------------------------------
|
|
2377
|
+
/** @internal */
|
|
2377
2378
|
_startRenderTargetRenderPass(renderTargetWrapper, setClearStates, clearColor, clearDepth, clearStencil) {
|
|
2378
2379
|
this._endCurrentRenderPass();
|
|
2379
2380
|
const rtWrapper = renderTargetWrapper;
|
|
@@ -2381,9 +2382,11 @@ export class WebGPUEngine extends ThinWebGPUEngine {
|
|
|
2381
2382
|
const gpuDepthStencilWrapper = depthStencilTexture?._hardwareTexture;
|
|
2382
2383
|
const gpuDepthStencilTexture = gpuDepthStencilWrapper?.underlyingResource;
|
|
2383
2384
|
const gpuDepthStencilMSAATexture = gpuDepthStencilWrapper?.getMSAATexture(0);
|
|
2384
|
-
const depthTextureView = gpuDepthStencilTexture?.createView(this._rttRenderPassWrapper.depthAttachmentViewDescriptor);
|
|
2385
2385
|
const depthMSAATextureView = gpuDepthStencilMSAATexture?.createView(this._rttRenderPassWrapper.depthAttachmentViewDescriptor);
|
|
2386
|
-
const
|
|
2386
|
+
const depthTextureView = depthMSAATextureView ? undefined : gpuDepthStencilTexture?.createView(this._rttRenderPassWrapper.depthAttachmentViewDescriptor);
|
|
2387
|
+
// We use the MSAA texture format (if available) to determine if it has a stencil aspect or not because, for MSAA depth textures,
|
|
2388
|
+
// the format of the "resolve" texture (gpuDepthStencilWrapper.format) is a single red channel format, not a depth-stencil format.
|
|
2389
|
+
const depthTextureHasStencil = gpuDepthStencilWrapper ? WebGPUTextureHelper.HasStencilAspect(gpuDepthStencilMSAATexture?.format ?? gpuDepthStencilWrapper.format) : false;
|
|
2387
2390
|
const colorAttachments = [];
|
|
2388
2391
|
if (this.useReverseDepthBuffer) {
|
|
2389
2392
|
this.setDepthFunctionToGreaterOrEqual();
|
|
@@ -2428,7 +2431,7 @@ export class WebGPUEngine extends ThinWebGPUEngine {
|
|
|
2428
2431
|
const colorMSAATextureView = gpuMSAATexture?.createView(msaaViewDescriptor);
|
|
2429
2432
|
colorAttachments.push({
|
|
2430
2433
|
view: colorMSAATextureView ? colorMSAATextureView : colorTextureView,
|
|
2431
|
-
resolveTarget: gpuMSAATexture ? colorTextureView : undefined,
|
|
2434
|
+
resolveTarget: gpuMSAATexture && !rtWrapper.disableAutomaticMSAAResolve ? colorTextureView : undefined,
|
|
2432
2435
|
depthSlice: mrtTexture.is3D ? (rtWrapper.layerIndices?.[i] ?? 0) : undefined,
|
|
2433
2436
|
clearValue: index !== 0 && mustClearColor ? (isRtInteger ? clearColorForIntegerRt : clearColor) : undefined,
|
|
2434
2437
|
loadOp: index !== 0 && mustClearColor ? "clear" /* WebGPUConstants.LoadOp.Clear */ : "load" /* WebGPUConstants.LoadOp.Load */,
|
|
@@ -2456,7 +2459,7 @@ export class WebGPUEngine extends ThinWebGPUEngine {
|
|
|
2456
2459
|
const isRtInteger = internalTexture.type === 7 || internalTexture.type === 5;
|
|
2457
2460
|
colorAttachments.push({
|
|
2458
2461
|
view: colorMSAATextureView ? colorMSAATextureView : colorTextureView,
|
|
2459
|
-
resolveTarget: gpuMSAATexture ? colorTextureView : undefined,
|
|
2462
|
+
resolveTarget: gpuMSAATexture && !rtWrapper.disableAutomaticMSAAResolve ? colorTextureView : undefined,
|
|
2460
2463
|
depthSlice,
|
|
2461
2464
|
clearValue: mustClearColor ? (isRtInteger ? clearColorForIntegerRt : clearColor) : undefined,
|
|
2462
2465
|
loadOp: mustClearColor ? "clear" /* WebGPUConstants.LoadOp.Clear */ : "load" /* WebGPUConstants.LoadOp.Load */,
|
|
@@ -2607,6 +2610,7 @@ export class WebGPUEngine extends ThinWebGPUEngine {
|
|
|
2607
2610
|
this._setDepthTextureFormat(this._rttRenderPassWrapper);
|
|
2608
2611
|
this._setColorFormat(this._rttRenderPassWrapper);
|
|
2609
2612
|
this._rttRenderPassWrapper.colorAttachmentViewDescriptor = {
|
|
2613
|
+
label: texture.label ? texture.label + " - Color Attachment View" : "RTT - Color Attachment View",
|
|
2610
2614
|
format: this._colorFormat,
|
|
2611
2615
|
dimension: texture.is3D ? "3d" /* WebGPUConstants.TextureViewDimension.E3d */ : "2d" /* WebGPUConstants.TextureViewDimension.E2d */,
|
|
2612
2616
|
mipLevelCount: 1,
|
|
@@ -2616,6 +2620,7 @@ export class WebGPUEngine extends ThinWebGPUEngine {
|
|
|
2616
2620
|
aspect: "all" /* WebGPUConstants.TextureAspect.All */,
|
|
2617
2621
|
};
|
|
2618
2622
|
this._rttRenderPassWrapper.depthAttachmentViewDescriptor = {
|
|
2623
|
+
label: texture.label ? texture.label + " - Depth Attachment View" : "RTT - Depth Attachment View",
|
|
2619
2624
|
format: this._depthTextureFormat,
|
|
2620
2625
|
dimension: depthStencilTexture && depthStencilTexture.is3D ? "3d" /* WebGPUConstants.TextureViewDimension.E3d */ : "2d" /* WebGPUConstants.TextureViewDimension.E2d */,
|
|
2621
2626
|
mipLevelCount: 1,
|
|
@@ -2689,14 +2694,7 @@ export class WebGPUEngine extends ThinWebGPUEngine {
|
|
|
2689
2694
|
}
|
|
2690
2695
|
this._currentRenderTarget = saveCrt;
|
|
2691
2696
|
this._endCurrentRenderPass();
|
|
2692
|
-
|
|
2693
|
-
if (texture.isMulti) {
|
|
2694
|
-
this.generateMipMapsMultiFramebuffer(texture);
|
|
2695
|
-
}
|
|
2696
|
-
else {
|
|
2697
|
-
this.generateMipMapsFramebuffer(texture);
|
|
2698
|
-
}
|
|
2699
|
-
}
|
|
2697
|
+
this._resolveAndGenerateMipMapsFramebuffer(texture, disableGenerateMipMaps);
|
|
2700
2698
|
this._currentRenderTarget = null;
|
|
2701
2699
|
if (this.dbgVerboseLogsForFirstFrames) {
|
|
2702
2700
|
if (this._count === undefined) {
|
|
@@ -2710,6 +2708,21 @@ export class WebGPUEngine extends ThinWebGPUEngine {
|
|
|
2710
2708
|
this._cacheRenderPipeline.setMRT([]);
|
|
2711
2709
|
this._cacheRenderPipeline.setMRTAttachments(this._mrtAttachments);
|
|
2712
2710
|
}
|
|
2711
|
+
_resolveAndGenerateMipMapsFramebuffer(texture, disableGenerateMipMaps = false) {
|
|
2712
|
+
const webglRtWrapper = texture;
|
|
2713
|
+
if (!webglRtWrapper.disableAutomaticMSAAResolve) {
|
|
2714
|
+
// we pass false as the second parameter because the color resolve has already been done automatically when the render pass ended
|
|
2715
|
+
this.resolveFramebuffer(texture, false);
|
|
2716
|
+
}
|
|
2717
|
+
if (!disableGenerateMipMaps) {
|
|
2718
|
+
if (texture.isMulti) {
|
|
2719
|
+
this.generateMipMapsMultiFramebuffer(texture);
|
|
2720
|
+
}
|
|
2721
|
+
else {
|
|
2722
|
+
this.generateMipMapsFramebuffer(texture);
|
|
2723
|
+
}
|
|
2724
|
+
}
|
|
2725
|
+
}
|
|
2713
2726
|
/**
|
|
2714
2727
|
* Generates mipmaps for the texture of the (single) render target
|
|
2715
2728
|
* @param texture The render target containing the texture to generate the mipmaps for
|
|
@@ -2720,12 +2733,28 @@ export class WebGPUEngine extends ThinWebGPUEngine {
|
|
|
2720
2733
|
}
|
|
2721
2734
|
}
|
|
2722
2735
|
/**
|
|
2723
|
-
* Resolves the MSAA texture of the
|
|
2736
|
+
* Resolves the MSAA texture of the render target into its non-MSAA version.
|
|
2724
2737
|
* Note that if "texture" is not a MSAA render target, no resolve is performed.
|
|
2725
|
-
* @param
|
|
2738
|
+
* @param texture The render target texture containing the MSAA texture to resolve
|
|
2739
|
+
* @param resolveColors If true, resolve the color textures (default: true) - still subject to texture.resolveMSAAColors
|
|
2726
2740
|
*/
|
|
2727
|
-
resolveFramebuffer(
|
|
2728
|
-
|
|
2741
|
+
resolveFramebuffer(texture, resolveColors = true) {
|
|
2742
|
+
if (texture.samples <= 1) {
|
|
2743
|
+
return;
|
|
2744
|
+
}
|
|
2745
|
+
if (texture.resolveMSAAColors && resolveColors) {
|
|
2746
|
+
const disableAutomaticMSAAResolve = texture.disableAutomaticMSAAResolve;
|
|
2747
|
+
texture.disableAutomaticMSAAResolve = false;
|
|
2748
|
+
// Simply bind and unbind the framebuffer to trigger the resolve
|
|
2749
|
+
this.bindFramebuffer(texture);
|
|
2750
|
+
this._startRenderTargetRenderPass(this._currentRenderTarget, false, null, false, false);
|
|
2751
|
+
this.unBindFramebuffer(texture);
|
|
2752
|
+
texture.disableAutomaticMSAAResolve = disableAutomaticMSAAResolve;
|
|
2753
|
+
}
|
|
2754
|
+
if (texture.resolveMSAADepth && texture._depthStencilTexture) {
|
|
2755
|
+
const gpuTextureWrapper = texture._depthStencilTexture._hardwareTexture;
|
|
2756
|
+
this._textureHelper.resolveMSAADepthTexture(gpuTextureWrapper.getMSAATexture(0), gpuTextureWrapper.underlyingResource, this._renderEncoder);
|
|
2757
|
+
}
|
|
2729
2758
|
}
|
|
2730
2759
|
/**
|
|
2731
2760
|
* Unbind the current render target and bind the default framebuffer
|