Table of Contents

🔳 CosterGraphics.Systems.OutlineSystem


⭐⭐ OutlineSystem Basic Tier

The Basic tier of the Outline System adds 'basic' Depth, (View Space) Normals and UV texture masks to the system. The Depth and Normals information makes it possible to detect edges using edge detection methods not solely based on the binary yes/no 'is there an Outline3D object over here?' question but also on the 'is there an edge considered sharp enough to cause an outline on this location inside of the masked geometry?'. The Depth texture can be used to detect edges by looking at sudden changes in depth between center and neighboring masked pixels and the Normals texture mask can be used to detect edges by looking at large differences between angles of the center and it's neighboring pixels. The Depth information is very useful to detect edges mostly around the perimiters of the masked geometry since that is where the depth changes the most sudden but also for some bits on the inside of the masked geometry which makes the depth based outlines sit somewhat in between the binary silhouette outlines and the 'almost fully contour' normals based outlines. On its own the depth based outlines may not give a full enough contour outline but when used together with normals based edges can give a really stable and predictable outline.

The Basic tier introduces the Depth and Normals based contour outlines to the system and includes both separate Depth and Normals based Composite Contour outlines for drawing only depth or normals edges as well as combined Depth & Normals based Composite Contour outlines that let you tweak the influence of both the depth and the normals edges via the shader properties.

Color, as in Scene Color (what the camera sees) can also be used for edge detection but it is much less reliable as depth or normals information since detecting edges based on color heavily depends on the available light and the shadows in the scene, making it far less predictable as depth and normals edges but very useful for stylized effects. Color based edge detection doesn't only pick up edges on the actual curves of the Outline3D models/meshes but also on the color information of the Albedo textures on the models flat surfaces. (We're actually lucky that in game engines we can use the depth and normals information to very easily detect edges since it comes in as almost perfect information with almost no noise. It is a lot harder to detect edges in real life on real camera footage or color images alone!)

In the Basic tier the Depth and Normals are used without much 'fluff' (no edge detection kernel weights are used on the texture samples yet, those come in the Advanced tier) so the Basic tier Composite shaders are still very efficient to render and probably run on most mobile hardware, but they're not as refined/sensitive as the Advanced tier normals and depth based outlines that use the so called 'edge detection convolution kernels'.