Javascript Ray Marcher v0.10

This version features bounding boxes and diagnostic output. Throughout the project, I've been doing minor optimisations to keep the speed of a render below 20mins on my machine. In general, if the render took longer than that, I would get bored waiting and improve the code a little bit. But it has been increasingly hard to optimise the program, as I have removed all the obvious inefficiencies. Now I have added a diagnostic window to show me which parts of the render are taking the longest.

So now I have added a bounding box system. Bounding boxes are simpler objects that loosely fit around the scene objects. I only check a collision between the ray and the real object, if the ray intersects the bounding box. So now the render is effectively testing a list of boxes, rather than the fractals or whatever I am actually rendering.

The left window is the render output, the middle window is the time taken to render each pixel, and the third window is the "normal shading" window. We haven't seen normal shading since version 2. It's a very handy view to have, because it shows us the scene without lighting or shading.

Under the hood, there have been some large refactorings. The biggest being that all the config options and scene objects have been pulled into one data structure, which will soon allow us to save and reload scenes. It also provides a central point for debugging, as I don't have to hunt through the code for the place where I set a certain option.

I've added Javascript objects to hold the scene objects. Now all the properties for the objects are in the same place, and adding new ones is much easier. It also uses object polymorphism, so the render routine now simply calls object.in(x,y,z). If the answer is true, we have a hit and the renderer can then call object.colour().