-
Notifications
You must be signed in to change notification settings - Fork 34
Specular haze #254
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
base: dev_1.2
Are you sure you want to change the base?
Specular haze #254
Conversation
|
It's worth considering whether to add such a tail control to the coat lobe as well. I think probably it's unnecessary though. The look of the combination of coat and specular tail would be interesting to check as well. |
|
I'd like to advocate for the inclusion of a GGX tail in the OpenPBR material. As a user, I've become quite dependent on the Standard Surface's handling of the Coat parameter, which allows me to create a realistic haze or dust effect where it makes the most sense on surfaces. Breaking up the specular response on the coat enables more nuanced looks that enhance realism. I believe that implementing a GGX tail would significantly improve the versatility and quality of materials in OpenPBR. Thank you for considering this suggestion! |
|
I'd note that an alternative parametrization is a single "shape" parameter for the GGX profile. The Student's t-distribution NDF has such a parameter, https://mribar03.bitbucket.io/projects/eg_2017/
For example in Rombo tools they call this the "reflection slope": https://www.rombo.tools/2021/12/12/reflection-slope/ In VRay they have "GGX tail falloff", with minimum value 2 corresponding to regular GGX: https://docs.chaos.com/display/VMAYA/VRayMtl+Reflection Chaos implements GTR: https://www.chaos.com/cn/improvements-to-the-gtr-brdf The Disney Principled BRDF used GGX for the specular base, but GTR (with
Using GTR/Student-t would be more involved to specify though as we'd effectively be dictating a specific mathematical formula for the NDF which is a bit complicated to work with (probably having performance implications as well). Also, though the theory of Student’s t-Distribution is nice, it's not really clear what this model brings visually that a simple mix of different roughnesses does not. It's plausible that the mix could actually be more expressive, since it's a two parameter model so e.g. can do a very sharp NDF plus a very rough one, unlike GTR (and also seems quite reasonable on physical grounds, as representing a microstructure consisting of a statistical mix of two "mesoscale" phases with different GGX roughness). The most general thing would be to have the "dual" GGX lobes, as well as the GTR shape parameter for each lobe. This seems probably like overkill though, and we could always add the tail parameters at a later date. |
|
As we've said, we'd need artist input. Although it is difficult to quantify, I think an important metric is how much additional expressivity is brought, with regard to the additional parameters. From that point of view, the |
|
Here is a wedge of
(The top row and left-hand column are all equivalent to the original metal). The As the So it does seem quite natural to need a 2-dimensional parametrization. Also to note, implementing the NDF mixture in a single BSDF is quite trivial it seems, since according to d'Eon's "A Hitchhiker’s Guide to Multiple Scattering" the resulting shadowing is simply given by mixing the
(EDIT: though computing the multiple scattering compensation taking into account the mix also need to be done, which would require two lookups into the albedo table etc. A more naive implementation can always just blend and sample the two separate BRDF lobes). These implementation details should be mentioned in the spec. |
|
Ah no -- the secondary lobe is always higher roughness.. So Other possibilities would be to either:
I think both of these are probably less intuitive than having the |
Mention that the total roughness of the secondary lobe is clamped to [0,1].
|
A relevant paper that needs to be discussed is "A Composite BRDF Model for Hazy Gloss", Pascal Barla, Romain Pacanowski, Peter Vangorp, EGSR 2018 In this paper they work with the same mixture model we're talking about, i.e. a blend of a primary lobe and secondary lobe differing in roughness. However they figured out how to re-write this as a sum of a "specular core" and a "surrounding halo", in such a way that the halo width can be adjusted independently of the core brightness, which they claim is important for artistic control:
In this image the top row is varying the naive mixture weight (so the sharp reflections are overpowered by the secondary lobe as it gets rougher), and the bottom is varying their new "haziness" parameter (sharp reflections maintained):
In addition to haziness, they allow for independent anisotropy so the haze has two extra roughnesses (or haze "extents") for the tangent and binormal directions. This is a well written paper and a nice contribution, but I feel it probably isn't appropriate to use in the OpenPBR spec:
One thing that is clarified in their paper is the treatment of shadowing. As they note:
The formula I quoted from d'Eon for the shadowing (i.e. blend the and sampling would simply stochastically choose between the two terms with probabilities |
|
Just to clarify why the parameter space for the specular tail is inherently 2-d and not 1-d, I found it helpful for intuition to think about it this way: In the mixture model, we are mixing two separate BSDFs representing the specular core and specular haze. These have independently normalized NDFs say which is also normalized. So there are 3 independent parameters in total, i.e. The mix weight So these 4 regimes are all distinct (with energy balance maintained automatically via the core energy adjusting):
In principle, we could have both the core and haze further parametrized as Student-t lobes with independent |
|
I think we should really add this functionality while we still can. Since:
I would propose adding this to the (1.2) spec officially, getting an implementation into beta builds ASAP, and getting artist feedback to ensure we have the best choice of parameter naming, defaults, ranges etc. (As we have done for several other improvements, that were later iterated on). [1] "A Composite BRDF Model for Hazy Gloss", Barla et. al, EGSR 2018 |
|
A sensible suggestion from @masuosuzuki is to replace the given core/base roughness Or in GLSL pseudo-code: So then no roughness clamping is needed. This seems a bit more natural since the roughening parameter then applies over the whole I will re-do the render wedge above with this new parametrization. @masuosuzuki suggested naming the
This seems best to me, as we use our standard "weight" nomenclature for a genuine mix weight, and indeed Or alternatively, we could stick with:
|
|
Obviously, if the core Here instead I fix the mix weight at 50/50, and vary the core roughness So in words, the "spread"
|
|
I worry that Instead, a naming proposal that both @masuosuzuki and I like, is:
As then:
|
|
As noted by @ld-kerley, @AdrienHerubel's suggestion in the meeting was to instead use
I think that works very well, as then it reads quite clearly as |
|
Regarding the premise of this feature, I understand that it's not possible to achieve the desired effect by putting a rough coat on top of a smooth base, but it is possible to put a smooth coat on top of a rough base. That approach has drawbacks in practice, such as being difficult to tune with dielectrics due to the coat affecting the relative IOR of the base, but I thought it was worth pointing out that it is not entirely unachievable in the current model. |
A smooth coat on a rough base does not quite produce the same look though. The unroughened base is what is wanted, which the coat Fresnel reflection won't necessarily capture (e.g. the color and Fresnel shape of a metallic base). The coat will also generate Fresnel reflections, and darkening due to internal reflections, which may not be wanted if the user is using it only as a means to modulate the base highlight. In the image below, the user wants to achieve a perfectly sharp base metal, with the rougher lobe superimposed on it. This wouldn't be approximated very well by the Fresnel reflection of the coat combined with the rougher metal. Of course, what he wants is not possible physically via a coat (if the coat is fully present), since if the coat has any finite roughness, the base must be roughened, in standard light transport. But what he wants is exactly what the tail/haze mixture model does, in a physically correct manner. One possible approach is to try a partially present rough coat though. That should in theory produce a blend of the sharp and roughened metal highlights. Though it still seems a bit of a kludge, to achieve approximately (with all the, probably unwanted, layering effects) what is expressed more cleanly and generally with the haze model. |
|
That all makes sense. The haze model seems like a better solution for all but the few cases where a smooth coat on top of a rough base might produce satisfactory results. |
|
The latest proposal with One practical downside of this feature is that it sounds like it requires a second specular lobe, whereas all current features can be implemented with a single specular lobe because they all share the same microfacet distribution. Introducing a second specular lobe could reduce performance, though it seems relatively straightforward at least. Luckily, as long as the haze applies to all base specular effects (both metallic and dielectric), it seems like it should be possible to stochastically select which of the two lobes to use for any given shading point (as if the two lobes are not superimposed but are instead each covering a certain fraction of the surface area). This stochastic option would not only avoid an extra specular lobe, it could also avoid a second microfacet-multiple-scattering-compensation lobe. |
|
|
Plus a clearer description of the details.
…into specular_tail # Conflicts: # index.html
|
@jstone-lucasfilm I recall you mentioned you will be working on the MaterialX graph implementation. Possibly that could be done in a separate PR? |
|
@portsmouth Yes, I think that's the right approach here, and I'll plan to develop the MaterialX graph update in a separate PR. |


































































It was noted that the "hazy gloss" look on the right below achieved with Standard Surface, is no longer doable in OpenPBR:
This is because we have the physical effect of coat roughening baked in, i.e. a rough coat in OpenPBR will always roughen an underlying smooth metal/spec. That was done since it matches how it would work on a real material (a shiny metal under a rough coat can't magically appear shiny through the coat), but for a “hazy” look you do want the coat to effectively leave the base highlight undisturbed and add the blur on top.
That would actually correspond physically (most likely) not to a coat at all, but to the metal having some NDF with a wider tail than GGX, rather than a rough coat sitting on top. We can add this haze/tail control to the specular lobe, specifically to support this hazy gloss look, without having to “break” the physics by having a mirror spec unphysically unaffected by an overlying rough coat. (This breakage was supported in standard surface via “coat affect roughness”, but we removed it. I think it would be much preferable have a physically sound “GGX tail” control, than put back somehow that unphysical turning off of the coat roughening to fake the effect).
This can easily be supported simply by having the base microfacet lobe be a blend of two lobes with different roughnesses (but otherwise identical anisotropy), which is how it is done in a number of other schemes: