Calculating RenderTexture fill percentage with masks

Hi there!

There is this scratch example.
What I’d like to achieve is to tell what percentage of the masked shape is already scratched off at any given time.
How could I do this? What kind of data do I have here to work with?

Thank you for your answers in advance!

:wave:

You can do this with a CanvasTexture. I would copy and scale it to a second texture and count that because the counting takes a while.

If you look at RenderTexture#snapshot you can probably copy that to a canvas as well.