![]() ![]() ![]() values are the same), projected onto the 2D plane.Īs two cones intersect, one cone passes over the other, i.e. ![]() The separation lines between centroids thereby correspond to lines where the two centroids’ cones intersect (i.e. If we picture a 3D plot where we plot the distance to the origin on the z-Axis for each position (x,y), we get a cone. This is because positions on the boundary between two regions are equally far away from both centroids, or the value of the distance function to both centroids is equal. The line between any two regions is the perpendicular bisector of their centroids’ connecting line. The diagram is thereby essentially a clustering / labeling of pixels to centroids by a distance function. The diagram is an image where each pixel is colored by the index i of whatever centroid is nearest. Voronoi DiagramsĪ voronoi diagram is uniquely defined by a set of N points (“centroids”) in some space (in our case: 2D). The voronoi diagram corresponds to a large cluster of bubbles, which act as a lens. Voronoi based foam image filter in real-time. In this article, I will explain the general concept, implementation and some potential applications of real-time voronoi texture generation. In fact, it was so performant that generating voronoi diagramsĪt over 60 FPS, for upwards of 2^16 nodes and an image of size 1024×1024 (with limitations!). I was positively surprised that it was very performant. modern OpenGL) and implementation in C++ / general optimization. Note: Key changes are a point distribution assumption for performance, a different approach to depth testing, dynamic centroid capabilities due to new OpenGL features (i.e. It turns out this idea was not entirely new, but my idea is slightly different ( and faster!), so I decided to implement it (using my TinyEngine) to see how performant it was. The idea is to utilize an OpenGL depth test to perform conical intersections by writing the distance-to-centroid to the depth buffer in the fragment shader, with an instanced render. The other day I had an idea for how one can leverage the power of the GPU to generate voronoi textures. Note: The code for this article is available on my Github. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |