Total internal reflections appear black
natevm opened this issue · 3 comments
With the current Disney BRDF implementation, invalid refractions are terminated.
ChameleonRT/optix/disney_bsdf.h
Line 421 in 19f0c09
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.
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.
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