bevy/release-content/migration-guides
Waridley 9e1e8bc1bc
Add angle-weighted smooth normals implementation (#18383) (#18552)
# Objective

Closes #18383 

## Solution

Given the 2 votes (me and @komadori ) for making angle-weighted normals
the default, I went ahead and did so, moving the face-weighted
implementation to the new `Mesh::compute_face_weighted_normals` method.
I factored out the common code between both into
`Mesh::compute_custom_smooth_normals`, which I went ahead and made
public to make it easier for users to add any other weighting methods
they might come up with.

If any of these decisions are undesirable for any reason, please let me
know and I will gladly make modifications.

## Testing & Showcase

I made a demo that exaggerates the difference at
[Waridley/bevy_smooth_normals_comparison](https://github.com/Waridley/bevy_smooth_normals_comparison).
Screenshots included in the readme.

Another way it could be demonstrated is via scaling a mesh along its
normals, like for generating outline meshes with inverted faces. I'd be
willing to make a demo for that as well.

I also edited and renamed the `compute_smooth_normals` tests to use
face-weighted normals, and added a new test for angle-weighted ones
which validates that all normals of a unit cube have each component
equal to `(±1 / √3) ± f32::EPSILON`.

## Migration Guide

#16050 already did not mention a migration guide, and it is not even in
a stable release yet. If this lands in a 0.16 RC, updating from RC1
would probably not require any changes in the vast majority of cases,
anyway. If someone really needs face-weighted normals, they can switch
to `.compute_face_weighted_normals()` or
`.with_computed_face_weighted_normals()`. And if for some reason they
really liked the old count-weighted implementation from 0.15, there is
an example in the docs for `compute_custom_smooth_normals`.
2025-07-17 19:23:30 +00:00
..
.gitkeep
anchor_is_removed_from_sprite.md
animation_graph_no_more_asset_ids.md Prevent AnimationGraph from serializing AssetIds. (#19615) 2025-06-30 22:26:05 +00:00
bevy_render_reorganization.md Split bevy_camera out of bevy_render (#19949) 2025-07-04 23:31:16 +00:00
bevy_ui_render_crate.md bevy_ui_render crate (#18703) 2025-07-03 23:36:35 +00:00
camera_restructure.md
check_change_ticks.md System::check_change_tick and similar methods take CheckChangeTicks (#19600) 2025-06-13 19:24:27 +00:00
chromatic_aberration_option.md Clean up several miscellaneous uses of weak_handle. (#19408) 2025-07-08 06:45:40 +00:00
component_entry.md Rename bevy_ecs::world::Entry to ComponentEntry (#19517) 2025-06-10 01:12:40 +00:00
component-lifecycle-module.md Rename Trigger to On (#19596) 2025-06-12 18:22:33 +00:00
composable_specialization.md Composable Pipeline Specialization (#17373) 2025-07-01 01:32:44 +00:00
compressed-image-saver.md add forgotten migration guide (#19800) 2025-06-24 11:19:20 +00:00
convert-coordinates.md Nudge users into migrating to new default glTF coordinate conversion (#19816) 2025-06-28 18:35:41 +00:00
dragenter_includes_dragged_entity.md
entities_apis.md
entity_cloner_builder_split.md Unify filtering by id in EntityClonerBuilder (#19977) 2025-07-07 20:00:37 +00:00
entity_representation.md Fix new typos (#19562) 2025-06-09 22:55:14 +00:00
event_split.md Event Split: Event, EntityEvent, and BufferedEvent (#19647) 2025-06-15 16:46:34 +00:00
extract_fn_is_mut.md Run RenderStartup in/before extract instead of after it. (#19926) 2025-07-07 01:31:40 +00:00
extract-picking-plugin-members.md Extract members of PickingPlugin and PointerInputPlugin into new types (#19078) 2025-07-07 19:40:25 +00:00
extract-pointer-input-plugin-members.md Extract members of PickingPlugin and PointerInputPlugin into new types (#19078) 2025-07-07 19:40:25 +00:00
fullscreen_shader_resource.md Replace FULLSCREEN_SHADER_HANDLE with a FullscreenShader resource. (#19426) 2025-06-24 00:02:23 +00:00
generic-option-parameter.md
handle_weak_replaced_with_handle_uuid.md Replace Handle::Weak with Handle::Uuid. (#19896) 2025-07-02 14:40:35 +00:00
interned-labels-cleanup.md
labeled_asset_scope_errors.md
LightVisibilityClass_rename.md Rename light visibility class (#19986) 2025-07-06 19:04:30 +00:00
log-diagnostics-hash-set.md
map_set_apply.md Fix PartialReflect::apply for maps, remove get_at/_mut from Map trait (#19802) 2025-06-25 15:42:01 +00:00
merge_observerState_observer_single_component.md
mesh_compute_smooth_normals.md Add angle-weighted smooth normals implementation (#18383) (#18552) 2025-07-17 19:23:30 +00:00
Newtype_ScrollPosition.md Newtyped ScrollPosition (#19881) 2025-07-01 17:41:48 +00:00
observer_triggers.md Rename Trigger to On (#19596) 2025-06-12 18:22:33 +00:00
observers_may_not_be_exclusive.md
overflowclipbox_default_is_now_paddingbox.md
per-world-error-handler.md
picking_location_not_component.md
pointer_target.md Split BufferedEvent from Event (#20101) 2025-07-14 21:31:48 +00:00
query_items_borrow_from_query_state.md Remove 's lifetime from WorldQuery::Fetch (#19720) 2025-06-19 00:58:21 +00:00
reflect_asset_asset_ids.md Replace UntypedHandle from ReflectAsset with impl Into<UntypedAssetId>. (#19606) 2025-06-15 16:42:54 +00:00
relationship_set_risky.md EntityWorldMut methods do not automatically overwrite Relationship components (#19601) 2025-06-22 00:22:05 +00:00
relative_cursor_position_is_object_centered.md Fix some typos (#19788) 2025-06-23 22:32:46 +00:00
remove_archetype_component_id.md
remove_archetypecomponentid.md
remove_bundle_register_required_components.md Remove Bundle::register_required_components (#19967) 2025-07-06 18:15:28 +00:00
remove_cosmic_text_reexports.md
remove_deprecated_batch_spawning.md Fix new typos (#19562) 2025-06-09 22:55:14 +00:00
remove_the_add_sub_impls_on_volume.md
rename_condition.md
rename_pointer_events.md Rename some pointer events and components (#19574) 2025-06-10 21:57:28 +00:00
rename_spawn_gltf_material_name.md
rename_state_scoped.md
rename_timer_paused_and_finished.md
rename_transform_compute_matrix.md rename Transform::compute_matrix to to_matrix (#19646) 2025-06-18 05:37:25 +00:00
rename-justifytext.md Rename JustifyText to Justify (#19522) 2025-06-09 19:59:48 +00:00
render_graph_app_to_ext.md Allow calling add_render_graph_node on World. (#19912) 2025-07-02 14:56:18 +00:00
render_startup.md Use RenderStartup for all basic cases in bevy_core_pipeline. (#20002) 2025-07-15 07:10:43 +00:00
replace_non_send_resources.md Make GILRS and WINIT_WINDOWS public (#19575) 2025-06-12 20:05:00 +00:00
rework_merge_mesh_error.md Expand MergeMeshError to include IncompatiblePrimitiveTopology variant (#18561) 2025-07-16 20:37:58 +00:00
scalar-field-on-vector-space.md
schedule_cleanup.md Improve node encapsulation in ScheduleGraph (#20119) 2025-07-15 06:29:52 +00:00
send_event_rename.md Rename send_event and similar methods to write_event (#20017) 2025-07-07 22:05:16 +00:00
separate-border-colors.md
simple_executor_going_away.md
specialized_ui_transform.md
split-window.md Split CursorOptions off of Window (#19668) 2025-06-17 20:20:13 +00:00
stack_z_offsets_changes.md UI z-ordering fix (#19691) 2025-07-01 19:20:07 +00:00
state_scoped_entities_by_default.md
stop_storing_system_access.md Stop storing access for all systems (#19477) 2025-06-13 17:56:09 +00:00
sync_cell_utils.md
system_run_returns_result.md Have System::run_unsafe return Result. (#19145) 2025-07-03 21:48:09 +00:00
system_set_naming_convention.md
taa_non_experimental.md
textshadow_is_moved_to_widget_text_module.md Move TextShadow to text widget module (#19579) 2025-06-29 17:37:04 +00:00
UI_scroll_position_is_now_logical.md Improved UI scrolling support and bug fixes (#20093) 2025-07-15 17:33:04 +00:00
unified_system_state_flag.md
wgpu_25.md Ugrade to wgpu version 25.0 (#19563) 2025-06-26 19:41:47 +00:00
zstd.md add native zstd support (#19793) 2025-06-26 20:53:54 +00:00