Pathtracing on HTML5 Canvas