A wireframe and outline (2-in-1) effect for Unity that uses depth-based edge detection to render thick, quality post-processing wireframes and outlines. You can control the line thickness, edge detection threshold, colour, and blend state. Unlike the typical edge-detection techniques of using a sobel filter/kernel, we compare depth against the local area average- calculated using what is essentially box blur.
Depth.Outlines.Preview.2.mp4
Depth.Outlines.Round.mp4
- Built-in pipeline.
- Tested with Unity 2021.3 (LTS).
You'll find everything under Mirza Beig/Post-Processing-Wireframe-Outlines/...
Easy as,
- Attach these two components to your camera.
- Set to render at least 'Depth', and assign the material.
...That's it.
You can then tweak the material, for example: to get this automatic per-object line colour look.
Or to render thick, painterly strokes- best used in combination with some kind of stylized surface shader.