Ray tracer in plain Javascript