The source code is here.

TODO: Reread and explain how the GLSL code works. It involves a quadratic equation for intersection with the ground, making sure the voxels don’t fall through it and a height map texture lookup. Also a rotation matrix to make the exploding voxels spin. Plus normals and lighting.

Here is a screenshot: screenshot

Watch the live demo here.