Overlapping Outlines

Overlapping Outlines

Jump to heading What's the problem?

There are 2 outline effects in Linework that work kind of in a similar way: Soft Outline and Wide Outline. They both to these 3 steps.

  1. Render the silhouette of the objects
  2. Dilate/extend the silhouette
  3. Subtract original silhouette from the dilated/extended silhouette to get an outline and composite it with the scene

Step 2 (dilation/extension) is the most expensive step and so for performance reasons it is only run once. This means that if you have outlined objects that overlap, their silhouettes will join as well and only be dilated/extended a single time. The result is that the outlines join up together as you can see in the image below.

This limitation is inherent to way that soft/wide outline works.

Overlapping Outlines Overlapping Outlines

Jump to heading Solutions and Workarounds

Multiple Dilation Steps

The only way to use soft/wide outline and not get this issue, is to do the dilation/extension step multiple times. This is only possible if you add the soft/wide outline renderer multiple times.

Before you can do this, you will have to remove the following line of code from WideOutline.cs or SoftOutline.cs respectively.

[DisallowMultipleRendererFeature("Wide Outline")]
[DisallowMultipleRendererFeature("Soft Outline")]

After removing these lines, you can then add the same outline renderer multiple times.

Pasted image 20241216134509 Overlapping Outlines-1

Performance

Keep in mind that adding the same outline renderer multiple times will negatively affect performance! Additionally you might get unexpected rendering artifacts.

Fast Outline or Edge Detection

An alternative approach is to use Fast Outline. Since fast outline works in object-space, you will not get the effect of overlapping outlines being joined. Similarly, you can use Edge Detection which also does not have this issue.

Overlapping Outlines-2 Overlapping Outlines-3

Confused?

Need more information about any of this? Contact me.

Enjoying Linework?

Writing a review helps me out greatly! It helps the asset's visibility and supports me in the development of Linework! If you have a support question, check ⁠support instead. Thank you very much.

Write a review