From f9b4dae863a76e68ee3b95221d17859e205f0167 Mon Sep 17 00:00:00 2001 From: Davide Cristini Date: Thu, 26 Dec 2024 09:44:46 +0100 Subject: [PATCH] fix: avoid warnings with Three 165+ with screen-space-reflections.js (#289) --- src/effects/SSR/screen-space-reflections.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/effects/SSR/screen-space-reflections.js b/src/effects/SSR/screen-space-reflections.js index 197798e..f1e06d5 100644 --- a/src/effects/SSR/screen-space-reflections.js +++ b/src/effects/SSR/screen-space-reflections.js @@ -1466,9 +1466,15 @@ class TemporalResolvePass extends Pass { renderer.setRenderTarget(this.renderTarget) renderer.render(this.scene, this.camera) // save the render target's texture for use in next frame - renderer.copyFramebufferToTexture(zeroVec2, this.accumulatedTexture) - renderer.setRenderTarget(this.velocityPass.renderTarget) - renderer.copyFramebufferToTexture(zeroVec2, this.lastVelocityTexture) + if (Number(REVISION) >= 165) { + renderer.copyFramebufferToTexture(this.accumulatedTexture, zeroVec2) + renderer.setRenderTarget(this.velocityPass.renderTarget) + renderer.copyFramebufferToTexture(this.lastVelocityTexture, zeroVec2) + } else { + renderer.copyFramebufferToTexture(zeroVec2, this.accumulatedTexture) + renderer.setRenderTarget(this.velocityPass.renderTarget) + renderer.copyFramebufferToTexture(zeroVec2, this.accumulatedTexture) + } } }