Filling in Metal

2019-09-01 07:52发布

问题:

I am new to Metal. I am trying to create a tool like fill bucket for shape in Metal. I am having a texture as below. Only the lines are not transparent. other places of this texture image is transparent.

If the user taps inside the shape shape needs to be coloured. If outside is clicked I want to colour outside the shapes fully.

In metal kernel function I can pass the texture. But in Kernel Function is it possible to do the thread position from the touchpoint thread.Please suggest a way to perform the thread from touchpoint to towards outside