Skip to content

Commit

Permalink
Fix "transmission without refraction" logic (#1742)
Browse files Browse the repository at this point in the history
* Change possible 0^0 = 1 to 0^eps = 0

* different solution

* change pDiffuse to ray.color.w
  • Loading branch information
JustinTimeCuber authored Jul 30, 2024
1 parent fa07b4d commit d53e532
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public static boolean pathTrace(Scene scene, Ray ray, WorkerState state,
airDistance = ray.distance;
}

if (pDiffuse + pSpecular < Ray.EPSILON && n1 == n2) {
if (ray.color.w + pSpecular < Ray.EPSILON && n1 == n2) {
// Transmission without refraction.
// This can happen when the ray passes through a transparent
// material into another. It can also happen for example
Expand Down

0 comments on commit d53e532

Please sign in to comment.