🔳 CosterGraphics.Systems.OutlineSystem
⭐⭐⭐ OutlineSystem Advanced Tier
The Advanced Tier of the Outline System brings 🪪ObjectIDs, 🟧ObjSpacePositions and 🕵️Edge Detection Convolution Kernels to La Table...
🪪 Object IDs
The ⭐⭐⭐Advanced tier's Renderer Feature adds the 🪪Outline ObjectID Mask Pass to the pipeline which facilitates the Advanced shaders with a per-object identifier that can be used in multiple different ways, for instance to have per-object and per-team outline colors.
During the ObjectID mask Render Pass a unique per-object ✨🆔InstanceID is also generated by the feature and stored alongside the ObjectID (in the (G) channel) of the ObjectID texture mask.
The ObjectID can be set by you on each Outline3D component and multiple Outline3Ds can have the same ObjectID if you want. The InstanceIDs are set by the render feature and are only used internally by the InstanceID Intersection outline shaders so that even if multiple objects have the same ObjectID they can still have per-object intersecting outlines.
🟧 Object-Space Fragment Positions
The ⭐⭐⭐Advanced tier's Renderer Feature also adds the 🟧Outline Object Space Position Mask Pass to the pipeline which renders the 🔳Outline3Ds fragment positions in Object-Space to a texture so that the Full-Screen Shader Graph shaders can generate procedural effects in Object-Space that rotate with the objects. Object-Space fragment positions are available by default for regular Unlit/Lit Shader Graph shaders via the built-in Shader Graph Position node but not for Full-Screen Shader Graph shaders.
🕵️Advanced Edge Detection
Where the Basic tier introduced the Depth and Normals based edge detection outlines the Advanced tier further refines it by applying specific weights from a kernel to the sampled neighboring pixels in the shader stage. By applying specific weights to the sampled pixels the importance of say the horizontal and vertical direct neighbor pixels of the center pixel (N,E,S,W) can be set higher than the diagonal neighbor pixels (NE, SE, SW, NW) which makes the edge detection work more accurate even with noise and have a higher response to edges which makes the edge detection more sensitive and easier to finely adjust. There are a bunch of these edge detection kernels that can be applied to the sampled pixels, with exotic names like Sobel, Scharr, Roberts Cross or Gaussian and each of these kernels has it's own use. If you have ever used raster/bitmap image editing software like Photoshop or GIMP then you have probably already used kenel weighted edge detection algorithms, maybe without knowing, since a simple 'Gaussian' blur in Photoshop uses a Gaussian blur kernel on pixels sampled in a radius around each pixel of the blurred image. You may have also already used the Sobel or Scharr kernels if you've ever used the 'Glowing Edges' or 'Find Edges' type of filters in said programs.