Search Unity

Question Selection Outline feature and Selection Outline shader for multi selection

Discussion in 'Unity Reflect' started by opacicpetar96, Dec 15, 2020.

  1. opacicpetar96

    opacicpetar96

    Joined:
    Nov 20, 2019
    Posts:
    26
    Hello!

    We implemented multiple object selection in our custom viewer. We are using the latest Custom/Selection Outline shader and the SelectionOutlineFeature.cs script. Now there is an issue, when we select multiple objects, the outline of the selected objects 'hides' as we move the camera. We would like to have the outlines always present in the scene and non-dependent of the cameras current position. Example:
    bad.PNG good.PNG

    The first image is the current situation and the second image is what we want to achieve. I tried to tweak both the above mentioned shader and script but nothing worked so far. Any suggestions?
     
  2. Gublu

    Gublu

    Unity Technologies

    Joined:
    Dec 17, 2020
    Posts:
    9
    Hi,
    I understand what you want to achieve here. The behavior of the selection outline in Reflect Viewer is the same as the selection in Unity Scene view. If you looked into Custom/Selection Outline shader and the SelectionOutlineFeature.cs script, you probably already notice that the render of all selected objects are done at once and the outline came from a blur of that render. Unfortunately, if outline are into other selected object, this information is lost.
    If you really want to do it anyway, you can try to find a way to render each selected objects separately and apply the whole process for each. In that case, the depth buffer will need to be add to the process to resolve superimposed objects.
     
    Jamie_Choi likes this.