Path: blob/main/release-content/migration-guides/mesh_compute_smooth_normals.md
6592 views
---
---
In Bevy 0.16, Mesh
smooth normal calculation used a triangle area-weighted algorithm. In 0.17, the area-weighted algorithm was moved to separate methods, the default implementation was switched to a corner angle-weighted algorithm, and Mesh::compute_custom_smooth_normals
was added for other cases.
The angle-weighted method is more suitable for growing or shrinking a mesh along its vertex normals, such as when generating an outline mesh. It also results in more expected lighting behavior for some meshes. In most cases, the difference will be small and no change is needed. However, the new default is somewhat slower, and does not always produce the result desired by an artist. If you preferred the lighting in 0.16, or have a significant performance regression, or needed area-weighted normals for any other reason, you can switch to the new dedicated area-weighted methods.
As part of this change, the helper functions face_normal
and face_area_normal
, were renamed to triangle_normal
and triangle_area_normal
respectively to better reflect the fact that they do not take an entire geometric face into account.