Skip to content

Fix converting v3 mesh normals and tangents#119595

Open
nikitalita wants to merge 1 commit into
godotengine:masterfrom
nikitalita:fix-v3-meshes
Open

Fix converting v3 mesh normals and tangents#119595
nikitalita wants to merge 1 commit into
godotengine:masterfrom
nikitalita:fix-v3-meshes

Conversation

@nikitalita
Copy link
Copy Markdown
Contributor

What problem(s) does this PR solve?

Additional information

There were a number of issues in the functionality to convert the old ArrayMesh format to the new one:

  • The Tangent array data was accidentally written to the Normal array data as a result of an accidental use of the ARRAY_NORMAL offset
    • As a result of this, the mesh was loaded with garbage normals and garbage tangents
  • Compressed normals and tangents weren't being properly decompressed before attempting to encode them
    • when compressing normals and tangents without octahedral compression, they were multiplied by 127 and stored as an uint8_t (see the old code); however, we were not dividing them by 127 when reading them.
  • The old value of ARRAY_FLAG_USE_2D_VERTICES was set on the new ArrayMesh format instead of the new one

@nikitalita nikitalita requested a review from a team as a code owner May 20, 2026 05:52
@AThousandShips AThousandShips added this to the 4.x milestone May 20, 2026
@AThousandShips AThousandShips requested a review from a team May 20, 2026 09:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ArrayMeshes converted from Godot 3.x display incorrectly in 4.0

2 participants