Arvtesh / UnityFx.Outline

Screen-space outlines for Unity3d.
MIT License
1.27k stars 90 forks source link

Outline of renderers with no material? #33

Closed STARasGAMES closed 3 years ago

STARasGAMES commented 3 years ago

It's potentially a good feature to be able to render outlines for invisible objects.

The easiest way to make object invisible is to disable the renderer component, but UnityFx.Outline ignores such renderers.

The second way is to remove all materials from renderer (what I previously was doing with another outline asset), but again, UnityFx.Outline just ignores such renderers.

As a workaround, I'm replacing empty materials with material, that draws nothing. Here is the shader code for this:

Shader "Custom/HiddenPass" {
    SubShader
    {
        Tags {"Queue" = "Geometry-1" }

        Lighting Off

        Pass

        {
            ZWrite Off
            ColorMask 0    
        }
    }
}

But maybe it makes sense to support this natively.

Arvtesh commented 3 years ago

Hm, that;s an interesting request. Could you describe a situations where it might be useful?

STARasGAMES commented 3 years ago

For example, player has a shield. And we want to show him that he can hang this shield on the wall by outlining invisible(completely transparent) copy of the shield that already hanging on the wall. Does it make sense?

Arvtesh commented 3 years ago

Yes, makes sense. I'll add some kind of a switch to enabled that.