Dragon banner

Dragon & Fox
Collective

Fox banner

Outlines

Published by Jady on 5/17/23, 5:34 PM

We have these fancy new outlines now! They appear when an object is still in the process of being captured.

I've been suffering most of the day trying to write my own renderer features, but then I found out that everything I want to do is actually way easier in the current version of unity than all the old tutorials I was using. You can just make a shader that runs on the finished image when a camera finishes rendering.

If found a tutorial for this outline shader that takes the difference between the depth of a pixel and the depth of the surrounding pixels, which gives you an outline. I made a second camera that's parented to the main camera that uses a separate renderer asset with the new shader on it (set to a specific outlines layer), then hooked that up to a texture that I load onto the main camera through another shader on the main renderer asset when the game starts.

Here are those shaders, the outline and the texture overlay. Thanks to Game Dev Guide and this video or the outline shader, although the rest of the video uses the old bad built-in Unity renderer.

Previous Next