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

Question How to reproduce Editor Highlight Effect?

Discussion in 'Shaders' started by Markus4Unity, Oct 31, 2020.

  1. Markus4Unity

    Markus4Unity

    Joined:
    Jun 25, 2018
    Posts:
    6
    Hi there,

    Im looking for a way to get the effect from the editor search that highlights certain gameobjects just like in the picture. Grateful for any tips Im starting at zero here.

    Regards
    Markus

    upload_2020-11-1_0-21-24.png
     
  2. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,238
    Markus4Unity likes this.
  3. Markus4Unity

    Markus4Unity

    Joined:
    Jun 25, 2018
    Posts:
    6
    Thanks for your replay bgolus!

    I took a look at those; it seems to only cover the outline effect. However, Im particularly interested in the color fading. Everything outside or in front of the volume is faded out and only inside or behind the volume the original colors appear.

    Regards
    Markus
     
  4. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,238
    I’m not sure I’ve seen anyone ask about the selective desaturation effect, though a large part of the implementation is actually similar to the outline highlight. Render the objects you want to a separate render texture using a solid white shader to generate a screen space mask. In the highlight effect you then blur that texture and render that back into the scene (with the original mask subtracted). For the desaturation, you need a desaturation post process that uses the mask to skip desaturating those pixels.
     
    Markus4Unity likes this.