Note that it is using canvas 2d rather than canvas 3d (aka WebGL[1]).
But if you take ray casting to extreme, you end up with Ray Tracing[2], which is kinda expensive. Which is why we had such an effusive conversation a few months ago about hardware accelerated RayTracing[3].
A sample ray traced scene from AlteredQualia[4] (2nd largest[5] contributor to the famous Three.js Library): http://alteredqualia.com/three/examples/raytracer_sandbox_re...
[1] https://developer.mozilla.org/en-US/docs/Web/WebGL/Getting_s...
[2] http://en.wikipedia.org/wiki/Ray_tracing_%28graphics%29
[3] https://news.ycombinator.com/item?id=7425303
Just compare with this pure fragment shader demo: https://www.shadertoy.com/view/MsS3W3