Hello, I am working on a paint program and am implementing the TextureFloodFill extension with FloodFillBorder method available at http://wiki.unity3d.com/index.php?title=TextureFloodFill. The method works fine however I would like to modify it so that we can see the algorithm working, so that when an area is clicked, the paint slowly fills up the region starting from the point clicked until it gets to the edges, as in this animation: https://en.wikipedia.org/wiki/Flood_fill#/media/File:Wfm_floodfill_animation_queue.gif Is it possible to modify TextureFloodFill to achieve this effect, or is there another way I can do this? Thanks!
You would have to maybe keep a count of how many pixels you've filled, start over in each frame with no pixels filled, and fill up to that many pixels... then in the next frame do more pixels, until you're totally done. But flood fill algorithms usually don't just go `bottom up` they recurse, which may not be the effect you're after.
Thanks. Could you tell me exactly how I might modify the code just to see how this particular algorithm is working? I tried inserting the lines aTex.SetPixels(colors); aTex.Apply(); inside the while and for loops, hoping it would update the texture while progressing through the algorithm, however it did not work.