@babylonjs/core 8.38.0 → 8.39.1
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 +2 -1
- package/Animations/animation.js +3 -2
- package/Animations/animation.js.map +1 -1
- package/Audio/Interfaces/ISoundOptions.d.ts +1 -1
- package/Audio/Interfaces/ISoundOptions.js.map +1 -1
- package/Audio/audioEngine.d.ts +3 -4
- package/Audio/audioEngine.js +9 -6
- package/Audio/audioEngine.js.map +1 -1
- package/Audio/sound.d.ts +33 -54
- package/Audio/sound.js +450 -718
- package/Audio/sound.js.map +1 -1
- package/AudioV2/abstractAudio/abstractAudioOutNode.d.ts +1 -1
- package/AudioV2/abstractAudio/abstractAudioOutNode.js +1 -1
- package/AudioV2/abstractAudio/abstractAudioOutNode.js.map +1 -1
- package/AudioV2/abstractAudio/abstractSound.d.ts +1 -1
- package/AudioV2/abstractAudio/abstractSound.js +2 -2
- package/AudioV2/abstractAudio/abstractSound.js.map +1 -1
- package/AudioV2/abstractAudio/abstractSoundSource.d.ts +11 -3
- package/AudioV2/abstractAudio/abstractSoundSource.js +37 -1
- package/AudioV2/abstractAudio/abstractSoundSource.js.map +1 -1
- package/AudioV2/abstractAudio/audioBus.d.ts +8 -3
- package/AudioV2/abstractAudio/audioBus.js +24 -1
- package/AudioV2/abstractAudio/audioBus.js.map +1 -1
- package/AudioV2/abstractAudio/staticSound.d.ts +1 -1
- package/AudioV2/abstractAudio/staticSound.js +2 -2
- package/AudioV2/abstractAudio/staticSound.js.map +1 -1
- package/AudioV2/abstractAudio/streamingSound.d.ts +1 -1
- package/AudioV2/abstractAudio/streamingSound.js +2 -2
- package/AudioV2/abstractAudio/streamingSound.js.map +1 -1
- package/AudioV2/abstractAudio/subNodes/abstractAudioSubGraph.d.ts +1 -1
- package/AudioV2/abstractAudio/subNodes/abstractAudioSubGraph.js +3 -0
- package/AudioV2/abstractAudio/subNodes/abstractAudioSubGraph.js.map +1 -1
- package/AudioV2/abstractAudio/subNodes/spatialAudioSubNode.d.ts +1 -0
- package/AudioV2/abstractAudio/subNodes/spatialAudioSubNode.js +1 -0
- package/AudioV2/abstractAudio/subNodes/spatialAudioSubNode.js.map +1 -1
- package/AudioV2/abstractAudio/subProperties/abstractSpatialAudio.d.ts +12 -2
- package/AudioV2/abstractAudio/subProperties/abstractSpatialAudio.js +2 -0
- package/AudioV2/abstractAudio/subProperties/abstractSpatialAudio.js.map +1 -1
- package/AudioV2/abstractAudio/subProperties/spatialAudio.d.ts +6 -0
- package/AudioV2/abstractAudio/subProperties/spatialAudio.js +25 -0
- package/AudioV2/abstractAudio/subProperties/spatialAudio.js.map +1 -1
- package/AudioV2/webAudio/components/webAudioParameterComponent.js +2 -2
- package/AudioV2/webAudio/components/webAudioParameterComponent.js.map +1 -1
- package/AudioV2/webAudio/subNodes/spatialWebAudioSubNode.d.ts +3 -0
- package/AudioV2/webAudio/subNodes/spatialWebAudioSubNode.js +14 -17
- package/AudioV2/webAudio/subNodes/spatialWebAudioSubNode.js.map +1 -1
- package/AudioV2/webAudio/subNodes/webAudioBusAndSoundSubGraph.js +1 -0
- package/AudioV2/webAudio/subNodes/webAudioBusAndSoundSubGraph.js.map +1 -1
- package/AudioV2/webAudio/subProperties/spatialWebAudio.js +1 -0
- package/AudioV2/webAudio/subProperties/spatialWebAudio.js.map +1 -1
- package/AudioV2/webAudio/webAudioBus.d.ts +2 -7
- package/AudioV2/webAudio/webAudioBus.js +4 -24
- package/AudioV2/webAudio/webAudioBus.js.map +1 -1
- package/AudioV2/webAudio/webAudioEngine.js +1 -0
- package/AudioV2/webAudio/webAudioEngine.js.map +1 -1
- package/AudioV2/webAudio/webAudioSoundSource.d.ts +2 -7
- package/AudioV2/webAudio/webAudioSoundSource.js +3 -24
- package/AudioV2/webAudio/webAudioSoundSource.js.map +1 -1
- package/AudioV2/webAudio/webAudioStaticSound.d.ts +3 -7
- package/AudioV2/webAudio/webAudioStaticSound.js +13 -26
- package/AudioV2/webAudio/webAudioStaticSound.js.map +1 -1
- package/AudioV2/webAudio/webAudioStreamingSound.d.ts +3 -7
- package/AudioV2/webAudio/webAudioStreamingSound.js +6 -23
- package/AudioV2/webAudio/webAudioStreamingSound.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 +11 -3
- 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/geospatialCamera.d.ts +13 -5
- package/Cameras/geospatialCamera.js +116 -48
- package/Cameras/geospatialCamera.js.map +1 -1
- package/Cameras/geospatialCameraMovement.d.ts +6 -2
- package/Cameras/geospatialCameraMovement.js +11 -11
- 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.d.ts +2 -2
- 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 +53 -25
- package/Engines/webgpuEngine.js.map +1 -1
- package/FrameGraph/Node/Blocks/PostProcesses/volumetricLightingBlock.d.ts +74 -0
- package/FrameGraph/Node/Blocks/PostProcesses/volumetricLightingBlock.js +179 -0
- package/FrameGraph/Node/Blocks/PostProcesses/volumetricLightingBlock.js.map +1 -0
- package/FrameGraph/Node/Blocks/index.d.ts +2 -0
- package/FrameGraph/Node/Blocks/index.js +2 -0
- package/FrameGraph/Node/Blocks/index.js.map +1 -1
- package/FrameGraph/Node/Blocks/lightingVolumeBlock.d.ts +46 -0
- package/FrameGraph/Node/Blocks/lightingVolumeBlock.js +106 -0
- package/FrameGraph/Node/Blocks/lightingVolumeBlock.js.map +1 -0
- 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/Tasks/Misc/lightingVolumeTask.d.ts +31 -0
- package/FrameGraph/Tasks/Misc/lightingVolumeTask.js +56 -0
- package/FrameGraph/Tasks/Misc/lightingVolumeTask.js.map +1 -0
- package/FrameGraph/Tasks/PostProcesses/postProcessTask.d.ts +2 -2
- package/FrameGraph/Tasks/PostProcesses/postProcessTask.js.map +1 -1
- package/FrameGraph/Tasks/PostProcesses/volumetricLightingBlendVolumeTask.d.ts +30 -0
- package/FrameGraph/Tasks/PostProcesses/volumetricLightingBlendVolumeTask.js +57 -0
- package/FrameGraph/Tasks/PostProcesses/volumetricLightingBlendVolumeTask.js.map +1 -0
- package/FrameGraph/Tasks/PostProcesses/volumetricLightingTask.d.ts +91 -0
- package/FrameGraph/Tasks/PostProcesses/volumetricLightingTask.js +210 -0
- package/FrameGraph/Tasks/PostProcesses/volumetricLightingTask.js.map +1 -0
- package/FrameGraph/Tasks/Rendering/objectRendererTask.js +1 -1
- package/FrameGraph/Tasks/Rendering/objectRendererTask.js.map +1 -1
- package/FrameGraph/Tasks/Texture/clearTextureTask.js +1 -1
- package/FrameGraph/Tasks/Texture/clearTextureTask.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/frameGraphRenderContext.d.ts +2 -2
- package/FrameGraph/frameGraphRenderContext.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 +17 -2
- package/FrameGraph/frameGraphTask.js.map +1 -1
- package/FrameGraph/frameGraphTypes.d.ts +2 -0
- package/FrameGraph/frameGraphTypes.js.map +1 -1
- package/FrameGraph/index.d.ts +2 -0
- package/FrameGraph/index.js +2 -0
- package/FrameGraph/index.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 +435 -0
- package/Lights/lightingVolume.js.map +1 -0
- package/Materials/GaussianSplatting/gaussianSplattingMaterial.d.ts +7 -0
- package/Materials/GaussianSplatting/gaussianSplattingMaterial.js +19 -5
- package/Materials/GaussianSplatting/gaussianSplattingMaterial.js.map +1 -1
- 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/Materials/uniformBuffer.d.ts +1 -0
- package/Materials/uniformBuffer.js +8 -1
- package/Materials/uniformBuffer.js.map +1 -1
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.d.ts +5 -2
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.js +138 -45
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.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/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/Physics/v2/characterController.d.ts +42 -2
- package/Physics/v2/characterController.js +140 -46
- package/Physics/v2/characterController.js.map +1 -1
- package/Shaders/volumetricLightingBlendVolume.fragment.d.ts +5 -0
- package/Shaders/volumetricLightingBlendVolume.fragment.js +21 -0
- package/Shaders/volumetricLightingBlendVolume.fragment.js.map +1 -0
- package/Shaders/volumetricLightingRenderVolume.fragment.d.ts +7 -0
- package/Shaders/volumetricLightingRenderVolume.fragment.js +25 -0
- package/Shaders/volumetricLightingRenderVolume.fragment.js.map +1 -0
- package/Shaders/volumetricLightingRenderVolume.vertex.d.ts +9 -0
- package/Shaders/volumetricLightingRenderVolume.vertex.js +18 -0
- package/Shaders/volumetricLightingRenderVolume.vertex.js.map +1 -0
- package/ShadersWGSL/gaussianSplattingDepth.fragment.d.ts +0 -1
- package/ShadersWGSL/gaussianSplattingDepth.fragment.js +0 -2
- package/ShadersWGSL/gaussianSplattingDepth.fragment.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/ShadersWGSL/volumetricLightingBlendVolume.fragment.d.ts +5 -0
- package/ShadersWGSL/volumetricLightingBlendVolume.fragment.js +22 -0
- package/ShadersWGSL/volumetricLightingBlendVolume.fragment.js.map +1 -0
- package/ShadersWGSL/volumetricLightingRenderVolume.fragment.d.ts +7 -0
- package/ShadersWGSL/volumetricLightingRenderVolume.fragment.js +27 -0
- package/ShadersWGSL/volumetricLightingRenderVolume.fragment.js.map +1 -0
- package/ShadersWGSL/volumetricLightingRenderVolume.vertex.d.ts +7 -0
- package/ShadersWGSL/volumetricLightingRenderVolume.vertex.js +17 -0
- package/ShadersWGSL/volumetricLightingRenderVolume.vertex.js.map +1 -0
- package/States/IStencilState.d.ts +48 -2
- package/States/IStencilState.js.map +1 -1
- 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,12 @@ 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;
|
|
2390
|
+
const depthTextureHasDepth = gpuDepthStencilWrapper ? WebGPUTextureHelper.HasDepthAspect(gpuDepthStencilMSAATexture?.format ?? gpuDepthStencilWrapper.format) : false;
|
|
2387
2391
|
const colorAttachments = [];
|
|
2388
2392
|
if (this.useReverseDepthBuffer) {
|
|
2389
2393
|
this.setDepthFunctionToGreaterOrEqual();
|
|
@@ -2428,7 +2432,7 @@ export class WebGPUEngine extends ThinWebGPUEngine {
|
|
|
2428
2432
|
const colorMSAATextureView = gpuMSAATexture?.createView(msaaViewDescriptor);
|
|
2429
2433
|
colorAttachments.push({
|
|
2430
2434
|
view: colorMSAATextureView ? colorMSAATextureView : colorTextureView,
|
|
2431
|
-
resolveTarget: gpuMSAATexture ? colorTextureView : undefined,
|
|
2435
|
+
resolveTarget: gpuMSAATexture && !rtWrapper.disableAutomaticMSAAResolve ? colorTextureView : undefined,
|
|
2432
2436
|
depthSlice: mrtTexture.is3D ? (rtWrapper.layerIndices?.[i] ?? 0) : undefined,
|
|
2433
2437
|
clearValue: index !== 0 && mustClearColor ? (isRtInteger ? clearColorForIntegerRt : clearColor) : undefined,
|
|
2434
2438
|
loadOp: index !== 0 && mustClearColor ? "clear" /* WebGPUConstants.LoadOp.Clear */ : "load" /* WebGPUConstants.LoadOp.Load */,
|
|
@@ -2456,7 +2460,7 @@ export class WebGPUEngine extends ThinWebGPUEngine {
|
|
|
2456
2460
|
const isRtInteger = internalTexture.type === 7 || internalTexture.type === 5;
|
|
2457
2461
|
colorAttachments.push({
|
|
2458
2462
|
view: colorMSAATextureView ? colorMSAATextureView : colorTextureView,
|
|
2459
|
-
resolveTarget: gpuMSAATexture ? colorTextureView : undefined,
|
|
2463
|
+
resolveTarget: gpuMSAATexture && !rtWrapper.disableAutomaticMSAAResolve ? colorTextureView : undefined,
|
|
2460
2464
|
depthSlice,
|
|
2461
2465
|
clearValue: mustClearColor ? (isRtInteger ? clearColorForIntegerRt : clearColor) : undefined,
|
|
2462
2466
|
loadOp: mustClearColor ? "clear" /* WebGPUConstants.LoadOp.Clear */ : "load" /* WebGPUConstants.LoadOp.Load */,
|
|
@@ -2475,18 +2479,16 @@ export class WebGPUEngine extends ThinWebGPUEngine {
|
|
|
2475
2479
|
? {
|
|
2476
2480
|
view: depthMSAATextureView ? depthMSAATextureView : depthTextureView,
|
|
2477
2481
|
depthClearValue: mustClearDepth ? (this.useReverseDepthBuffer ? this._clearReverseDepthValue : this._clearDepthValue) : undefined,
|
|
2478
|
-
depthLoadOp: rtWrapper.depthReadOnly ? undefined : mustClearDepth ? "clear" /* WebGPUConstants.LoadOp.Clear */ : "load" /* WebGPUConstants.LoadOp.Load */,
|
|
2479
|
-
depthStoreOp: rtWrapper.depthReadOnly ? undefined : "store" /* WebGPUConstants.StoreOp.Store */,
|
|
2482
|
+
depthLoadOp: rtWrapper.depthReadOnly || !depthTextureHasDepth ? undefined : mustClearDepth ? "clear" /* WebGPUConstants.LoadOp.Clear */ : "load" /* WebGPUConstants.LoadOp.Load */,
|
|
2483
|
+
depthStoreOp: rtWrapper.depthReadOnly || !depthTextureHasDepth ? undefined : "store" /* WebGPUConstants.StoreOp.Store */,
|
|
2480
2484
|
depthReadOnly: rtWrapper.depthReadOnly,
|
|
2481
2485
|
stencilClearValue: rtWrapper._depthStencilTextureWithStencil && mustClearStencil ? this._clearStencilValue : undefined,
|
|
2482
|
-
stencilLoadOp: rtWrapper.stencilReadOnly
|
|
2486
|
+
stencilLoadOp: rtWrapper.stencilReadOnly || !depthTextureHasStencil
|
|
2483
2487
|
? undefined
|
|
2484
|
-
:
|
|
2485
|
-
?
|
|
2486
|
-
:
|
|
2487
|
-
|
|
2488
|
-
: "load" /* WebGPUConstants.LoadOp.Load */,
|
|
2489
|
-
stencilStoreOp: rtWrapper.stencilReadOnly ? undefined : !depthTextureHasStencil ? undefined : "store" /* WebGPUConstants.StoreOp.Store */,
|
|
2488
|
+
: rtWrapper._depthStencilTextureWithStencil && mustClearStencil
|
|
2489
|
+
? "clear" /* WebGPUConstants.LoadOp.Clear */
|
|
2490
|
+
: "load" /* WebGPUConstants.LoadOp.Load */,
|
|
2491
|
+
stencilStoreOp: rtWrapper.stencilReadOnly || !depthTextureHasStencil ? undefined : "store" /* WebGPUConstants.StoreOp.Store */,
|
|
2490
2492
|
stencilReadOnly: rtWrapper.stencilReadOnly,
|
|
2491
2493
|
}
|
|
2492
2494
|
: undefined,
|
|
@@ -2607,6 +2609,7 @@ export class WebGPUEngine extends ThinWebGPUEngine {
|
|
|
2607
2609
|
this._setDepthTextureFormat(this._rttRenderPassWrapper);
|
|
2608
2610
|
this._setColorFormat(this._rttRenderPassWrapper);
|
|
2609
2611
|
this._rttRenderPassWrapper.colorAttachmentViewDescriptor = {
|
|
2612
|
+
label: texture.label ? texture.label + " - Color Attachment View" : "RTT - Color Attachment View",
|
|
2610
2613
|
format: this._colorFormat,
|
|
2611
2614
|
dimension: texture.is3D ? "3d" /* WebGPUConstants.TextureViewDimension.E3d */ : "2d" /* WebGPUConstants.TextureViewDimension.E2d */,
|
|
2612
2615
|
mipLevelCount: 1,
|
|
@@ -2616,6 +2619,7 @@ export class WebGPUEngine extends ThinWebGPUEngine {
|
|
|
2616
2619
|
aspect: "all" /* WebGPUConstants.TextureAspect.All */,
|
|
2617
2620
|
};
|
|
2618
2621
|
this._rttRenderPassWrapper.depthAttachmentViewDescriptor = {
|
|
2622
|
+
label: texture.label ? texture.label + " - Depth Attachment View" : "RTT - Depth Attachment View",
|
|
2619
2623
|
format: this._depthTextureFormat,
|
|
2620
2624
|
dimension: depthStencilTexture && depthStencilTexture.is3D ? "3d" /* WebGPUConstants.TextureViewDimension.E3d */ : "2d" /* WebGPUConstants.TextureViewDimension.E2d */,
|
|
2621
2625
|
mipLevelCount: 1,
|
|
@@ -2689,14 +2693,7 @@ export class WebGPUEngine extends ThinWebGPUEngine {
|
|
|
2689
2693
|
}
|
|
2690
2694
|
this._currentRenderTarget = saveCrt;
|
|
2691
2695
|
this._endCurrentRenderPass();
|
|
2692
|
-
|
|
2693
|
-
if (texture.isMulti) {
|
|
2694
|
-
this.generateMipMapsMultiFramebuffer(texture);
|
|
2695
|
-
}
|
|
2696
|
-
else {
|
|
2697
|
-
this.generateMipMapsFramebuffer(texture);
|
|
2698
|
-
}
|
|
2699
|
-
}
|
|
2696
|
+
this._resolveAndGenerateMipMapsFramebuffer(texture, disableGenerateMipMaps);
|
|
2700
2697
|
this._currentRenderTarget = null;
|
|
2701
2698
|
if (this.dbgVerboseLogsForFirstFrames) {
|
|
2702
2699
|
if (this._count === undefined) {
|
|
@@ -2710,6 +2707,21 @@ export class WebGPUEngine extends ThinWebGPUEngine {
|
|
|
2710
2707
|
this._cacheRenderPipeline.setMRT([]);
|
|
2711
2708
|
this._cacheRenderPipeline.setMRTAttachments(this._mrtAttachments);
|
|
2712
2709
|
}
|
|
2710
|
+
_resolveAndGenerateMipMapsFramebuffer(texture, disableGenerateMipMaps = false) {
|
|
2711
|
+
const webglRtWrapper = texture;
|
|
2712
|
+
if (!webglRtWrapper.disableAutomaticMSAAResolve) {
|
|
2713
|
+
// we pass false as the second parameter because the color resolve has already been done automatically when the render pass ended
|
|
2714
|
+
this.resolveFramebuffer(texture, false);
|
|
2715
|
+
}
|
|
2716
|
+
if (!disableGenerateMipMaps) {
|
|
2717
|
+
if (texture.isMulti) {
|
|
2718
|
+
this.generateMipMapsMultiFramebuffer(texture);
|
|
2719
|
+
}
|
|
2720
|
+
else {
|
|
2721
|
+
this.generateMipMapsFramebuffer(texture);
|
|
2722
|
+
}
|
|
2723
|
+
}
|
|
2724
|
+
}
|
|
2713
2725
|
/**
|
|
2714
2726
|
* Generates mipmaps for the texture of the (single) render target
|
|
2715
2727
|
* @param texture The render target containing the texture to generate the mipmaps for
|
|
@@ -2720,12 +2732,28 @@ export class WebGPUEngine extends ThinWebGPUEngine {
|
|
|
2720
2732
|
}
|
|
2721
2733
|
}
|
|
2722
2734
|
/**
|
|
2723
|
-
* Resolves the MSAA texture of the
|
|
2735
|
+
* Resolves the MSAA texture of the render target into its non-MSAA version.
|
|
2724
2736
|
* Note that if "texture" is not a MSAA render target, no resolve is performed.
|
|
2725
|
-
* @param
|
|
2737
|
+
* @param texture The render target texture containing the MSAA texture to resolve
|
|
2738
|
+
* @param resolveColors If true, resolve the color textures (default: true) - still subject to texture.resolveMSAAColors
|
|
2726
2739
|
*/
|
|
2727
|
-
resolveFramebuffer(
|
|
2728
|
-
|
|
2740
|
+
resolveFramebuffer(texture, resolveColors = true) {
|
|
2741
|
+
if (texture.samples <= 1) {
|
|
2742
|
+
return;
|
|
2743
|
+
}
|
|
2744
|
+
if (texture.resolveMSAAColors && resolveColors) {
|
|
2745
|
+
const disableAutomaticMSAAResolve = texture.disableAutomaticMSAAResolve;
|
|
2746
|
+
texture.disableAutomaticMSAAResolve = false;
|
|
2747
|
+
// Simply bind and unbind the framebuffer to trigger the resolve
|
|
2748
|
+
this.bindFramebuffer(texture);
|
|
2749
|
+
this._startRenderTargetRenderPass(this._currentRenderTarget, false, null, false, false);
|
|
2750
|
+
this.unBindFramebuffer(texture);
|
|
2751
|
+
texture.disableAutomaticMSAAResolve = disableAutomaticMSAAResolve;
|
|
2752
|
+
}
|
|
2753
|
+
if (texture.resolveMSAADepth && texture._depthStencilTexture) {
|
|
2754
|
+
const gpuTextureWrapper = texture._depthStencilTexture._hardwareTexture;
|
|
2755
|
+
this._textureHelper.resolveMSAADepthTexture(gpuTextureWrapper.getMSAATexture(0), gpuTextureWrapper.underlyingResource, this._renderEncoder);
|
|
2756
|
+
}
|
|
2729
2757
|
}
|
|
2730
2758
|
/**
|
|
2731
2759
|
* Unbind the current render target and bind the default framebuffer
|