Skip to content

Commit

Permalink
fix: avoid warnings with Three 165+ with screen-space-reflections.js (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
davcri authored Dec 26, 2024
1 parent c115639 commit f9b4dae
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/effects/SSR/screen-space-reflections.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
}

Expand Down

0 comments on commit f9b4dae

Please sign in to comment.