Skip to content

Commit

Permalink
Merge pull request #84097 from stoofin/plane-mesh-tangent
Browse files Browse the repository at this point in the history
Fix PlaneMesh tangents for 'Face X' orientation
  • Loading branch information
akien-mga committed Oct 30, 2023
2 parents 47101c0 + 6099d9f commit ad9297e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion scene/resources/primitive_meshes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1300,7 +1300,11 @@ void PlaneMesh::_create_mesh_array(Array &p_arr) const {
points.push_back(Vector3(-x, z, 0.0) + center_offset);
}
normals.push_back(normal);
ADD_TANGENT(1.0, 0.0, 0.0, 1.0);
if (orientation == FACE_X) {
ADD_TANGENT(0.0, 0.0, -1.0, 1.0);
} else {
ADD_TANGENT(1.0, 0.0, 0.0, 1.0);
}
uvs.push_back(Vector2(1.0 - u, 1.0 - v)); /* 1.0 - uv to match orientation with Quad */
point++;

Expand Down

0 comments on commit ad9297e

Please sign in to comment.