mmp / pbrt-v3

Source code for pbrt, the renderer described in the third edition of "Physically Based Rendering: From Theory To Implementation", by Matt Pharr, Wenzel Jakob, and Greg Humphreys.
http://pbrt.org
BSD 2-Clause "Simplified" License
4.87k stars 1.18k forks source link

Plastic material - indices of refraction swapped #210

Open serhii-rieznik opened 5 years ago

serhii-rieznik commented 5 years ago

Looks like there is a typo in the source code of the plastic material. Indices of refraction for the FresnelDielectric are swapped. The books says: Fresnel *fresnel = ARENA_ALLOC(arena, FresnelDielectric)(1.f, 1.5f);

While actual code is: Fresnel *fresnel = ARENA_ALLOC(arena, FresnelDielectric)(1.5f, 1.f);

Rest of materials (glass, uber, etc) follows book: Fresnel *fresnel = ARENA_ALLOC(arena, FresnelDielectric)(1.f, eta);

mmp commented 4 years ago

Nice find--thanks. I think it's best to leave this unfixed for now, since changing it will change rendered images (and I suspect that many scenes have had a ReverseOrientation added to them to counter this bug. We'll fix this properly in the next version...