the main graph combines all the sub graph together to complete the effect, the final touch i added to this effect is the outline shader. that uses another custom node to run a sobel algorithm sampling the camera depth texture and normal, but instead of applying it as a post processing effect its applied as a per object effect. The reason is because Shard Master is a 2.5D game. Where the Creatures are sprites and they already have outlines baked in to the texture it self. we only wanted the 3D objects in the environment to have the outline.


the outline is generated by running the sobel algorithm attached to the custom node, then lerping the results with the original texture and a color to achieve the final effect. The sobel function is adapted from unity’s devlog.

the results are as seem above, the outline works fine for the most part, there some artifact issues in this current implementation of the outline shader, it appears to work better on rounded surfaces than the complex mesh of the level this issues becomes apparent when the camera is at certain angles and zoom levels, for Shard Master it is not much of a problem since the camera is fixed in the scene. I will do more research for a solution to this problem when i have more time.
References: