Pokemon transition shader in NME

This was something I worked on quite a while ago, but I think I should share it. I was originally inspired by this quite old now video.

Here is that effect in Babylonjs using the NME

(Change the “Cutoff” slider to see it in action)

Essentially, what’s happening here is that I take a 2-D texture which is a black-and-white gradient and then use that as a cut off value for a full screen fragment shader.
The example, I gave is just a basic horizontal black to white shadow, but you can you shaders in any configuration and get some pretty neat results.

Here’s one I made with a more interesting texture https://nme.babylonjs.com/#9W00N4#1

This code never made it into production, so please feel free to make any optimisations you can, as I am still quite new with the node material editor.