Arvtesh / UnityFx.Outline

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

does it work on urp project? #3

Closed wtksana closed 4 years ago

wtksana commented 4 years ago

i use unity 2020.1b urp project

my workflow

1.only import the UnityFx.Outline package. 2.add OutlineEffect component to my main camera. 3.add MyOutlineEffect compoent to my main camera. the code:

    public class SelectionIndicator : MonoBehaviour{
        [SerializeField] private GameObject selectedGO;

        void Start(){
            var outlineEffect = Camera.main.GetComponent<OutlineEffect>();
            var layer = new OutlineLayer("MyOutlines") {
                OutlineColor = Color.red, OutlineWidth = 7, OutlineMode = OutlineMode.Blurred
            };

            layer.Add(selectedGO);

            outlineEffect.OutlineLayers.Add(layer);
        }
    }

the selectedGO did not have outline effect in play mode

does my operation correct?

sorry for my bad english.

thanks.

abogarsukov commented 4 years ago

URP uses its own post-processing stack, so OutlineBehaviour and OutlineEffect most likely will not work with it (they are for built-in RP). URP does not allow custom post-effects at the moment. They might add this (or at least support for post-processing stack v2) for 2019.4+. I guess the package will be patched than.

That said, it should be quite easy to adapt the package to any post-processing stack. See the README Extensibility section.

Arvtesh commented 4 years ago

Your code looks valid. As stated above both OutlineBehaviour and OutlineEffect are for built-in render pipeline. They might not work for URP/HDRP. That said, I'm going to release packages with outline implementation for:

There is no ETA yet though.

wtksana commented 4 years ago

thank you for your reply