2D TextureMask - 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 CompoComposite 2D Layer, Shape layer and 3D Layer together. [Ctrl] + [Shift] + [N] to create a new composition after opening SmodeRead More 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 CompoComposite 2D Layer, Shape layer and 3D Layer together. [Ctrl] + [Shift] + [N] to create a new composition after opening SmodeRead More such as compos inside Shared ElementA shared element that can be reused at several places like an After Effects precompositionRead More.
Here is the "Mask - Depth.compo" example that applies a MaskTextureMask a part of your imageRead More 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 choose 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 RendererDisplays a 3D geometryRead More parameters and change the Renderer Depth SettingsSettings that affect how a renderer uses the depth-bufferRead More as on the image below (it is like that by default):
Depth Map (2D Generator Selector) : Optional link to another compo that defines a custom depth map
Distance Interval (Meters Interval) : At which distance the mask starts and finishes
Include Background (On/off option) : Whether or not the background (depth=+oo) is included inside the mask
Function (Percentage Function) : Function that is applied on the resulting depth