Table of Contents

Color Mask Pass

📖 Description

Renders basic silhouettes of Outline3D objects into a binary texture (white on black). This acts as the foundation for outline detection, like tracing the edges of objects in your scene.

🔧 How It Works

  • Inputs: Outline3D objects' meshes/renderers.
  • Process: Draws objects with a unlit shader, disabling global keywords (lighting, SSAO) for clean silhouettes. Applies depth bias to avoid ULP issues.
  • Outputs: Texture2D_OutlineColorMask (R8_UNorm format).
  • Code Example:
    // From OutlineColorMaskPass.RecordRenderGraph
    TextureDesc desc = resourceData.activeColorTexture.GetDescriptor(renderGraph);
    desc.colorFormat = GraphicsFormat.R8_UNorm;
    TextureHandle mask = renderGraph.CreateTexture(desc);
    builder.SetRenderAttachment(mask, 0, AccessFlags.Write);
    

📋 Requirements

  • Materials: outlineColorMaskMaterial (unlit Shader Graph).
  • URP Settings: None special.
  • Dependencies: Runs early in the pipeline.

🏷️ Tier Usage

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

🐛 Troubleshooting

  • Issue: Mask has gaps.
    • Fix: Increase depth bias in shader (cmd.SetGlobalDepthBias(-0.2f, -0.2f)).
  • Performance: Skip if not needed—check material properties.

See Render Passes Overview.