Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

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:
    241
    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:
    241
    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.