Fix shadow acne

This commit is contained in:
Phireh 2021-08-21 22:28:48 +02:00
commit f252823b4b

View file

@ -19,7 +19,7 @@ color ray_color(const ray& r, const hittable& world, int32_t depth)
} }
hit_record rec; hit_record rec;
if (world.hit(r, 0, INFINITY, rec)) if (world.hit(r, 0.001, INFINITY, rec))
{ {
point3 target = rec.p + rec.normal + random_in_unit_sphere(); point3 target = rec.p + rec.normal + random_in_unit_sphere();
return 0.5 * ray_color(ray(rec.p, target - rec.p), world, depth-1); return 0.5 * ray_color(ray(rec.p, target - rec.p), world, depth-1);