Back to smode.fr
You are here: Compo > 2D > Masks > Depth mask

Depth mask

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 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 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 Renderer parameters and change the Renderer Depth Settings as on the image below (it is like that by default):

PARAMETERS

  • 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 Whether or not the background (depth=+oo) is included inside the mask
  • Function ( Percentage Function): Function that is applied on the resulting depth

SEE ALSO

In same group: Color mask. Mentioned: 3D Renderer, Compo, Mask, Renderer Depth Settings and Shared Element.