Closed kennyalive closed 4 years ago
One interesting observation. There are pbrt projects files for which we still get correct result when using FresnelDielectric(1.5f, 1.f). This happens because of another bug which cancels out the effect of IOR typo. For example, dragon ply model in f9-3.pbrt has normals with outside direction, still we we have ReverseOrientation flag specified which forces the normals to point inside. Because of this cosThetaI in FrDielectric function is negative in most cases. Then we have this code snippet which checks for negative values:
bool entering = cosThetaI > 0.f;
if (!entering) {
std::swap(etaI, etaT);
cosThetaI = std::abs(cosThetaI);
}
It swaps IORs assuming that we are inside the object and effectively we get FresnelDielectric(1.f, 1.5) fresnel configuration.
Yep. (See also #210...) However, I think it's best to not fix this at this late point, in the interests of not causing renderings to change for existing scenes...