So here’s a small thing that may help some folks out. Ages ago, while researching how Photoshop blend modes work behind the scenes, I stumbled across this fantastic demo on Shadertoy and have kept it bookmarked since. Recently, I wanted to do some overlay blending in Unity, so went back to the Shadertoy example and did a quick port to the .cginc file below: [crayon-5d7e15ddce6fb061229830/] Usage should be fairly self explanatory, but here’s a quick Overlay shader example: [crayon-5d7e15ddce711957101444/] Using these two images (which I just happened to find in my Dropbox directory so I’m claiming ownership) can produce all the effects in the picture at the top of this page (left-to-right top-to-bottom: Add, ColorBurn, ColorDodge, DarkerColor, Difference, Divide, Exclusion, HardLight, HardMix, Lighten, LighterColor, LinearBurn, LinearDodge, LinearLight, Overlay, PinLight, Screen, SoftLight, Subtract, and VividLight). I left off the blends Hue, Color, Saturation, and Luminosity simply because they were a little more expensive and I wasn’t interested at the time. Feel free to add them back in – easy enough to do. Enjoy. Edit: Just for the sake of completion, I’ve added the Hue, Color, Saturation, and Luminosity blend modes. Keep in mind, to simplify usage of these, you may […]
Read More