Replies: 1 comment
-
I answered my own question after I found a super silly bug in my code. Turns out if your interval UNIVERSE is (0, Inf), you'll never get the first root with a negative t value. It all makes sense now. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm having trouble understanding the logic around the Hit method for constant_medium. If the radius of the big, mist sphere is large enough, the sphere encloses the camera. The first ray that leaves the camera will hit the sphere with a big t value, and it will record a hit that turns the outward_normal negative (as the ray is hitting the interior of the sphere). The next hit with rec1.t + delta will be just outside the sphere and return false.
In my code, when the radius of the big mist sphere is just under the distance to the camera, I get a mist. If I add one to that radius (so the camera is now inside the sphere), I get no mist at all.
Why don't we need to turn the direction of the ray around when looking at the boundary hit from the interior?
I'm not sure what I'm missing. Why would the rec1.t + delta ray be expected to hit the sphere again when the original ray comes from within??
Thanks for any help!!
Beta Was this translation helpful? Give feedback.
All reactions