diff --git a/src/main/java/eu/jonahbauer/raytracing/render/Camera.java b/src/main/java/eu/jonahbauer/raytracing/render/Camera.java index f8a997d..27d4653 100644 --- a/src/main/java/eu/jonahbauer/raytracing/render/Camera.java +++ b/src/main/java/eu/jonahbauer/raytracing/render/Camera.java @@ -134,10 +134,7 @@ public final class Camera { if (optional.isPresent()) { var result = optional.get(); - var newDirection = Vec3.random(true); - if (result.normal().times(newDirection) < 0) { - newDirection = newDirection.times(-1); - } + var newDirection = result.normal().plus(Vec3.random(true)); var scattered = new Ray(result.position(), newDirection); return Color.lerp(Color.BLACK, getColor(scene, scattered, depth - 1), 0.5);