You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We use the mikktspace crate to generate tangents when loading models in our engine. Recently, we introduced bloom and found out that we've had some very rare NaN outputs in our fragment shader. We traced back the issue and found out that the mikktspace crate generates zero-length tangents occasionally, causing them to turn into NaN when normalized.
On face 2923, vertex 2, a tangent of (0.0, 0.0, 0.0, -1.0) is generated by this crate. The model appears to have nothing weird about it, and Blender generates correct tangents for all vertices if set during export.
The text was updated successfully, but these errors were encountered:
This will require some investigation. It could be an issue with the original C algorithm that was patched later (in Blender or otherwise) or it could be been introduced inadvertently by us.
We hit this issue again! This time, it looks like bad tangents are coming from Blender on a different model. It looks like they have a similar bug, it just didn't pop up on this model.
Here is a slice of a model I got from Sketchfab that generates zero-length tangents with both this crate and Blender: umprail.zip
It has pretty awful topology, but I don't think any program should ever generate invalid tangents in that case, right?
We use the
mikktspace
crate to generate tangents when loading models in our engine. Recently, we introduced bloom and found out that we've had some very rare NaN outputs in our fragment shader. We traced back the issue and found out that themikktspace
crate generates zero-length tangents occasionally, causing them to turn into NaN when normalized.This model from the glTF Sample Model repository exhibits this issue: https://github.com/KhronosGroup/glTF-Sample-Models/blob/4ca06672ce15d6a27bfb5cf14459bc52fd9044d1/2.0/DamagedHelmet/glTF-Binary/DamagedHelmet.glb
On face 2923, vertex 2, a tangent of
(0.0, 0.0, 0.0, -1.0)
is generated by this crate. The model appears to have nothing weird about it, and Blender generates correct tangents for all vertices if set during export.The text was updated successfully, but these errors were encountered: