`tangent` as geometric space
I'd like to propose adding "tangent" as one of the geometric spaces that can be chosen for appropriate nodes. Currently, there are "model", "object", and "world" in the specification.
Alternative approaches
If there is a sequence of existing nodes that can convert from, say "object space" to tangent space, that would be a viable workaround. I'm not aware of such a sequence.
Current support
Apple's QuickLook supports "tangent" as geometric space for normal and other nodes that have a space.
UsdShade (from a file made with Reality Composer Pro):
def Shader "Normal"
{
uniform token info:id = "ND_normal_vector3"
string inputs:space = "tangent"
float3 outputs:out
}
Unity also has this:
@hybridherbst This is just my own perspective on the matter, but one hurdle to including tangent as a space option in geometric nodes is that a MaterialX asset may have been authored with a different tangent frame convention (e.g. left-handed vs right-handed), and to support all use cases robustly, we'd need to add tangent and bitangent vector inputs to each of our geometric nodes.
One common approach today is to call creatematrix with the desired tangent, bitangent, and normal vectors, constructing the transform matrix from tangent to world space. This matrix can then be used in transformmatrix as needed (with or without transposition) to transform vectors back and forth between tangent and world space.
This is admittedly not an artist-friendly answer, though, and if you have ideas for a new graph-based node that transforms between tangent and world spaces in a clear, artist-oriented way, we'd definitely be interested in them.
Thank you for the insights! Do you happen to have an example file that does this tangent-space transformation in the way you outlined?
I believe the left-handed vs. right-handed tangent space is just a symptom of a bigger issue – that MaterialX does not have a canonical coordinate system at the moment, which means that all geometric properties (e.g. accessing object-space vertex position, or normals) are already different across applications with different coordinate systems.
Maybe it's time to reopen this issue and update it with the result of the Slack discussion?
- https://github.com/AcademySoftwareFoundation/MaterialX/issues/1626
@hybridherbst I see that we don't have a public example of this creatematrix usage in the MaterialX repository, but we really should!
I'm definitely open to reviving the discussion of adding a canonical coordinate system to MaterialX, and your writing up a summary of the Slack discussion in that issue sounds like a good starting point to me.