Hacker News new | ask | show | jobs
by ewencp 3719 days ago
It's not particularly efficient, but probably the easiest way to draw Voronoi diagrams on the GPU doesn't require a shader at all. Instead, use an orthographic projection and draw cones for each vertex with the cone's apex at the vertex and its axis oriented into the screen. Then the GPU's z-buffer takes care of choosing which vertex is closes to the given pixel.
2 comments

Yeah! It's a pretty big omission in my post that I don't talk about other methods of generating Voronoi diagrams, but I wanted to keep it relatively short.

Chris Wellons has a great article on the method that you mention: http://nullprogram.com/blog/2014/06/01/

It's also mentioned in the OpenGL red book: http://www.glprogramming.com/red/chapter14.html#name19

Yes, this is similar to what I and others described! Underneath, similar stuff going on in the HW :)