Glad to hear that it helped, thanks for sharing the shader code!
What I forgot to add in the previous post:
Neighbourhood sampling based outline generation (as you posted above) comes with added cost for larger outline-width. If you only need one pixel wide outlines, that's perfectly fine of course.
In case you need variable-width outlines, distance fields could come in handy. Usually used for crisp font rendering, it is also used for outline rendering without the need for neighbourhood sampling. However, this requires custom prepared image data, which is not too trivial in combination with atlas generation, etc. Just mentioning for the sake fo completeness - your approach is perfectly valid and looks good.
You could also add some antialiasing/smoothing by not only testing against a threshold like this:
if (pixelUp + pixelDown + pixelRight + pixelLeft > _Threshold)
{
texColor.rgba = _OutlineColor;
}
but instead having a semi-transparent outline at corner pixels:
// _ThresholdStart = 0.5
// _ThresholdEnd = 2.0
fixed sum = pixelUp + pixelDown + pixelRight + pixelLeft;
fixed outlineAlpha = (sum - _ThresholdStart) / (_ThresholdEnd - _ThresholdStart);
texColor.rgba = lerp(texColor, _OutlineColor, outlineAlpha);
This way you will get smooth outlines.