But isn't this a GameMaker shader? for some reason Unity uses a slightly different naming than the standard GLSL.
Possibly, I haven't got my head around shaders so it's very much trial and error. But yeah, I'm using Game Maker, so any code snippets would work with that, can't be sure about others. But the idea should still work if adjusted to different engine.