-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add coat darkening and saturation effects #162
Add coat darkening and saturation effects #162
Conversation
…ughness dependence.
One aspect of the proposed formulas that I worry about is the effect of the base roughness on the darkening, i.e. Equation 61. This is designed so that a smooth base produces less darkening, basically blending between known formulas for the cases of a completely smooth and completely diffuse base. (See the discussion on Slack here, for background to that -- it is based on the Weta "The Path of Water" notes from SIGGRAPH 2023). I assumed that if the base is dielectric, the roughness of the reflection from it is determined by the Perhaps it's fine to still give these formulas merely as a convenient, reasonable approximation. |
Is this not addressed by the formula below?
I thought this was considering the diffuse component to have an effective roughness of |
This is looking really good to me at a high level but I would need to do another pass to verify some of the formulas by looking more closely and by looking at the referenced equations and citations. A lot of my comments are questions and clarifications that I could potentially answer myself based on a more careful reading, however I figured I would post them anyway in case they raise any important points and in case the text can be clarified to prevent other readers from initially having the same questions. |
…165) We need to explain that, although physically the glossy-diffuse slab (as described) should exhibit darkening/saturation due to the same physics as the coat darkening (i.e. multiple bounces inside the gloss layer losing energy as they hit the colored base), we want to prevent this so that the user sees -- to the extent possible -- the base color she selected. But she can't see the exact base color she selected, because the Fresnel of the gloss is superimposed on the diffuse base lobe. So we make the required color be a blend of the Fresnel and unsaturated base color (i.e. essentially the albedo-scaling formula). This is the same mechanism we used to define how the coat "un-darkening" works. Thus albedo-scaling automatically does the right thing (but if the implementation does something different, e.g. more physically correct, it is still well-defined what the goal albedo needs to be so the appearance won't break). Note this won't make any difference to implementations that already use the albedo-scaling approximation (e.g. Arnold, MaterialX). This will need to be tweaked once we get the coat darkening PR #162 in, as it should reference that discussion.
@portsmouth I didn't get the sense that any artists liked the original Standard Surface coat darkening, and it seemed both visually unappealing and counterintuitive as a control system. So that would likely be an unnecessary step backwards for the OpenPBR project overall. |
I mean it would have the same I don't really agree with the logic of "let's release a less powerful model because implementation X doesn't have the time to ship version 1.234 by such and such date". |
I'm hopeful that the new OpenPBR version looks better than the original Standard Surface coat darkening, which was virtually never used by artists, but I don't yet have a real-time implementation that I can test and evaluate! The original Standard Surface version was pretty unappealing, though, from a visual and control system perspective. |
Or if there is no alternative, I will bite the bullet and implement the MaterialX graph for the darkening logic before the deadline (Probably some script to generate the XML is faster than attempting to do it my hand). |
We did agree that it looks good verbally in a past meeting, if I recall. We seemed to agree that the darkening looks more natural when turned on than off, which is the default. As intuitively, one expects e.g. varnished wood to be darker. |
@portsmouth I'm not concerned about the time that it will take to write the coat darkening logic for OpenPBR in MaterialX, but rather the time that it will take to validate it visually and artistically, as one week is not sufficient time to show the functionality to a wide set of artists and get feedback. |
I think this could be said of almost all the new features in the model. For example, surely the Zeltner sheen, thin film weight, fuzz on top, etc. are not really validated by artists in that sense. I don't think we can hope to achieve that by the 1.0 deadline, for the coat darkening or anything else that changed since Standard Surface. |
So has the position changed since this, as seems like now you're pushing to omit the coat darkening from the 1.0? (On the basis that we don't have time to validate it). We've spent quite a lot of time discussing and developing this darkening parametrization, for it to be thrown out at a late stage due to MaterialX concerns. I have also prototyped it in my viewer app, which has been available for months. |
@portsmouth I'd strongly support the idea of including coat darkening for a 1.0 release in late June, but at our last meeting @AdrienHerubel specifically suggested that we omit it due to the new, shorter timetable for OpenPBR release. I'd recommend bringing this up with Adrien! |
The control system just turns the darkening on and off, so not much to it.. NB, we also had Nikie in the meeting, where I recall she agreed the darkening looks good (though unfortunately we don't have the meetings recorded). So there's one artist validation data point, not sure how many we need to be confident. I did point out on Slack that it's available to test in my viewer, but didn't get feedback on it (apart from when showing it in the meeting, where the feedback was positive as noted). |
It would be helpful if Adobe/Autodesk implemented/prototyped this in their renderers also. |
I've had a chance to catch up with @portsmouth in a side discussion, and our current recommendation is to include the This will give us the flexibility to implement coat darkening using either BSDF node/layer upgrades or graph logic approximations in future versions of MaterialX, and in the meantime we'll have a visual match between our reference implementation and custom Arnold/Eclair shaders for the common case where In future versions of OpenPBR, we would then have the option of assigning a new default value of one to |
# Conflicts: # parametrization.md.html
As per the commentary from @jstone-lucasfilm, I've made the change to have |
This looks good to me, thanks @portsmouth, and my only remaining question is whether we should add the new input to our reference implementation. Since the coat darkening is not enabled by default, I wouldn't be as concerned about using a very simple reference implementation such as the color squaring of Standard Surface, if that seems like a reasonable compromise for now. |
That seems reasonable, I will add it back. Though I'd note that if users decide they don't like the darkening effect on the basis of this, we need to bear in mind that the effect has not been properly implemented yet in MaterialX. |
@jstone-lucasfilm I added an approximate MaterialX implementation of the coat darkening math (based on the spec, not on the old Standard Surface formula). This should provide a slightly more faithful implementation than the old approximation (e.g. it takes into account the coat IOR (approximately), but not the base roughness). However, it seems the current MaterialX graph (even before the darkening addition) is failing to compile in the viewer, with error
It's unclear what causes this, maybe it was introduced in a previous commit. Can you check and help to diagnose it? |
Good catch, @portsmouth, and let me test the reference implementation in |
Ok, I've tracked the issue down, and it was actually a limitation of GLSL generation in MaterialX 1.38, which has now been resolved by @niklasharrysson's refactor of the thin-film node in MaterialX 1.39. Since we're actually targeting MaterialX 1.39 in OpenPBR, I would say that we're safe to move forward with both @virtualzavie's earlier change to thin-film controls and your current implementation of coat darkening, both of which render successfully in 1.39 builds. In the near future, I'll add support for 1.39 features such as |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great to me, thanks @portsmouth, and let's move forward with this update to OpenPBR.
b231843
into
AcademySoftwareFoundation:main
This PR adds a detailed discussion to the spec of the coat darkening effect (incorporating the ideas discussed in #136 and #141), with:
coat_darkening
parameter (defaulting to 1, the physically correct case).I also include a placeholder for a discussion of how the coat roughness should affect the underlying lobes. (Probably to be done in a separate PR, and derivation of a reasonable physical approximation for this is WIP).
To make it easier to read, I broke the Coat section into sub-sections.