Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question Mikktspace world to tangent artifacts on a specific face of a mesh

Discussion in 'Shaders' started by customphase, Nov 23, 2022.

  1. customphase

    customphase

    Joined:
    Aug 19, 2012
    Posts:
    245
    When transforming any vector from world to tangent im seeing these noisy arifacts on a couple of specific faces of a mesh, like this:

    upload_2022-11-23_17-15-19.png

    And heres how the graph for the image above looks like:

    upload_2022-11-23_17-16-19.png

    This seems to be related to Mikktspace, cause if i import the model with Calculate Legacy mode for tangents, then artifacts disappear.

    Is there a way to keep Mikktspace but also not have these artifacts? Also why specifically that face is artifacting, while others are not? I thought maybe it was related to not having correct UVs, but ALL faces on that mesh dont have any UVs (i mean 0,0 uvs across the board), but only a couple of faces are artifacting.
     
  2. customphase

    customphase

    Joined:
    Aug 19, 2012
    Posts:
    245
    Ok, figured it out, this seems to be related to the fact that the artifacting faces are collinear with one of the axis, which causes orthogonalization to fail, as far as i understand. Moved a couple of vertices on that face by a 0.0001 units and the artifacts are gone:

    upload_2022-11-23_17-43-19.png

    Gonna report as a bug, cause it looks like a bug to me. They should check the vectors collinearity before taking the cross product.