8000 Zero-length tangents being generated · Issue #30 · gltf-rs/mikktspace · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Zero-length tangents being generated #30
Open
@LPGhatguy

Description

@LPGhatguy

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.

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0