This page looks best with JavaScript enabled

Adding an Accent to our Contrast Shader - Lets Make a Side Scrolling Shooter - Part 4

 ·   ·  ☕ 1 min read

Lets spice up our our contrasting transition shader with an accent color that more clearly marks the border between one color and the next.

Part 1 of building this contrasting shader is here:

Most of the magic of this shader happens in these lines which select the color we want to draw:

float maskPrimary = (_Transition + barrierSize [LESS THAN] maskStrength);
float maskSecondary = (_Transition - barrierSize [GREATER THAN] maskStrength);
float maskAccent = !(maskPrimary || maskSecondary);
o.Albedo = maskPrimary * _PrimaryColor
  + maskSecondary * _SecondaryColor
  + maskAccent * _AccentColor;

Come join the World of Zero Discord channel to talk software, game development and more:

Sam Wronski
Sam Wronski
Maker of things, currently helping build cloud things @ Google. World of Zero is a personal project disconnected from my professional work. Lets make something awesome together!