1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-04 12:00:25 +00:00
Files
godot/modules/jolt_physics
Adam Simpkins dd80a3aa19 Fix jolt_physics soft body vertex normal calculation
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.
2025-06-27 17:04:15 -07:00
..
2025-05-13 07:35:53 -04:00