Skip to content

Outline Zero

Outlines for URP whose cost is fixed per frame, not per object.

Most outline packages draw every outlined object a second time, at full material cost. This one draws each outlined object once more with a shader so cheap it does almost nothing, and Pro Mode removes even that draw. The result: outlining forty objects costs about what outlining one costs. On a Galaxy S20 FE (the same GPU as a Quest 2) at 1080p with MSAA 4x, the outline adds about 4.5 ms per frame with one layer, and 5.3 ms with all four, in a busy scene. On a budget Galaxy A53 it adds about 3.9 and 5.2 ms: that phone draws the scene itself almost twice as slowly, but the outline costs about the same, which is a good guide for what to expect on devices in between. Those numbers, and how they were measured, are in the Performance Guide.

The numbers above are Performance mode, which needs Unity 6 (URP 17). On Unity 2022.3 (URP 14) the package runs in Compatibility mode: the same picture, at a higher cost with MSAA on. Rendering Modes has both sets of numbers.

Quickstart Three steps to your first outline.
Rendering Modes Performance or Compatibility, and how to choose.
Layers Four outline styles, which one wins when they overlap, and outlining through walls.
Pro Mode For shader authors: outline an object with no extra draw at all.
Performance Guide What it costs, on real devices, and what makes it cost more.
Troubleshooting Start here if no outline appeared.
API Reference Everything you can call from a script.
Samples The three samples, and two things worth knowing before you run them.

Better to know now:

  • URP only. Not the Built-in render pipeline, not HDRP, not the 2D renderer.
  • Four outline layers, and that is a fixed limit.
  • Transparent objects cannot be outlined. The outline is drawn on top of them instead, which is usually what you want for a selection highlight.
  • Outlines come from your main camera. Camera stacks work, but an object only a UI or overlay camera can see is not outlined.
  • Objects drawn by Entities Graphics or the GPU Resident Drawer cannot be outlined automatically. Pro Mode handles them.
  • VR: single-pass instanced is supported and tested. Multiview builds, but has not been checked on a real headset yet.

Three, from the Package Manager: Selection & Hover, Many Units Stress and Layers Showcase. Each one is a scene, its scripts and its art. None of them ship render pipeline settings, so importing a sample cannot change how the rest of your project looks.