Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

[Advice/Help Needed] Outline Shader

Discussion in 'Scripting' started by bart87, Oct 13, 2020.

  1. bart87

    bart87

    Joined:
    Sep 10, 2016
    Posts:
    12
    Hi,

    I am doing some learning tests and to achieve something good I would like to apply to my test an Outline Shader. I am not good in writing my own shader so I tried to dig the internet a bit and I found following page.

    https://assetstore.unity.com/packages/tools/particles-effects/quick-outline-115488

    The Outline works perfectly fine, unfortunately I am not able to achieve one thing which is a key in my situation.
    The screenshots will explain what I would like to achieve:

    The first one is the one which is receiving from the package quick outline from asset store:


    The second one is what I would like to achieve:


    My question is: Can we modify this Shader to be able decide that the specific object or group of objects will be always visible on front of another outline?

    Like I said I do not understand how this works, I am trying to figure out this for 3 days so far and any help will be super handy.

    Thank you,
    Bart
     

    Attached Files:

    • 01.png
      01.png
      File size:
      142.8 KB
      Views:
      279
    • 02.png
      02.png
      File size:
      136.5 KB
      Views:
      276
  2. bart87

    bart87

    Joined:
    Sep 10, 2016
    Posts:
    12
    Ok I found solution.
    To have outline on top of another outline we have to use Forward Renderer which is attached to URP.
    There we need to leave it the top one as it is and hit 'Add Renderer Feature'
    Then I changed:
    Event = After Rendering Opaques (or anything just test it which one works the best)
    Filters/Queue = Transparent
    filters/LayerMask = select 'Nothing' then select the layer which one should be visible on front of other Outlines

    and thats all. It will produce Outline on front of another outline.
    Hope someone will find this handy.