message: Improve precision of sphere intersection, closes
diff: @@ -149,7 +149,10 @@ void Spheres_intersect(uniform Spheres *uniform self,
  }
  uniform vec3f center =
  *((uniform vec3f*uniform)(spherePtr+self->offset_center));
  - const vec3f A = center - ray.org;
  + const vec3f At = center - ray.org;
  + const float close_d = dot(ray.dir, At) - radius;
  + const vec3f close_org = ray.org + ray.dir * close_d;
  + const vec3f A = center - close_org;
  const float a = dot(ray.dir,ray.dir);
  const float b = 2.f*dot(ray.dir,A);
  @@ -160,8 +163,8 @@ void Spheres_intersect(uniform Spheres *uniform self,
  const float srad = sqrt(radical);
  - const float t_in = (b - srad) *rcpf(2.f*a);
  - const float t_out= (b + srad) *rcpf(2.f*a);
  + const float t_in = (b - srad) *rcpf(2.f*a) + close_d;
  + const float t_out= (b + srad) *rcpf(2.f*a) + close_d;
  bool hit = false;
  if (t_in > ray.t0 && t_in < ray.t) {
  