I want a shader similar to how Unity outlines what you have selected in orange (only in black). Outlining only the selected object, no background outlining (sobel post-process edge detect), no ugly as sin artifacts when you have complex concave surfaces or hardened edges (normal push/mesh duplicate method). This would be for characters, attached an image to help explain. Is this something that's possible? Can I do this and integrate it with Shader Forge?
Replies
I don't know if you can do that with shaderforge but if you write your own shader, it's possible with two passes shader.
The first pass is the standard shader with stencil comparison set to always.
The second pass is the outline with second stencil pass, set comparison to notequal and push the geometry.
(You can have more information here: https://docs.unity3d.com/Manual/SL-Stencil.html )
I wrote a simple surface shader. It could be better, like unlit outline, but it does the trick on a character.