Custom Depth and Multiple Outlines
Well, the colorful outline shader for SPARM definitely got a bit larger than I thought it would. I am very happy I was working on it at the same time I was working on 2ON2. I could take parts (like the outlines section) and copy paste them. The general ideas are the same though. The big difference is the area that I mentally call "The Lerp Factory" (seen below). In reality, it is a bitmask using custom stencil. Through changing the number of the custom depth, I can dynamically change the color of the outline. This was necessary for a game like SPARM where you need visual indication of what plants you have claimed, yet others can take back control immediately. It definitely saved our coders a lot of extra effort. To do this, I essentially create lerps (linear interpolations) that lead into other lerps. Depending on which number the custom depth is set at, it chooses the color for the player and applies that to the outline of the object.
A sneak peek into how I created the outlines. The blur node actually has the offsets ready to go so to save space I just used that to branch off of.