News for hackers. Stuff that matters.
Re:Voronoi Diagrams on the GPU by nraynaud on Thursday April 14, 2016 @04:16AM (#11495037)
well, if you're doing that, then just use the distance function, at least you've got a perfectly circular cone, and you don't get tricked by the maximum distance of the cone.

the complexity is num pixels*num entities.

implementation here: https://github.com/nraynaud/webgcode/blob/gh-pages/webapp/sh...

I would gladly show the result here: http://nraynaud.github.io/webgcode/various_tests/test_vorono... but it looks like Chrome removed PathSegList that the SVG library was using internally

edit: it still works in firefox, it extracts the voronoi diagram, the medial axis, then does a subtraction on the medial axis (internal offset of the original polygon), then a minimum threshold (mickey ears for pocketting in milling), then a reconstruction of the polygon from the altered medial axis.

Re:Voronoi Diagrams on the GPU by exDM69 on Thursday April 14, 2016 @06:25AM (#11495470)
Your pixel shader implementation is quite clean and simple. But the method I described doesn't rely on shaders at all, it uses the fixed function triangle rasterization and depth testing. It has different performance characteristics. That method is also of historical interest because it works (and is fast) also on pre-shader graphics accelerators.