Browse Source

MaskPass: Make sure depth and color buffer are writable. (#26382)

Michael Herzog 2 years ago
parent
commit
0d7d5ea4d2
1 changed files with 4 additions and 1 deletions
  1. 4 1
      examples/jsm/postprocessing/MaskPass.js

+ 4 - 1
examples/jsm/postprocessing/MaskPass.js

@@ -63,11 +63,14 @@ class MaskPass extends Pass {
 		if ( this.clear ) renderer.clear();
 		renderer.render( this.scene, this.camera );
 
-		// unlock color and depth buffer for subsequent rendering
+		// unlock color and depth buffer and make them writable for subsequent rendering/clearing
 
 		state.buffers.color.setLocked( false );
 		state.buffers.depth.setLocked( false );
 
+		state.buffers.color.setMask( true );
+		state.buffers.depth.setMask( true );
+
 		// only render where stencil is set to 1
 
 		state.buffers.stencil.setLocked( false );