-
Notifications
You must be signed in to change notification settings - Fork 18
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
Specify the anisotropy direction #170
Specify the anisotropy direction #170
Conversation
I feel that we should keep the existing Also, there will be existing assets that texture the rotation. A case where it could genuinely make sense to texture the rotation would be to add some perturbing angular noise to procedurally break up the flow-map generated directions (which will not introduce any artifact provided the noise is continuous on the surface). I imagine doing this via the shader, rather than having to regenerate the flow-map, could be quite convenient. glTF does this also, though it explicitly requires that the rotation parameter be untextured (which I think is unnecessary for us).
|
I like the new name Note that currently, the What we specify is at least consistent with glTF, where they said:
(where "direction vector" means T here). |
Regarding the discussion in the meeting about what assumptions we should make about the tangent space, I assume the policy is roughly:
|
Yes, good point. We already state the assumption of the existing frame of reference, but the exact transform is certainly lacking. |
I think we need to be more explicit that the values in the texture, where we require that Or as a 2x2 matrix equation (with a rotation matrix appearing, with Obviously, that guarantees that Hopefully this corresponds to the format of "flow maps" generated by some existing tools (though I don't actually know). |
There were several points brought, so I'll try to address them one by one:
Did I forget anything? |
Sounds reasonable. At least, putting the rotation angle parameter back if users demand it would be strictly additive to the model so would not be a very disruptive change. The main thing I worry is that users may want to globally rotate the direction by 90 degrees, in case the flow direction was painted as "groove stretch" instead of "highlight stretch". Though of course it can always be done at the level of the flow map.
👍
Possibly i'm mistaken, but won't artists usually think of the lines (i.e. vector field) they are painting as corresponding to the "brush" direction in brushed metal? So e.g. to get the render below, wouldn't they want to paint circles around the base of the pan, rather than radial lines? (As if they are applying the brushing themselves to the metal). In that case, they would be specifying what we currently refer to as B. (Or in other words, to get that render with your current proposal, they would need to have painted radial lines, which seems a bit weird). Personally I'd vote to swap the meaning of T and B, so that T actually means the groove direction (so B is the NDF highlight stretch direction). This is not what glTF did though, for whatever reason. Ideally we need to hear from more people who are familiar with the actual artist tools and workflows for this (maybe your Substance colleagues for example). |
Oh yes, I completely agree. But whether we specify the grooves as being T or B won't matter, since it's up to the authoring tool to decide what a brush stroke of the artist will result in. Arguably, an authoring tool that doesn't give much thought into it will likely map our parameter as is, so that would be an argument to indeed align the grooves with T. I'll try to gather some feedback internally. |
NB, the Arnold tutorial for that pan render is here: It's interesting that in this case, he didn't rely much (or at all?) on the tangents, instead the circles were generated using a bump map with circular "scratches" in it (which is kind of like authoring the "anisotropic microfacet distribution" with bumps, rather than the actual NDF). Which is another valid way to get "anisotropic roughness" at a geometrical level, I suppose, and looks more realistic since you can actually see the grooves/scratches. Similarly, in this photograph the anisotropy is generated by high resolution scratches which are somewhat random but statistically biased to point along a "flow" direction. I can imagine that a high end asset may prefer to author anisotropy this way, rather than with the more crude stretching of the NDF. |
Agreed.
👍
👍
I think glTF opted to have the NDF stretch along T. Personally, I think it's more intuitive though if the grooves aligned with T, so the highlight (and thus the NDF stretch) should align with B. Though I suppose we should go with whatever convention is most consistent with existing flow-map tools (your Substance colleagues would be the best people to ask, and glTF people as to why they chose this convention).
Seems like there is a consensus (i.e. do same as in glTF).
Nope. Only issue to decide is the stretch direction convention. Otherwise, proposed fixes to the spec sound good. |
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.
Do we have a consensus on what to define as the highlight stretch direction, T or B? (Where the groove direction is then the opposite).
As noted, I think highlight=B, groove=T is the most sensible. However, glTF I think does the opposite. So what do we do?
# Conflicts: # index.html
444aeb1
to
adb428d
Compare
# Conflicts: # index.html # reference/open_pbr_surface.mtlx
adb428d
to
d8b3bb0
Compare
…catter_anisotropy
# Conflicts: # examples/open_pbr_default.mtlx # index.html # parametrization.md.html
Co-authored-by: Jamie Portsmouth <jamports@mac.com> Signed-off-by: Julien Guertault <9511025+virtualzavie@users.noreply.github.com>
Co-authored-by: Jamie Portsmouth <jamports@mac.com> Signed-off-by: Julien Guertault <9511025+virtualzavie@users.noreply.github.com>
# Conflicts: # index.html
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.
LGTM!
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.
As discussed, providing explicit tangents for the specular lobes enables more workflow than baking anisotropy rotation or flow maps in the shader itself and is a great change. Adding back simpler parametrizations to the shader can be left for future discussions.
This PR removes entirely the definitions
, to consider instead that the providedspecular_rotation
andcoat_rotation
geometry_tangent
is sufficient to define the direction of the anisotropy.To avoid correlation between the NDF of the base layer and coat layer,
geometry_coat_tangent
is added.Finally the Normal maps section is developed to mention how a tangent map can alter the tangent vector in the same way a normal map alters the normal vector.