Having fun with overlay textures, dissolves, and holograms
For this final series of 2D shaders, we will examine useful yet easy-to-implement shader effects that can be directly applied in video games to show a specific state of a character or have it appear in an interesting way.
Namely, we will see how to overlay a texture on top of our sprite with various mixing operations, create a parametrized dissolve effect, and make our image look like a shiny hologram.
Showing an overlay texture
To start this series of advanced shaders, let’s do an easy one: a basic texture overlay with controllable parameters. This is typically something that is very quick to do with shaders in a game engine and pretty much impossible without them.
In short, the idea is simply to use some mix factors to blend the colors of our original sprite with the colors of a user-defined overlay texture in a dynamic and easy-to-tweak way. You might remember that we already talked about that sort of...