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
`copyFramebufferToTexture()` changed its signature in r165 mrdoob/three.js#28329
  • Loading branch information
davcri authored Jul 17, 2024
1 parent 29fda1b commit dd36aa4
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 dd36aa4

Please sign in to comment.