|
@@ -65,7 +65,11 @@ class TAARenderPass extends SSAARenderPass {
|
|
|
const autoClear = renderer.autoClear;
|
|
|
renderer.autoClear = false;
|
|
|
|
|
|
+ renderer.getClearColor( this._oldClearColor );
|
|
|
+ const oldClearAlpha = renderer.getClearAlpha();
|
|
|
+
|
|
|
const sampleWeight = 1.0 / ( jitterOffsets.length );
|
|
|
+ const accumulationWeight = this.accumulateIndex * sampleWeight;
|
|
|
|
|
|
if ( this.accumulateIndex >= 0 && this.accumulateIndex < jitterOffsets.length ) {
|
|
|
|
|
@@ -88,11 +92,18 @@ class TAARenderPass extends SSAARenderPass {
|
|
|
}
|
|
|
|
|
|
renderer.setRenderTarget( writeBuffer );
|
|
|
+ renderer.setClearColor( this.clearColor, this.clearAlpha );
|
|
|
renderer.clear();
|
|
|
renderer.render( this.scene, this.camera );
|
|
|
|
|
|
renderer.setRenderTarget( this.sampleRenderTarget );
|
|
|
- if ( this.accumulateIndex === 0 ) renderer.clear();
|
|
|
+ if ( this.accumulateIndex === 0 ) {
|
|
|
+
|
|
|
+ renderer.setClearColor( 0x000000, 0.0 );
|
|
|
+ renderer.clear();
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
this.fsQuad.render( renderer );
|
|
|
|
|
|
this.accumulateIndex ++;
|
|
@@ -105,7 +116,7 @@ class TAARenderPass extends SSAARenderPass {
|
|
|
|
|
|
}
|
|
|
|
|
|
- const accumulationWeight = this.accumulateIndex * sampleWeight;
|
|
|
+ renderer.setClearColor( this.clearColor, this.clearAlpha );
|
|
|
|
|
|
if ( accumulationWeight > 0 ) {
|
|
|
|
|
@@ -128,6 +139,7 @@ class TAARenderPass extends SSAARenderPass {
|
|
|
}
|
|
|
|
|
|
renderer.autoClear = autoClear;
|
|
|
+ renderer.setClearColor( this._oldClearColor, oldClearAlpha );
|
|
|
|
|
|
}
|
|
|
|