You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 14, 2022. It is now read-only.
Describe the solution you'd like
Use a stack to store the current mediums we’ve entered, then when we enter a medium, use the value at the top of the stack as the current medium, and the hit medium for refraction calcs, then push the hit medium to the stack.
When we exit a medium, pop from the stack (ie the medium we’re exiting), use the hit medium as the current medium (hit will be a backface of the thing we’re inside for exiting), and the new top of the stack as the medium we’re entering.
The only problem with this is that it assumes we start in whatever our default medium is (for most cases this will be air, or more likely vacuum), even if the camera is placed inside another medium in the scene, however allowing the user to set the default medium would mitigate this issue for most use cases, for instance an underwater render.
The text was updated successfully, but these errors were encountered:
Describe the solution you'd like
Use a stack to store the current mediums we’ve entered, then when we enter a medium, use the value at the top of the stack as the current medium, and the hit medium for refraction calcs, then push the hit medium to the stack.
When we exit a medium, pop from the stack (ie the medium we’re exiting), use the hit medium as the current medium (hit will be a backface of the thing we’re inside for exiting), and the new top of the stack as the medium we’re entering.
The only problem with this is that it assumes we start in whatever our default medium is (for most cases this will be air, or more likely vacuum), even if the camera is placed inside another medium in the scene, however allowing the user to set the default medium would mitigate this issue for most use cases, for instance an underwater render.
The text was updated successfully, but these errors were encountered: