samedi 15 février 2014

Mixing euclidean and manhattan distances in voronoi diagrams

This is just a little experiment on mixing euclidean and manhattan distance in Voronoi diagrams! More is to be done, especially eliminating aliasing on the edges..

vendredi 13 décembre 2013

Voronoi Diagrams using Manhattan Distance

To complete my previous post : here is an example of a Voronoi using a Manhattan distance instead of a Euclidean distance. Manhattan distance is the length of the path that you will use when walking along city blocks. 

jeudi 28 novembre 2013

A Fast Voronoi Diagram Sampler

Just a simple shader that shows how is it possible to render a Voronoi diagram quite easily. The trick is that we store control points in a grid. For a given pixel, I just need to test 9 points to find the closest one. This avoids a lot of computations. To see the underlying structure //#define DEBUG should be uncommented in the shader code.

 

This sampler can be used in an other shader code. Here we use it in a cube sampler which is used to render a pseudo voronoi skybox .

 

vendredi 15 novembre 2013

This is un updated version of my old simple sphere on Shader Toy. This one is fully ray-traced and used more physical lighting. The light can be moved by holding down left button and by moving the cursor on the frame

jeudi 10 octobre 2013

ShaderToy 2

After having a look at this great article on Fabien Sanglard's blog, I tried to implement the business card ray tracer. There is still room for improvement but it begins to look quite good. I added a little animation to show that it is real-time contrary the CPU which takes more or less 20 seconds per frame. Unfortunately, this shader seems to work only if webgl implementation is based on OpenGL (OSX, Android, Linux..).

   On Windows there is a problem when ANGLE unrolls the main loop and translates it to HLSL. I posted a more basic version of that shader which works on all platforms. Feel free to help me finding a correction ...




Without the noise :