I’m new to Unity, especially when it comes to shaders and post-processing effects. I’m having difficulty creating an edge outline effect because all the tutorials and GitHub projects I’ve found are outdated. For example:
I’m not sure about 2023.1 as that is somewhere between tech releases, but even 2022 LTS seemed to have changed things from before and a lot of examples were not working well when I looked at post process effects or not setup in the easiest way.
But it is easiest to use a fullscreen shader graph for sure and to use a custom function node to do multiple reads of depth and/or normal buffers etc. within that which takes some effort since reading those textures in a custom function node does not seem documented.
It would be a very good idea for Unity to add an outline post process effect as many people are questioning doing one and more documentation on custom function node use in fullscreen shader graphs.
If you want to remove image edge detection in #2 you will have to learn a bit about shader graphs to edit the example one
I think post process effects are changing again in some way in Unity 6 - hopefully the ability to add your own custom post processes instead of this some-Unity-post-processes and then before or after your full screen graph effect!
There are in general two major ways of doing outlines.
Inverted hull (or any geometry based) outlines
Post processing outlines
They both have different use cases, different advantages and disadvantages.
The links you posted all link to solution for post process outlines.
I would have thought that the danielillet video should get you pretty far.
Since you want outlines on everything, depth buffer based edge detection with a low depth difference threshold sounds like it should work.
The resources you choose are good and you are on the right path, but you need to adapt it to the up to date engine. It’s difficult to help without knowing what exactly you stuck at.
Apart from that the asset store could have something that works?
This no longer works in the latest URP as they have deprecated the entire workflow. Raised an issue but there doesn’t seem to be any traffic on the repo.
I have no idea how to use the new workflow. We’ve tried a few options but haven’t been able to make a functional port. Please post an update if you happen to solve this one.
I’m having an issue with this where whenever I move the camera it takes the outline like an extra frame to move into position. It ends up making the outline have a really bad motion blur effect that’s exclusive to it and I’m not sure why.
I implemented it into the project without changing any code so if you or anyone else has an idea of how I could fix it I would appreciate it greatly.
@marlon1748 : I was able to get one of Daniel Ilett’s full screen shaders to work for Unity 6 (6000.0.22f1) from here: Outline Post Process in Unity Shader Graph (URP). The page contains a link to the GitHub repository so you can download the shader graph.
In the Renderer Feature I had to set Pass to “DrawProcedural (0)” and in the material I had to set “Overlay” to True for it to work properly (the post says to set Pass to “Blit (1)”). This will give you the result in your second image.
Thank you so much for sharing this!! This was not only the only outline render feature that actually worked for me (unity v2022.3.41) but also the easiest to setup and edit. Took me less than 10 minutes to read the article and implement.
You, sir, are a hero.