Table of Contents

🔳 CosterGraphics.Systems.OutlineSystem


⭐⭐⭐ OutlineSystem Advanced Tier

The Advanced Tier of the Outline System brings 🪪ObjectIDs and Edge Detection Convolution Kernels to La Table...

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.

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.