🔳 CosterGraphics Systems OutlineSystem Components Overview
🌍 Outline System Components Overview
🧩 Outline System Components
Outline3D : MonoBehaviour
Description: The Outline3D MonoBehaviour component marks a GameObject as outline-eligible/receiver and is used by the Renderer Features to filter out the objects that need to be rendered by it into the mask textures that are then used by the composite outline shaders.
Instead of filtering objects by GameObject layers or by Renderer Layers, which are project specific and probably already in use by you, I have chosen to filter by component instead for this system which is possible trough the use of Command Buffers and the RasterCommandBuffer.DrawMesh() and DrawRenderer() methods.
Using a component to filter also has the advantage that outlines can simply be enabled or disabled by enabling and disabling the Outline3D component on a GameObject which makes this system very easy to use espescially for per-object selection outlines.
Outline3D Component Responsibilities:
- Registers itself with the renderer feature via static Outline3D.AllActiveOutlines list
- Provides access to its Mesh or Skinned Mesh Renderers
- Stores per-object data (FeatureID, ObjectID)
Outline3DRendererFeature : ScriptableRendererFeature
Handles all inspection, rendering and compositing work.
Typical passes:
1. Mask Pass
- Draws all
Outline3Dobjects into a dedicated mask texture - Produces a binary white silhouette
- Optional: also capture depth or normals for improved accuracy
2. Composite Pass
- Full-screen pass
- Samples mask
- Dilates / colors / blends
- Writes result onto camera color buffer