Table of Contents

Depth-Tested Color Mask Pass

📖 Description

Renders silhouettes of Outline3D objects with depth testing, ensuring outlines only appear where objects are visible (not occluded by other geometry). This creates more accurate masks for complex scenes.

🔧 How It Works

  • Inputs: Outline3D objects and camera depth buffer.
  • Process: Draws objects with LEqual depth testing and depth bias. Uses a separate channel (e.g., G) in the color mask texture.
  • Outputs: Updates Texture2D_OutlineColorTextureMask (G channel).
  • Code Example:
    // From OutlineDepthTestedColorMaskPass.RecordRenderGraph
    builder.SetRenderAttachmentDepth(resourceData.cameraDepthTexture, AccessFlags.Read);
    // Draw with depth-tested material
    

📋 Requirements

  • Materials: outlineColorMaskDepthTestedMaterial.
  • URP Settings: Depth buffer enabled.
  • Dependencies: Requires Color Mask Pass.

🏷️ Tier Usage

  • Available in: Basic, Advanced, Pro.
  • Conditional: Runs if Composite Shader has _OutlineColorTextureMaskDepthTested.

🐛 Troubleshooting

  • Issue: Outlines appear behind objects.
    • Fix: Adjust depth bias or test mode.
  • Performance: More expensive than basic color mask.

See Render Passes Overview.