This is a Outline URP RenderFeature for Unity versions 2022 and above.
I made this by Ben Golus's fantastic article https://bgolus.medium.com/the-quest-for-very-wide-outlines-ba82ed442cd9.
To fit the URP feature, I made a little bit change to the shader.
This Outline works with Layer Mask. To set which object that the outline will be draw at, you need to add them to a specific Layer.
- Go and copy the files in this path to your Unity Project: URP-Outline/UnityProject/Assets/RenderFeatureOutline/
- Add this RFO RenderFeature to your renderer.
- Assign the RFOMaterial.mat to RFO.
- Setup other settings such as which layer should outline be drawing on.
- Change your 3D Object's layer to the outline layer. And you will see the Outline!
Please download the whole project, I have a Sample in my project, maybe this will help.
If you have any idea about optimization, or need to add more feature, or if there is any bug, it is thankful leave it as an issue.