Skip to content

Commit e0df8d1

Browse files
committed
Add clearDepth attribute to RenderPass
1 parent 0bb05fd commit e0df8d1

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

examples/js/postprocessing/RenderPass.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ THREE.RenderPass = function ( scene, camera, overrideMaterial, clearColor, clear
1515
this.clearAlpha = ( clearAlpha !== undefined ) ? clearAlpha : 0;
1616

1717
this.clear = true;
18+
this.clearDepth = false;
1819
this.needsSwap = false;
1920

2021
};
@@ -41,6 +42,12 @@ THREE.RenderPass.prototype = Object.assign( Object.create( THREE.Pass.prototype
4142

4243
}
4344

45+
if ( this.clearDepth ) {
46+
47+
renderer.clearDepth();
48+
49+
}
50+
4451
renderer.render( this.scene, this.camera, this.renderToScreen ? null : readBuffer, this.clear );
4552

4653
if ( this.clearColor ) {

0 commit comments

Comments
 (0)