Skip to content
This repository has been archived by the owner on Jul 14, 2022. It is now read-only.

[feature] Nested transparent objects #2

Open
Derpius opened this issue Jul 4, 2021 · 0 comments
Open

[feature] Nested transparent objects #2

Derpius opened this issue Jul 4, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@Derpius
Copy link
Owner

Derpius commented Jul 4, 2021

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.

@Derpius Derpius added the enhancement New feature or request label Jul 4, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant