File: MaskPass.md | Updated: 11/15/2025
This pass can be used to define a mask during post processing. Meaning only areas of subsequent post processing are affected which lie in the masking area of this pass. Internally, the masking is implemented with the stencil buffer.
const maskPass = new MaskPass( scene, camera );
composer.addPass( maskPass );
MaskPass is an addon, and must be imported explicitly, see Installation#Addons.
import { MaskPass } from 'three/addons/postprocessing/MaskPass.js';
Constructs a new mask pass.
scene | The 3D objects in this scene will define the mask.
---|---
camera | The camera.
The camera.
Overwritten to perform a clear operation by default.
Default is true.
Overrides: Pass#clear
Whether to inverse the mask or not.
Default is false.
Overwritten to disable the swap.
Default is false.
Overrides: Pass#needsSwap
The scene that defines the mask.
Performs a mask pass with the configured scene and camera.
renderer | The renderer.
---|---
writeBuffer | The write buffer. This buffer is intended as the rendering destination for the pass.
readBuffer | The read buffer. The pass can access the result from the previous pass from this buffer.
deltaTime | The delta time in seconds.
maskActive | Whether masking is active or not.
Overrides: Pass#render