Depth mask

2D Mask  -  Select each pixel depending on a associated depth-value

DepthTextureMask DepthTextureMask DepthTextureMask DepthTextureMask

This mask relies on the depth-buffer which contains depth information associated to each pixel. Each Compo Icon 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 Icon Compo such as compos inside SharedElement Icon Shared Element .

Here is the “Mask - Depth.compo” example that applies a MaskTextureModifier Icon Mask with a depth mask as a post-fx of a 3d compo:

DepthMaskExample DepthMaskExample

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 :

DepthMaskExample02 DepthMaskExample02

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

DepthMaskExample03 DepthMaskExample03


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")