Offline Documentation & Setup Guide
The Advanced Outline System is a high-performance, feature-rich screen-space outline solution for Unity. It uses the stencil buffer to render crisp, pixel-perfect outlines around meshes, including static meshes and skinned mesh hierarchies. The system dynamically creates temporary mesh clones at runtime to compute and assign smooth normals, resolving ugly outlines on hard-edged shapes without altering original asset files on disk.
Pipeline Compatibility: The system natively supports both the Built-in Render Pipeline (Standard) and the Universal Render Pipeline (URP) out of the box. It automatically detects the active render pipeline at runtime and loads the appropriate shaders dynamically.
Follow these steps to apply outlines to any object in your scene:
Advanced Outline, and add it.
OutlineVisible, OutlineAll), select an **Outline Color**, and adjust the **Outline Width** in the Inspector.
OutlineAll: Renders the outline around the entire mesh.OutlineVisible: Renders the outline only on sections of the mesh visible to the camera.OutlineHidden: Renders the outline only on sections of the mesh hidden behind other objects.OutlineAndSilhouette: Shows outlines on visible sections, and a solid silhouette on occluded sections.SilhouetteOnly: Renders a solid silhouette on occluded sections only.Awake() at runtime, eliminating loading spikes.Access and control the system dynamically through code using the following interface:
| Property / Method | Type | Description |
|---|---|---|
OutlineMode |
AdvancedOutline.Mode |
Gets or sets the current active outline depth mode. |
OutlineColor |
Color |
Gets or sets the base outline color. |
OutlineWidth |
float |
Gets or sets the outline thickness (0 to 10). |
PulseWidth |
bool |
Enables or disables outline width pulsing. |
RainbowColor |
bool |
Enables or disables color cycling. |
DashedPattern |
bool |
Enables or disables the dashed crawling-ants pattern. |
RefreshRenderers() |
void |
Forces the component to rebuild renderer caches and recalculate mesh copies. Call this if hierarchy changes at runtime. |
To control outline settings dynamically at runtime from other scripts, import the ITISKIRUHERE namespace and modify the component properties as shown in the example below:
using UnityEngine;
using ITISKIRUHERE; // Namespace for the Advanced Outline component
public class OutlineController : MonoBehaviour
{
[Header("Outline Reference")]
[SerializeField] private AdvancedOutline _outline;
private void Start()
{
// Automatically find component if not set in Inspector
if (_outline == null)
{
_outline = GetComponent<AdvancedOutline>();
}
}
// Example 1: Activate a pulsing red outline
public void EnableDangerOutline()
{
if (_outline == null) return;
// Ensure the component is active
_outline.enabled = true;
// Configure properties
_outline.OutlineMode = AdvancedOutline.Mode.OutlineAll;
_outline.OutlineColor = Color.red;
_outline.OutlineWidth = 6f;
// Enable pulsing width animation
_outline.PulseWidth = true;
_outline.PulseSpeed = 4f;
_outline.PulseMinWidth = 2f;
_outline.PulseMaxWidth = 8f;
// Disable other conflicting effects
_outline.RainbowColor = false;
_outline.DashedPattern = false;
}
// Example 2: Activate a crawling dashed cyber outline
public void EnableCyberOutline()
{
if (_outline == null) return;
_outline.enabled = true;
// Configure properties
_outline.OutlineMode = AdvancedOutline.Mode.OutlineVisible;
_outline.OutlineColor = Color.cyan;
_outline.OutlineWidth = 4f;
// Turn off pulsing and turn on dashed crawling pattern
_outline.PulseWidth = false;
_outline.RainbowColor = false;
_outline.DashedPattern = true;
}
// Example 3: Completely disable the outline effect
public void DisableOutline()
{
if (_outline != null)
{
_outline.enabled = false;
}
}
}
The system utilizes two passes for clean composition:
1 to the stencil buffer where the object is rendered. It does not write to the color channel (ColorMask 0).
1, ensuring the outline only renders around the outer boundary of the object.
Q: Why does the outline look jagged on my low-poly mesh?
A: Ensure Precompute Outline is checked or that smooth normals have finished baking. The script requires averaged normals to align vertex extrusion correctly across sharp polygon seams.
Q: Does this component support Skinned Mesh Renderers?
A: Yes, the component automatically detects and supports skinned meshes. They are cloned and updated dynamically in memory, restoring the original mesh configurations cleanly upon script disable/destruction.
Q: Why did my mesh disappear when disabling the script in older versions?
A: In version 1.0, the script destroyed instantiated mesh copies without restoring the original mesh references to the MeshFilter/SkinnedMeshRenderer. This has been fully corrected in version 1.1+.