Can anyone point me in the right direction for making a shader that renders the object with an outline, just like in the Unity Editor Scene View?`
I’ve played around quite a bit with the ShaderGraph, but haven’t been able to reproduce it. I’m starting to think it might not even be possible via a ShaderGraph shader… Hope someone can prove me wrong!
It is not possible. This style of outline requires the use of render textures, custom scripting, and multiple shader passes at different times and used in different ways, and most of the time not rendering the model in question.
Unity’s Shader Graph makes one pass shaders that can be used on a model placed in the scene, and that’s it. There’s a lot you can do with that one pass, but this specific effect is not one of them.
Options for doing outlines in Shader Graph are currently limited to fresnel style effects.
More to the point it will never be something possible with Shader Graph alone, even if they do eventually add support for writing post processing shaders using it. This kind of effect will always require some amount of scripting to accomplish.
I know that wouldn’t be possible in Unity right now, but my point is that what’s possible without scripting is largely a matter of what nice features Unity includes in their tools and/or render pipelines.
Unreal has a lot of abstraction and data oriented systems. In effect you’re still doing a form of programming by creating objects and assigning values that is generating code behind the scenes. That tutorial also seems to gloss over a ton of stuff that is absolutely being done in blueprints in the example videos that they’re not covering at all.
Just looking over the first page, that’s creating a new render texture, rendering to said render texture using a stencil value, extracting that stencil value to an R8 render texture, then passing that texture onto the shader. Most of that is being done “automagically”, but you are in effect still doing some scripting to get it.
Also my point stands that this is not something you can do with Shader Graph alone. You’ll need to do some scripting, whether it’s in the form of actual C# code as it is now, or some sort of future node based scripting system ala blueprints, or via automagical systems like that custom pass system Unreal has. It’ll still take more steps. Indeed, Unity’s own Custom Render Pass feature might be able to accomplish something pretty close to the workflow of that Unreal tutorial.