-
Notifications
You must be signed in to change notification settings - Fork 21
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
Better approximation for darkening layers under coat #136
Comments
For the moment, I think it's fine to use the crude Standard Surface model, since according to the spec an implementation can approximate the effect however it wants (including just ignoring it..). I'd like to leave the effect on since the spirit of the spec is to do this physically correctly, in which case there should be at least some darkening/saturation effect. Even with the rough approximation, it will be good to get feedback about this and because (as Indy argued) it probably is generally more useful for the effect to be on than off. I have a slight preference for using a lower hard-coded value than 1 though (e.g. 0.5), since the effect is quite strong right now, and that may not be realistic. As noted in the OpenPBR thread, I think we should for a later release derive a better, more physically correct approximation to get more insight into how big this effect actually is. For example if you restrict to normal incidence, I think the full multi-bounce calculation is pretty tractable. Whether we put in some control later to modulate the effect, is tricky since we would have to give some concrete physical explanation of it. But once we have a better understanding of a formula for the effect, we could implement it for example like:
In essence that is quite similar to the scheme we have for SSS remapping (i.e. set the internal albedo/MFP to approximately match the desired color/blur, given a detailed understanding of the effect). |
@AdrienHerubel @portsmouth I'd support the idea of providing an artistic control over the darkening effect of the coat, as I would expect the real-world impact of this darkening to be highly variable, and influenced by the composition and thickness of the coating material. Just to give one example of an artistic use case that OpenPBR ought to handle, here's a link to a printing company talking about the effect of different lamination processes on the colors of printed paper: In the short term, would it perhaps make sense to add a control along the lines of the |
Just to clarify, I think if we did add that control back, we would need to present a specific formula in the spec (for remapping the |
@AdrienHerubel What are your thoughts on how universal this model for coat darkening should be considered? Would the effect of the lamination process on paper (e.g. a playing card) show such a strong darkening effect as well, or would we expect the composition, application process, and thickness of the coat to have a strong impact on the degree of coat darkening we would see? |
We assume that the coat is a dielectric layer directly on top of the base. Then the effect described in 2.1 of the paper Adrien linked is the only one that occurs. That is the effect that Adrien's tests simulate also, by brute force, i.e. bounces in a thin but finite depth coat. This is actually independent of the thickness of the coat, if the coat is non-absorbing. (If it absorbs, then it depends on the transmittance, not the depth directly). Even a coat of very small thickness will do this (though if the coat depth is so small that wave optics is important, then things will be more complicated -- we can just assume that is not the case). As noted in the paper, in real materials there is also the possibility that the substrate is wetted by the coat. Which we could attempt to model, but currently don't (and other CG models don't either I think, currently). Similarly, if the lamination involves some adhesive, we won't/can't model the effect of that. (Presumably the layering involved in e.g. MaterialX implicitly makes such an assumption too). |
The main reason that I bring up the potential variability of the effect is make sure we're giving the artist sufficient freedom to control its visual impact, rather than applying a universal darkening to all base colors under a coat. If there's room for different coats to have different darkening effects, then to my mind that supports the importance of an artistic control to determine where and to what degree it's applied. If, on the other hand, we expect a uniform, universal darkening effect, then this artistic control would be less critical. |
There's no physical reason why it shouldn't darken/saturate according to the process in Fig 1. above. That just always happens, due to light bouncing around in the layer. (Can you think of a physical reason why it should not?). What I was suggesting was that, as a convenience, we could give the artist a control that will automatically brighten/de-saturate the base color (internally) to compensate, negating the effect. (So it's nothing physical, it's just purely a remapping to save the artist the bother of manually tweaking the base color if she wants to make the appearance match a particular color). This will complicate the model though (add a slider), so we'd want to be sure it's actually worth it. |
The effect of lamination on the color of paper looks well documented https://www.ncbi.nlm.nih.gov/pmc/articles/PMC9504082/ |
@AdrienHerubel Agreed that there's a visual impact of lamination on printed colors, but I'd expect the impact of this effect to be very different from that of water films on surfaces. From our current Slack discussion, it sounds like we're leaning in the direction of expecting coatings to have a highly variable effect, very different from the uniform darkening/squaring in Standard Surface, and let's see how the conversation evolves. |
Assuming the mechanism is just light bouncing in the dielectric layer, you would expect the effect to vary according to the coat IOR, roughness and color (i.e. absorption transmittance), in a way which is completely understood and derivable. (Though not very well modeled by the Standard Surface approximation). |
@portsmouth Absolutely, I'm expecting that we'll work through the derivation and come up with a new, physically motivated behavior for base-under-coat effects, which we'll then integrate into an upcoming reference implementation for OpenPBR. Based on its artistic effectiveness, we'll have the choice to enable the new behavior for all OpenPBR materials or to control it with an artist-facing slider, and I'm open to either approach depending on what artists prefer. In the meantime, though, my hope is that we can remove the legacy Standard Surface behavior (uniform squaring of base-under-coat colors), since it's artistically unintuitive, and doesn't make a good approximation of the new, physically motivated behavior. What are your thoughts? |
As noted above:
|
@portsmouth I understand your perspective on this, though I feel that our current workaround for base-under-coat effects reduces the quality of the first impressions that artists and developers will have of the OpenPBR shading model To my eye, having worked with earlier shading models such as Standard Surface and ILM Unified, simply applying a uniform power to base colors under a coat looks like a bug rather than an intentional, physically motivated effect. I'll leave the associated pull request active for now, and I'd be interested in additional thoughts from developers and artists on this topic: |
FWIW from memory at Weta we had a control (on by default) that automatically compensated so the diffuse albedo remained the same at normal incidence. |
Here is a specific suggestion for how we define the parametrization of the coat darkening. We say that by default, the physical effect of darkening due to internal reflections in the coat should be accounted for. We give a suggested approximate formula for implementing this (see notes here for the derivation), which is simply to darken the base lobe by the constant factor (different per channel in general): (where Though implementations are free to improve on this approximation if they wish (as this assumes a Lambertian base, and perfectly smooth coat). The effect of this darkening varies with IOR and underlying base albedo, as shown below (in the approximation above): To modulate this effect, we add a new control (NB, for the glossy-diffuse layer, we will do the same except say that this boosting is always done and is not optional, as noted in #141). To be precise about what we mean by "counteract the darkening", we have to define it concretely in terms of (say) the physical albedo of the coated base at normal incidence, (This is always achievable physically, since varying the physical base albedo We can then solve for the boosted base albedo Thus we can define the base albedo to be boosted by the following variable factor and As a result, in albedo-scaling approximation the total albedo is which has the expected limits as Note that in the approximation where no darkening is applied (i.e. If we give suggested approximations such as the coat darkening factor above, we should probably make the derivation publicly available. Options might be to have a folder of supplemental documents, or e.g. add the notes as a separate technical report to https://arxiv.org. |
This PR adds a detailed discussion to the spec of the coat darkening effect (incorporating the ideas discussed in #136 and #141), with: - introduction of a new `coat_darkening` parameter (defaulting to 1, the physically correct case). - a physical definition of how this parameter operates to reduce the darkening (via boosting of the base albedo) - a suggested practical implementation of the darkening factor for the base lobe, taking into account the IOR of the coat, and also the roughness of the base (based on the derivations and discussions linked elsewhere). - A suggested implementation of the darkening of colored coats at grazing angles due to longer path length in the absorbing medium.
This can be closed now. |
Due to the possibility of total internal reflection at the coat/external medium boundary, layers under the coat should be darker. See https://graphics.cs.yale.edu/sites/default/files/wet.pdf for a detailed model describing the various effect of having a water layer on top of materials. I think that interpenetration of layers is out of scope for OpenPBR surface, but the total internal reflection should be modelled.
In the OpenPBR specification we describe the phenomenon without providing implementation details :
In the full light transport this observed color is further darkened and saturated due to multiple internal reflections from the inside of the coat, including a considerable amount of total internal reflection, which causes light to strike the underlying material multiple times and undergo more absorption. Also the observed tint color should vary away from coat_color as the incidence angle changes, due to the change in path length in the medium. The presence of a rough coat will increase the apparent roughness of the BSDF lobes of the underlying base. We generally assume that in the ground truth appearance, all these effects are accounted for.
In Standard Surface there is a dedicated parameter to simulate the darkening of layers under coat using the following formula :
base_color = pow(base_color, 1.0 + (coat * coat_affect_color)) subsurface_color = pow(subsurface_color, 1.0 + (coat * coat_affect_color))
This approximation is simple and disabled by default in Standard Surface.
In OpenPBR we should evaluate it against ground truth, possibly find a better approximation, and decide whether we want to make the effect user controllable.
The text was updated successfully, but these errors were encountered: