ChameleonRT
ChameleonRT copied to clipboard
Total internal reflections appear black
With the current Disney BRDF implementation, invalid refractions are terminated.
https://github.com/Twinklebear/ChameleonRT/blob/19f0c0949e555866c01d5ec0d0fd32ff4e2209ab/optix/disney_bsdf.h#L421
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.
Some before vs after:


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