Consecutive recolor/dissolve shader

Hello all!
Have a question regarding consecutive recolor/dissolve (please check the gif). Interested in what approach should i take to make it work for any direction (only consecutive part). Also would be grateful to know how to use this not per screen pixel, but in game pixel resolution (to work with pixel sprites).
Thanks!
4971215--484244--consecutive.gif

Assuming this is a single sprite, then you’d need to author a gradient texture that has the “animation” baked into it. The most common example of this technique would be for something like a circular progress bar shader, where you use a radial gradient. Most examples use an alpha test shader and animate the cutoff, but you could also do it in a single shader where you lerp between two color values based on the texture and that “cutoff”.

If this is multiple sprites, then you’d have to have each one have it’s own gradient to match the shape, and then figure out the timing offsets yourself.

thanks! yeah, i use alpha/gradient values, thought about the way how i can make it dynamic (so i can approach it from different directions and still save this consecutive feel, don’t know maybe reverse/modify the alpha condition depending on it).

If you want to make that fill happen from different directions, you could save that gradient data to channels of another image. Then you could pack 4 variants to one image (rgba)? Your example image could be handled with one texture.