Principled shader clearcoat roughness inconsistent change from 0.0177 to 0.0178.
Open, ConfirmedPublic

Description

CPU: AMD 860K
RAM: 8GB
GFX: nVidia 960 GTX, 4 GB
OS: Xubuntu 16.04
Drivers: 375.82 from nvidia-375 (open source), installed from "Additional Drivers" section of settings window.
Blender: 2.79 2017-09-11 10:43, Hash = 5bd8ac9abfa

On the left, the plane has a principled shader. It only has a clear coat on it. No SSS, diffuse is RGB 0,0,0, no sheen, and no normal/bump mapping. The "Clearcoat Roughness" setting is at 0.0177 (and of course displays it at 0.018 unless you click on it).

However, the right plane is exactly the same, except the "Clearcoat Roughness" setting is at 0.0178, 0.0001 more. As you can see in the above picture, it's completely different, not just slightly different.

Here is the blend file:

Any questions, I'll respond as quickly as I can.

Brecht Van Lommel (brecht) triaged this task as Confirmed priority.Oct 9 2017, 9:15 PM
Brecht Van Lommel (brecht) claimed this task.

@Pascal Schön (VanCantus), the root of the issue here seems tricky to solve.

The clearcoat BSDF importance samples a microfacet normal for the GGX distribution, but computes the pdf as if it sampled from the GTR1 distribution. This then breaks multiple importance sampling, and just generally means our clearcoat results are quite broken.

There's a few possible solutions:

  1. Implement importance sampling of the GTR1 distribution. I don't think there's a known method that is nearly as good as GGX visible normals sampling however.
  2. Keep doing GGX importance sampling, and correct the pdf to match. This mismatch will result in too much noise.
  3. Switch to GGX for the clearcoat.

I think both 1) and 2) will increase noise too much. I'm tempted to go with 3), it's not actually clear to me that Unity / Unreal / Substance are even using GTR1 or that the subtle difference is worth it.

@Brecht Van Lommel (brecht), yes, I see this like you do. I don't think that we get a real benefit out of the GTR1 distribution. The difference (especially because clearcoat is only applied with a pre-factor of 0.25) should be pretty low and can thus be neglected. For me it seems ok to switch to GGX, but I will at first try to compare both versions today before adding a patch.

Maybe also the fixed roughness of 0.25 for the G term can cause some issues. Disney didn't really say in their paper from 2012 what the purpose of this hack was, but only that it's "found to be plausible and artistically pleasing". I will try at first to change only the D term to GGX without changing the G term (which means keeping the 0.25 roughness here) and look if this causes more problems and if so, I think we should go with having a consistent roughness throughout the whole clearcoat calculation. By doing so, we wouldn't need to have a distinction between clearcoat and non-clearcoat in the Microfacet BSDF evaluation (except for the sample weight) anymore.

Right, the fixed 0.25 roughness is definitely a hack, hopefully we can get rid of that too.