|
@@ -89,19 +89,21 @@ THREE.MSAAPass.prototype = {
|
|
|
// only jitters perspective cameras. TODO: add support for jittering orthogonal cameras
|
|
|
if( camera.setViewOffset ) camera.setViewOffset( readBuffer.width, readBuffer.height, jitterOffsets[i].x, jitterOffsets[i].y, readBuffer.width, readBuffer.height );
|
|
|
|
|
|
+ // on first sample, no need to accumulate
|
|
|
if( i == 0 ) {
|
|
|
|
|
|
renderer.render( this.scene, camera, writeBuffer, true );
|
|
|
|
|
|
}
|
|
|
else {
|
|
|
+
|
|
|
renderer.render( this.scene, camera, this.sampleRenderTarget, true );
|
|
|
|
|
|
// this accumulation strategy is used to prevent decimation at low bit depths with lots of samples.
|
|
|
this.uniforms[ "scale" ].value = 1.0 / ( i + 1 );
|
|
|
|
|
|
- // clear on the first render, accumulate the others
|
|
|
renderer.render( this.scene2, this.camera2, writeBuffer, false );
|
|
|
+
|
|
|
}
|
|
|
|
|
|
}
|