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