You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-04 12:00:25 +00:00
The code previously iterated through each face and set all vertices to that face's normal. This resulted in each vertex getting the normal from just one face that it belonged to (whichever face was last in this array). This caused weird shading artifacts. This fixes the code so that the vertex normal is now the average normal of all faces that it belongs to. This results in "smooth shading" behavior for soft body meshes. This is still somewhat undesirable if the input mesh was using flat shading, but it looks less bad than the previous behavior of picking a normal at random from one attached face. This matches the behavior of GodotPhysicsServer3D. Fixes #107831.