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.
Process: I tried to implement DisneyBSDF in Nori, but the parameters are so many and the details are hidden inside the 2 Siggraph course notes(2012 BRDF,2015 BSDF). So I looked into pbrt to get more details, found the bug in DisneyClearcoat and fixed it. This modified DisneyClearcoat passed the chi-squared test in Nori.
Explanation: The DisneyClearcoat BRDF should be basically the same as MircrofacetReflection except for GTR1 normal distribution and the not-that-physically-based smith G1 masking term (as described in section 5.6, on page 16, 2012 course note).
The first problem is that there are missing Jacobian matrix determinant (as described in [07 Walter et al.]). This involves changes in DisneyClearcoat::Pdf and DisneyClearcoat::f
As described in 5.6 section in 2012 course note, the fixed 0.25 roughness is only used in G1 term, but the original implementation uses this fixed 0.25 roughness to importance sample, which is not consistent with DisneyClearcoat::Pdf and DisneyClearcoat::f. This involves a change in DisneyClearcoat::Sample_f
Still as described in 2012 course note, the DisneyClearcoat goes from glossy to (delta) specular when clearcoatGloss goes from 0 to 1, which is opposite to the original roughness in standard Microfacet theory context. That's why the Lerp(gloss,1.0,.001) exits. Since it is used in more places(substituting the 0.25), I change the DisneyMaterial::ComputeScatteringFunctions to let it interpolate once instead of Lerp on the fly.
Suggestion: I also suggest that we change the fixed 0.25 alpha to gloss when calculating G1. The fixed 0.25 alpha prevents the DisneyClearcoat from passing the chi-squared test in grazing angle, although it would not be "Disney" BSDF.
BTW, I have another question about DisneyClearcoat posted on google group
Hi,
I think that I find the bug of DisneyClearcoat.
Process: I tried to implement DisneyBSDF in Nori, but the parameters are so many and the details are hidden inside the 2 Siggraph course notes(2012 BRDF,2015 BSDF). So I looked into pbrt to get more details, found the bug in DisneyClearcoat and fixed it. This modified DisneyClearcoat passed the chi-squared test in Nori.
Explanation: The DisneyClearcoat BRDF should be basically the same as MircrofacetReflection except for GTR1 normal distribution and the not-that-physically-based smith G1 masking term (as described in section 5.6, on page 16, 2012 course note).
The first problem is that there are missing Jacobian matrix determinant (as described in [07 Walter et al.]). This involves changes in
DisneyClearcoat::Pdf
andDisneyClearcoat::f
As described in 5.6 section in 2012 course note, the fixed 0.25 roughness is only used in G1 term, but the original implementation uses this fixed 0.25 roughness to importance sample, which is not consistent with
DisneyClearcoat::Pdf
andDisneyClearcoat::f
. This involves a change inDisneyClearcoat::Sample_f
Still as described in 2012 course note, the DisneyClearcoat goes from glossy to (delta) specular when
clearcoatGloss
goes from 0 to 1, which is opposite to the original roughness in standard Microfacet theory context. That's why theLerp(gloss,1.0,.001)
exits. Since it is used in more places(substituting the 0.25), I change theDisneyMaterial::ComputeScatteringFunctions
to let it interpolate once instead of Lerp on the fly.Suggestion: I also suggest that we change the fixed 0.25 alpha to
gloss
when calculating G1. The fixed 0.25 alpha prevents the DisneyClearcoat from passing the chi-squared test in grazing angle, although it would not be "Disney" BSDF.BTW, I have another question about DisneyClearcoat posted on google group
Thanks for your attention.
Zejian Wang