Shaders Case Study: Pokémon Battle Transitions - Part II

1 · Guilherme Simoes · Nov. 15, 2020, 2:39 a.m.
In part 1 I created various transitions using different fragment shaders. These shaders used geometry formulas to calculate when each pixel should be hidden. While this made it possible to create some very cool animations, the math got complicated quickly. A better strategy is to encode in a texture when each pixel should be cutoff. That way it’s no longer necessary to make any calculations. Basically instead of doing this: result = doMathWith(pixelCoordinates) if result < cutoff paintBlack el...