Depth Mask Pass
📖 Description
Captures the depth values of Outline3D objects into a depth texture. Used for contour outlines and depth-based edge detection in Composite Shaders.
🔧 How It Works
- Inputs: Outline3D objects.
- Process: Draws objects to a depth-only render target with raw depth values.
- Outputs:
Texture2D_OutlineDepthTextureMask(D32_SFloat_S8_UInt). - Code Example:
// From OutlineDepthMaskPass.RecordRenderGraph TextureDesc depthDesc = resourceData.cameraDepthTexture.GetDescriptor(renderGraph); depthDesc.format = GraphicsFormat.D32_SFloat_S8_UInt; TextureHandle depthMask = renderGraph.CreateTexture(depthDesc); builder.SetRenderAttachmentDepth(depthMask, AccessFlags.Write);
📋 Requirements
- Materials:
outlineDepthMaskMaterial. - URP Settings: Depth buffer enabled.
- Dependencies: None specific.
🏷️ Tier Usage
- Available in: Basic, Advanced, Pro.
- Conditional: Runs if Composite Shader has
_OutlineDepthTextureMask.
🐛 Troubleshooting
- Issue: Incorrect depth.
- Fix: Ensure ZWrite On in material.
- Performance: Low cost.