Help with 'reveal' shader
Posted: Mon Mar 25, 2019 9:15 pm
Hi folks,
I'm trying to figure out how to achieve an effect and I'm hoping someone can give me some pointers.
Let's say I have a sprite on the UI that is a horizontal black line (image). I want its alpha to be 0 to start with so it's completely transparent and then over time, set it to reveal the line from left to right, as if the line is being drawn on screen. I thought it would be simple but I'm struggling: I had a look at alpha masks and how to do that but I don't think that's going to help me? Is there a way to set the alpha of an image / sprite on a per pixel basis, or some other method I'm not aware of that will achieve what I'm looking for?
Many thanks for any pointers you can offer.
Regards,
M
I'm trying to figure out how to achieve an effect and I'm hoping someone can give me some pointers.
Let's say I have a sprite on the UI that is a horizontal black line (image). I want its alpha to be 0 to start with so it's completely transparent and then over time, set it to reveal the line from left to right, as if the line is being drawn on screen. I thought it would be simple but I'm struggling: I had a look at alpha masks and how to do that but I don't think that's going to help me? Is there a way to set the alpha of an image / sprite on a per pixel basis, or some other method I'm not aware of that will achieve what I'm looking for?
Many thanks for any pointers you can offer.
Regards,
M