Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Total internal reflections appear black #3

Open
natevm opened this issue Jun 21, 2020 · 3 comments
Open

Total internal reflections appear black #3

natevm opened this issue Jun 21, 2020 · 3 comments

Comments

@natevm
Copy link
Collaborator

natevm commented Jun 21, 2020

With the current Disney BRDF implementation, invalid refractions are terminated.

if (all_zero(w_i)) {

However, I believe these events should instead be interpreted as reflections. I’ve found that by reflecting at invalid refractions, and by setting the pdf value to 1 instead of 0 and by returning a color of 1 instead of 0, this causes total internal reflection areas within my objects to become lit instead of just dark.

@natevm
Copy link
Collaborator Author

natevm commented Jun 21, 2020

Some before vs after:

1CDCC2AA-FD1F-488F-931A-9FB1C7A8AC65

7CDC564E-6FC4-4749-BB82-4614B57B3E08

@natevm
Copy link
Collaborator Author

natevm commented Jun 21, 2020

Note that for transmissive objects, there are a couple bugs I’ve found. This one should be a pretty easy fix though.

In the above images, I’ve hard coded the PDF associated with transmission to 1, and have also hard coded the transmissive BRDF to return the mat.base_color, without D, G, 1-F or c being multiplied. I’m not sure why, but none of these values seem to return plausible values. Once I figure those out, I can open some more issues.

@Twinklebear
Copy link
Owner

Interesting, I think I did at one point have it change to reflection for total internal refraction, but was getting some odd fireflies as a result. Maybe due to some other bugs in computing D, G, F, c that you've tweaked there

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants