Principled shader clearcoat roughness inconsistent change from 0.0177 to 0.0178. #53038

Closed
opened 2017-10-09 20:03:50 +02:00 by James Russell · 14 comments

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 = 5bd8ac9abf

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).
clearcoat_rough_bug.png

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:
cleacoat_rough_bug.blend

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

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). ![clearcoat_rough_bug.png](https://archive.blender.org/developer/F993096/clearcoat_rough_bug.png) 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: [cleacoat_rough_bug.blend](https://archive.blender.org/developer/F993108/cleacoat_rough_bug.blend) Any questions, I'll respond as quickly as I can.
Author

Changed status to: 'Open'

Changed status to: 'Open'
Author

Added subscriber: @JamesRussell

Added subscriber: @JamesRussell
Brecht Van Lommel self-assigned this 2017-10-09 21:15:37 +02:00

Added subscriber: @PascalSchon

Added subscriber: @PascalSchon

@PascalSchon, 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.

@PascalSchon, 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.
Member

@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.

@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.
Member

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.

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.

Right, the fixed 0.25 roughness is definitely a hack, hopefully we can get rid of that too.
Brecht Van Lommel was unassigned by Dalai Felinto 2019-12-23 16:36:27 +01:00

Added subscriber: @brecht

Added subscriber: @brecht

Added subscriber: @TomasCJ

Added subscriber: @TomasCJ

The issue still exists in version 3.3. It's a shame because it impedes glossy clearcoats, as the 0.0178 rougness is quite high. The issue can be "hacked" by reducing the clearcoat value itself, getting less roughness, but then it messes up the clearcoat normal.

The issue still exists in version 3.3. It's a shame because it impedes glossy clearcoats, as the 0.0178 rougness is quite high. The issue can be "hacked" by reducing the clearcoat value itself, getting less roughness, but then it messes up the clearcoat normal.
Philipp Oeser removed the
Interest
Render & Cycles
label 2023-02-09 13:59:02 +01:00

This is solved in 4.0 with the updated Principled BSDF.

This is solved in 4.0 with the updated Principled BSDF.
Brecht Van Lommel added
Status
Resolved
and removed
Status
Confirmed
labels 2023-10-30 18:06:17 +01:00
Blender Bot added
Status
Archived
and removed
Status
Resolved
labels 2023-10-30 18:07:08 +01:00

In 4.0, the clearcoat roughness still exhibits a sudden drop to 0 when it's lower than ~0.026, impeding using roughness values in that range (very glossy but not perfectly so)

In 4.0, the clearcoat roughness still exhibits a sudden drop to 0 when it's lower than ~0.026, impeding using roughness values in that range (very glossy but not perfectly so)

@TomasCJ can you report that as its own bug? It's a different issue than what this bug report was about, even if similar.

@TomasCJ can you report that as its own bug? It's a different issue than what this bug report was about, even if similar.

Reported, thanks! #114940

Reported, thanks! https://projects.blender.org/blender/blender/issues/114940
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Asset Browser Project
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
5 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#53038
No description provided.