From 279af9ce290fff64f8871aafcaeaddbfd76188cb Mon Sep 17 00:00:00 2001 From: jk20012001 Date: Mon, 16 May 2022 14:44:16 +0800 Subject: [PATCH] fix deferred pipeline webgl2.0 depth stencil with linear sampling (#11110) --- cocos/core/pipeline/deferred/deferred-pipeline.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cocos/core/pipeline/deferred/deferred-pipeline.ts b/cocos/core/pipeline/deferred/deferred-pipeline.ts index 7b4753f735..703d597291 100644 --- a/cocos/core/pipeline/deferred/deferred-pipeline.ts +++ b/cocos/core/pipeline/deferred/deferred-pipeline.ts @@ -306,12 +306,14 @@ export class DeferredPipeline extends RenderPipeline { data.outputRenderTargets, null, )); + + data.sampler = this.globalDSManager.pointSampler; + // Listens when the attachment texture is scaled this.on(PipelineEventType.ATTACHMENT_SCALE_CAHNGED, (val: number) => { data.sampler = val < 1 ? this.globalDSManager.pointSampler : this.globalDSManager.linearSampler; this.applyFramebufferRatio(data.gbufferFrameBuffer); this.applyFramebufferRatio(data.outputFrameBuffer); }); - data.sampler = this.globalDSManager.linearSampler; } }