Corgi SDF Outlines (aka Stroke Outlines) for URP [Released]

Corgi SDF Outlines (aka Stroke Outlines) for URP

Asset store URL: Corgi SDF Outlines (aka Stroke Outlines) for URP (xray or blocked) | Fullscreen & Camera Effects | Unity Asset Store

Fast and easy to use SDF / Stroke outlines for URP projects.

Features:

  • Fast stroke outlines!
  • Customizable thiccness!
  • Customizable HDR colors!
  • Uses layers, so you can easily control what does and does not have an outline.
  • Depth testing so outlines do not appear through walls!
  • Works in VR (both multi-pass and single pass instanced) and non-VR!
  • FULL SOURCE CODE INCLUDED

Documentation here!

Want to test out performance and quirks? Check out this demo here.

Please note: This plugin is only intended for URP projects. If you need it to work in HDRP or a custom render pipeline, please hit me up and ask!

Itā€™s now released!

Hi! Few questions here:

  1. Does it support multiple different outlines?
  2. Doest it support multiple renderers/objects under with single outline?
  3. Is line width performance relative?
  4. Is line has same width all around the object? It looks on some screenshots that line sometime has different width like extrusion outline.
  1. It does, Iā€™m using it for that in a personal project. However, it requires a separate pass for each layer (allowing for independent outlines). If you run into any issues with this, please DM me with the Unity/URP version youā€™re using and Iā€™ll make sure it works for that combo, asap. URP changes a lot so it can be a bit tricky with this stuff.

  2. Yes, each pass is a single outline around a layer of objects.

  3. Yes, but itā€™s screen-space. Itā€™s a linear cost with the pixel width of the outline. However, itā€™s relatively fast so you can get decently thick outlines before performance becomes a concern.

  4. Yes, itā€™s a screen space width that you can change via a slider per-pass.

Thanks for you answers!
As I can see it using same algorythm as in the article:

Any particular reason why the width now is limited by 16? Article mentioned that even extra-wide lines are relatively cheap.

Iā€™m also very interesting in more complex behaviour: is it possible for now outline not the whole objects but only visible pixels? Not just crop overlapped outline but render outline all around visible object.

Yeah you are right, itā€™s using something very similar to that articleā€™s final solution. At the moment, each pass is another compute call, which gets a bit heavy when doing a LOT of them in a row on the cpu side, but the gpu side is basically linear time. It could be improved a lot by moving it to be a loop on gpu, which is controllable by cpu. If you or others request this, I can improve the plugin by changing the behavior to make even wider outlines cheaper.

Can you explain what you mean by this? Iā€™m not quite understanding. A drawing might help clear up what you mean.

I think doing outlines of any width without loosing in performance to much could make your asset to be best on the market :smile: Itā€™s especially useful for mobile where devices has ultra resolutions / DPIs that requires strokes to be wide to look same as at desktop but outcome performance is very poor.

As for drawing with obstacles (I guess it requires depth-testing or something like that), Iā€™ll try to explain:
a) Here the model (Unlit material) with 2 outlines ā€“ Black and White


b) And here how outlines react to overlapping object: Black is outlining only visible mask and White still outline whole object without any depth test
7860859--998143--Screenshot 2022-02-02 at 12.58.43.png
c) And here one more behaviour that using by some outlines ā€“ just cropping visible outline. It could be useful sometimes but also could be very undesired (in my case at least). The best option is give the ability to switch between (b) and this behaviour but I understand that itā€™s requires a lot of work.
7860859--998146--Screenshot 2022-02-02 at 12.59.02.png

There is one of the best outline here GitHub - Arvtesh/UnityFx.Outline: Screen-space outlines for Unity3d. that gives control to customize outline as described in (b) that I like very much. But unfortunately this solution is very sensitive to outline width (I guess it uses Blurred Buffer approach) that makes it unusable at mobile.

My plugin will do bā€™s black outline, right now. I could add in the option to optionally depth test or not (although you can also tweak the urp settings to remove the depth stuff, which then the outline has no depth texture to use for obscurity).

How thick of an outline are you desiring? 16 pixels is pretty thicc in my opinion, but if youā€™re looking for something like 256 pixels the plugin might need some work done to make it possible.

Itā€™s cool that it has depth test. Also it is possible to enable/disable it for different outlines in one project?
As for thickness let calculate.

Here the width 4 and 8 for black and white outlines at the screen height 720. Modern resolution of iPhone and iPad about 2500px that means we need to increase outlines about x4 times. And if we are at desktop some Retina and 8K displays also could require even more. But for I need at least 32 pixels width. And ideally I dream about outlines that really could give any width without major performance out drawdownsā€¦

But anyway for now Iā€™m a little afraid to buy new assets because Iā€™m not sure that it suit best for my goals (already purchased few and they useless for my case). But if you could implement same performance relative to width I defiantly will give chance to your asset (no pressure here, your asset already has huge advantage) or in the end Iā€™ll try to implement it by myself :smile:

Thereā€™s not yet a way, but I can implement this for you and push an update, maybe this weekend or the next.

That graph is a bit idealistic, but I think I can get this plugin closer to matching its trend overall with a bit of effort. Iā€™ll see what I can do soon. Itā€™s not too far off, just a bit too much CPU overhead from the multiple compute dispatches.

I understand, Iā€™ve been bitten by a lot of asset store plugins as well. If you do pick it up, Iā€™ll be happy to work with you to resolve any issues you might have. If youā€™re not happy, you can always get a refund with no hard feelings.

New update just submitted to the asset store. Details:

Working on adding in some custom property drawers, to make the editor side of the tool feel much nicer to use. It gives helpful tooltips and advice based on context. For example, when using texture downscaling it will warn you that depth testing will no longer work (to avoid doing an extra depth blit that would be required to make this work).

Pushing the next update:

Surprise update coming through!

Mini update, but a pretty good one.

Another small update:

By request, added a new feature:

1 Like

update uploaded:

Small update:

Updated! v1.6.1 pushed to the asset store.