Tuesday, May 8, 2012

Diffuse Fresnel Reflectance

*** Update: After Anders left his comment suggesting that I might be using an inverted IOR, and that total internal reflectance could account for the unexpectedly high results, I looked into this again more carefully. It seems that my relative IOR is in the same form as the papers, but it turns out that I was indeed misinterpreting the meaning of Fdr, and that Fdr is actually the average reflectance of light incident to the inside of the surface of the subsurface scattering medium, not the outside as I had assumed. Previously, I had jumped to some conclusions without doing quite enough investigation and testing. This time I looked more carefully at the graphs of the relevant functions. Then I looked at the paper that the Fdr approximation originally comes from, Egan et al. 1973, which calls the value in question (the value denoted Fdr in the new sources) the "internal diffuse surface reflectance", which to me is a much more descriptive name than anything I saw in the new sources, all thanks to the word "internal". Egan et al. 1973 also gives a different formula for the "external diffuse surface reflectance" which is what I had thought Fdr was supposed to be! Had I looked at the Egan et al. 1973 paper before, the descriptive and accurate names might have instantly given away the issue I was having; sometimes a few well-chosen words can make a concept much more clear. Finally, after making sense of things, I ran more tests, comparing formula results to simulated values. This new interpretation of Fdr matches my simulation results much more closely over a much wider range of values. I haven't yet figured out how this new interpretation makes sense in context, but at least the Fdr and Fdt formulas make sense now. I'll post more details about this stuff once I look into it some more. ***

I've been working a lot on my multiple scattering approximation, and just yesterday, as I mentioned in the previous post, I solved a significant Fresnel-related issue, one which stems from what appears to be an error or oversight in multiple sources (unless I'm totally missing something).

First some context. The resources I've been referring to in implementing point-based diffusion-based multiple scattering, including the Jensen papers I've used and the PBR book, multiply each irradiance sample (or equivalently, the summed radiant exitance at the look-up point) by the diffuse Fresnel transmission to take Fresnel reflection into account. That much makes sense.

To do that, they provide approximations for the diffuse Fresnel reflectance (Fdr), i.e. the Fresnel reflectance integrated over the hemisphere, and then they take 1 Fdr to find the diffuse Fresnel transmittance Fdt. However, I've noticed that doing this makes objects appear unnaturally dark. A while back I checked Fdr for a number of different IORs and noticed that it seemed far too large (around 47% and 66% for water and glass respectively), but I didn't think much of it at the time. Then the other day I was watching a Richard Feynman video, and he mentioned that the total reflectance of water and glass are around 5% and 10% respectively, which got me thinking again. So today I computed an actual integral of Fresnel reflectance for various IORs (using Monte Carlo integration, and selecting samples from the cosine distribution), and got values similar to what Richard Feynman had mentioned.

Then it finally hit me, that Fdr is a hemispherical integral, so it's not the average Fresnel reflectance as I had assumed, but rather the average Fresnel reflectance times 2π, which I quickly confirmed. So you can't just subtract Fdr from 1 to get Fdt, as the papers and book do—you need to divide it by first!

And if instead, we were to subtract Fdr from 2π to find Fdt, then Fdt would be the average transmittance times 2π, so we couldn't just multiply that times the irradiance to find the transmitted fraction of the irradiance, as they do in the papers and book, because the irradiance is already an integral over the hemisphere. In most cases, we would actually increase the irradiance by doing that, which doesn't make any sense—we'd be creating energy out of nothing.

The term "reflectance" typically refers to the fraction of light reflected, expressed as a proportion between 0 and 1 (in photon terms it's literally a probability). From Wikipedia, reflectance (or reflectivity—the difference is subtle and is irrelevant in this case) is "commonly averaged over the reflected hemisphere to give the hemispherical spectral reflectivity". And the 2001 Jensen paper literally calls Fdr the "average diffuse Fresnel reflectance" which is incorrect and misleading.

I have noticed some other typos and ambiguities in the papers I've been referencing a lot, but I'm really not sure how or why this particular error was glossed over or neglected in multiple sources. It's a pretty significant error or oversight as far as I can tell. The papers provide explicit formulas for Fdr and the conversion to Fdt, but clearly never divide by 2π. And they say Fdr is the Fresnel reflectance integrated over the hemisphere, and show the integral for integrating over all 2π steradians of the hemisphere, but then they call Fdr the "reflectance", and treat it like it goes from 0 to 1. Pretty strange.

I hope this isn't coming across the wrong way—I definitely still think that these are excellent papers and an excellent book, even if these things turn out to be errors.

The papers also use Fdr in the boundary condition A in the diffusion approximation. Now I'm doubting now whether that instance should be left in terms of . I just realized that A could easily end up being negative if Fdr is left in terms of 2π.

In case this has held your interest this far and you're actually implementing this stuff yourself, it might also be worth mentioning here that you should clamp Fdr between 0 and 1 (unless you actually perform the integral, which you would actually only have to do once per material), because the approximation formulas blow up with high IORs.


  1. This is very interesting! I will dig into this. Though I'll keep following your postings here, if you can also send an email about anything like this in PBR that you think is wrong/broken. that'd be great!


  2. Perhaps you are just using the wrong eta? In those equations eta is defined as eta = eta_from/eta_to. So the reason you get 60% for 1.5 is that this is internal reflectance in a dense medium, which is high due to total internal reflection.