Thanks.
I *think* it is working, although the gradient texture needs to be the same size as the atlas? If I have lots of small sprites in an Atlas, lets say 1024x1024, and a gradient texture that is only 100x100, when using this modification to the shader, it only works for sprites on the atlas in the first 100x100 of the atlas image. Is this because of the vertex position used for the gradient?
ideally you want to use the vertex pos from the atlas for the base sprite, but on the gradient texture starting at 0,0 rather than the atlas position.
Any idea how to fix that? Many thanks