Jump to content

Jump flooding algorithm

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by The Anome (talk | contribs) at 11:56, 19 August 2021 (not the JFA per se). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

The jump flooding algorithm (JFA) is a flooding algorithm used in the construction of voronoi diagrams and distance transforms. The JFA was introduced at an ACM symposium in 2006.[1]

The JFA has desireable attributes in GPU computation, notably constant-time performance. However, it does not always compute the correct result for every pixel, although in practice errors are few and the magnitude of errors is generally small.[1]

Implementation

The JFA original formulation is simple to implement.

Take an grid[2] (like an image or texture). All pixels will start with an "undefined" color unless it is a uniquely-colored "seed" pixel. As the JFA progresses, each undefined pixel will be filled with a color corresponding to that of a seed pixel's.

For each step size , run one iteration of the JFA:

Iterate over every pixel at .
For each neighbor at where :
if is undefined and is colored, change 's color to 's[3]
if is colored and is colored, if where and are the seed pixels for and , respectively, then change 's color to 's.[4]

The JFA finishes after evaluating the last pixel in the last step size. Regardless of the content of the initial data, the innermost loop runs a total of times over each pixel, for an overall computational complexity of

Uses

The jump flooding algorithm and its variants may be used for calculating Voronoi maps[1][5] point-cloud rendering,[6] feature matching,[7] volume rendering, soft shadow rendering[8] and generating distance fields.[9] The grand strategy game developer Paradox Interactive uses the JFA to render borders between countries and provinces[10]

Further developments

The JFA has inspired the developement of numerous similar algorithms. Some have well-defined error properties which make them useful for scientific computing.[11]

References

  1. ^ a b c Rong, Guodong; Tan, Tiow-Seng (2006-03-14). "Jump flooding in GPU with applications to Voronoi diagram and distance transform" (PDF). Proceedings of the 2006 symposium on Interactive 3D graphics and games. I3D '06. Redwood City, California: Association for Computing Machinery: 109–116. doi:10.1145/1111411.1111431. ISBN 978-1-59593-295-2.
  2. ^ The original paper uses the optimal case, a square grid, as an example, but a grid of any size works. Albeit with reduced efficiency. See this StackOverflow question for more.
  3. ^ Note that pixels may change color more than once in each step
  4. ^ Note that the JFA does not specify a method for resolving cases where distances are equal, therefore the last-checked pixel's color is used above
  5. ^ Rong, Guodong; Tan, Tiow-Seng (July 2007). "Variants of Jump Flooding Algorithm for Computing Discrete Voronoi Diagrams". 4th International Symposium on Voronoi Diagrams in Science and Engineering (ISVD 2007): 176–181. doi:10.1109/ISVD.2007.41.
  6. ^ Farias, Renato (2014). "POINT CLOUD RENDERING USING JUMP FLOODING" (PDF).{{cite web}}: CS1 maint: url-status (link)
  7. ^ Yu, Pei; Yang, Xiaokang; Chen, Li (2012). Zhang, Wenjun; Yang, Xiaokang; Xu, Zhixiang; An, Ping; Liu, Qizhen; Lu, Yue (eds.). "Parallel-Friendly Patch Match Based on Jump Flooding". Advances on Digital Television and Wireless Multimedia Communications. Communications in Computer and Information Science. Berlin, Heidelberg: Springer: 15–21. doi:10.1007/978-3-642-34595-1_3. ISBN 978-3-642-34595-1.
  8. ^ Rong, Guodong; Tan, Tiow-Seng (2006-11-01). "Utilizing jump flooding in image-based soft shadows". Proceedings of the ACM symposium on Virtual reality software and technology. VRST '06. Limassol, Cyprus: Association for Computing Machinery: 173–180. doi:10.1145/1180495.1180531. ISBN 978-1-59593-321-8.
  9. ^ Golus, Ben (2021-04-01). "The Quest for Very Wide Outlines". Medium. Retrieved 2021-08-19.
  10. ^ Boczula, Bartosz; Eriksson, Daniel (2020). "Optimized Gradient Border Rendering in Imperator: Rome". Intel. Retrieved 2021-03-28.{{cite web}}: CS1 maint: url-status (link)
  11. ^ Schneider, Jens; Kraus, Martin; Westermann, Rüdiger (2010). Ranchordas, AlpeshKumar; Pereira, João Madeiras; Araújo, Hélder J.; Tavares, João Manuel R. S. (eds.). "GPU-Based Euclidean Distance Transforms and Their Application to Volume Rendering". Computer Vision, Imaging and Computer Graphics. Theory and Applications. Communications in Computer and Information Science. Berlin, Heidelberg: Springer: 215–228. doi:10.1007/978-3-642-11840-1_16. ISBN 978-3-642-11840-1.

As of this edit, this article uses content from "Is Jump Flood Algorithm Separable?", authored by alan-wolfe, trichoplax at Stack Exchange, which is licensed in a way that permits reuse under the Creative Commons Attribution-ShareAlike 3.0 Unported License, but not under the GFDL. All relevant terms must be followed.