2
0
Эх сурвалжийг харах

Add clearDepth attribute to RenderPass

Ford Hurley 8 жил өмнө
parent
commit
e0df8d13c1

+ 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 ) {