Object ID Mask Pass
📖 Description
Assigns unique IDs to Outline3D objects and renders them into a texture. Enables per-object outline customization (e.g., different colors per object).
🔧 How It Works
- Inputs: Outline3D objects with IDs.
- Process: Draws objects with MPBs setting
_ObjectID, using depth testing. - Outputs:
Texture2D_OutlineObjectIDTextureMask(R16G16_UNorm). - Code Example:
// From OutlineObjectIDMaskPass MaterialPropertyBlock mpb = new(); mpb.SetFloat(ObjectIDPropertyID, objectID); cmd.DrawMesh(mesh, matrix, mat, subMeshIndex, 0, mpb);
📋 Requirements
- Materials:
outlineObjectIDMaskMaterial. - URP Settings: None.
- Dependencies: Depth Mask for testing.
🏷️ Tier Usage
- Available in: Advanced, Pro.
- Conditional: Runs if Composite Shader has
_OutlineObjectIDTextureMask.
🐛 Troubleshooting
- Issue: IDs overlap.
- Fix: Ensure unique IDs per object.
- Performance: Scales with object count.