Przeglądaj źródła

Merge pull request #10159 from handwritingio/renderpass-cleardepth

Add clearDepth attribute to RenderPass
Mr.doob 8 lat temu
rodzic
commit
3695450d19
1 zmienionych plików z 7 dodań i 0 usunięć
  1. 7 0
      examples/js/postprocessing/RenderPass.js

+ 7 - 0
examples/js/postprocessing/RenderPass.js

@@ -15,6 +15,7 @@ THREE.RenderPass = function ( scene, camera, overrideMaterial, clearColor, clear
 	this.clearAlpha = ( clearAlpha !== undefined ) ? clearAlpha : 0;
 
 	this.clear = true;
+	this.clearDepth = false;
 	this.needsSwap = false;
 
 };
@@ -41,6 +42,12 @@ THREE.RenderPass.prototype = Object.assign( Object.create( THREE.Pass.prototype
 
 		}
 
+		if ( this.clearDepth ) {
+
+			renderer.clearDepth();
+
+		}
+
 		renderer.render( this.scene, this.camera, this.renderToScreen ? null : readBuffer, this.clear );
 
 		if ( this.clearColor ) {