Open sherief opened 1 year ago
Hi,
the behavior you're describing is actually expected. The skinning job only expects 3 components for tangents, as described in the documentation.
The reasoning is:
Does it make sense for your use case?
Cheers, Guillaume
When using a format with the tangent space handedness stored in the tangent's w component, much like the sample mesh format, skinning job doesn't preserve the handedness in the out tangent array. The cause seems to lie in the tangent tranformation code:
and
Regardless of how in_t is loaded, only the first 3 elements are stored into out_tangents, so in_t.w is undefined in the output array. When passing this to the GPU and computing bitangent as
cross(normal, tangent.xyz) * tangent.w
, the value is corrupted.I have a local fix that Works In My Case (tm), but I'd like to know what an ideal fix would be and I'd be happy to incorporate it into the library. My local fix is an SSE only hack with no ref implementation, no NEON variant, etc.