Depth mask
2D Mask - Select each pixel depending on a associated depth-value
This mask relies on the depth-buffer which contains depth information associated to each pixel. Each Compo using 3D elements have such a depth-buffer.
Either the Depth Map is set to “Current”, which means that the used depth will be of the current compo, or this parameter can be customized to point to external Compo such as compos inside Shared Element .
Here is the “Mask - Depth.compo” example that applies a Mask with a depth mask as a post-fx of a 3d compo:
Do not forget inside the depth mask parameters to choose the depth buffer it will be based on. In the next picture the depth mask depth map has been chosen from a compostion having a 3D object and so, a depth buffer :
Also remember than to actually generate a depth buffer you must write your 3D objects inside of it. To do so, go check the 3D objects 3D Renderer parameters and change the Renderer Depth Settings as on the image below (it is like that by default):
Variables:
- Depth Map: Optional link to another compo that defines a custom depth map
- Distance Interval: At which distance the mask starts and finishes
- Include Background: Whether or not the background (depth=+oo) is included inside the mask
- Function: Function that is applied on the resulting depth
Python
Oil.createObject("DepthTextureMask")