From 8e77662b33424deb9806c1efb061759c886646b6 Mon Sep 17 00:00:00 2001 From: jbb01 <32650546+jbb01@users.noreply.github.com> Date: Sat, 3 Aug 2024 02:54:15 +0200 Subject: [PATCH] fix "shadow acne" --- src/main/java/eu/jonahbauer/raytracing/render/Camera.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/eu/jonahbauer/raytracing/render/Camera.java b/src/main/java/eu/jonahbauer/raytracing/render/Camera.java index 71070f7..f8a997d 100644 --- a/src/main/java/eu/jonahbauer/raytracing/render/Camera.java +++ b/src/main/java/eu/jonahbauer/raytracing/render/Camera.java @@ -130,7 +130,7 @@ public final class Camera { private @NotNull Color getColor(@NotNull Scene scene, @NotNull Ray ray, int depth) { if (depth <= 0) return Color.BLACK; - var optional = scene.hit(ray, Range.NON_NEGATIVE); + var optional = scene.hit(ray, new Range(0.001, Double.POSITIVE_INFINITY)); if (optional.isPresent()) { var result = optional.get();