Skip to content

Commit

Permalink
TAARenderPass: Fix color shift. (#26199)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mugen87 committed Jun 7, 2023
1 parent 9a6376a commit 84d625d
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions examples/jsm/postprocessing/TAARenderPass.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ class TAARenderPass extends SSAARenderPass {
const oldClearAlpha = renderer.getClearAlpha();

const sampleWeight = 1.0 / ( jitterOffsets.length );
const accumulationWeight = this.accumulateIndex * sampleWeight;

if ( this.accumulateIndex >= 0 && this.accumulateIndex < jitterOffsets.length ) {

Expand Down Expand Up @@ -117,6 +116,7 @@ class TAARenderPass extends SSAARenderPass {
}

renderer.setClearColor( this.clearColor, this.clearAlpha );
const accumulationWeight = this.accumulateIndex * sampleWeight;

if ( accumulationWeight > 0 ) {

Expand All @@ -133,7 +133,6 @@ class TAARenderPass extends SSAARenderPass {
this.copyUniforms[ 'opacity' ].value = 1.0 - accumulationWeight;
this.copyUniforms[ 'tDiffuse' ].value = this.holdRenderTarget.texture;
renderer.setRenderTarget( writeBuffer );
if ( accumulationWeight === 0 ) renderer.clear();
this.fsQuad.render( renderer );

}
Expand Down

0 comments on commit 84d625d

Please sign in to comment.