I am currently searching for a fast way to compute a signed distance field in 2D. I can only think of the brute force method i.e. (pseudocode):
for each pixel in bitmap do closest = max number for each other pixel do dist = distance(pixel, other pixel) if dist < closest then closest = dist end end end
Are there any obious optimizations? Did anybody maybe try to do it on the GPU? I know that the game pixel junk shooter computes a distance field each frame for dynamic collision objects so there has to be a way to get this pretty fast. Every idea, papers, links welcome!