Mesh: Reduce custom normal calculation memory usage #107592

Merged
Hans Goudey merged 32 commits from HooglyBoogly/blender:corner-normals-refactor-storage into main 2023-05-10 14:41:16 +02:00
2 changed files with 3 additions and 3 deletions
Showing only changes of commit 59bdd13e13 - Show all commits

View File

@ -120,8 +120,8 @@ struct CornerNormalSpaceArray {
Array<int> corner_space_indices;
};
void lnor_space_custom_data_to_normal(const CornerNormalSpace *lnor_space,
const float3 lnor_no_custom,
void lnor_space_custom_normal_to_data(const CornerNormalSpace *lnor_space,

The naming here introduces "fan_space_custom_normal" which reads as if it might be different from CornerNormalSpace (as if there might be a "fan space" and a "corner normal space").

This could be more clearly names that it's a direct conversion from CornerNormalSpace to CD_CUSTOMLOOPNORMAL.

e.g. corner_normal_space_to_clnor.

The naming here introduces "fan_space_custom_normal" which reads as if it might be different from `CornerNormalSpace` (as if there might be a _"fan space"_ and a _"corner normal space"_). This could be more clearly names that it's a direct conversion from `CornerNormalSpace` to `CD_CUSTOMLOOPNORMAL`. e.g. `corner_normal_space_to_clnor`.

Ah, sorry, I meant to rename that and keep the same name as before like you suggested.

Ah, sorry, I meant to rename that and keep the same name as before like you suggested.
float3 lnor_no_custom,
const float custom_lnor[3],
short r_clnor_data[2]);

View File

@ -434,7 +434,7 @@ Mesh *BKE_mesh_mirror_apply_mirror_on_axis_for_modifier(MirrorModifierData *mmd,
mul_m4_v3(mtx_nor, loop_normals[mirrorj]);
const int space_index = lnors_spacearr.corner_space_indices[mirrorj];
blender::bke::mesh::lnor_space_custom_data_to_normal(&lnors_spacearr.spaces[space_index],
blender::bke::mesh::lnor_space_custom_normal_to_data(&lnors_spacearr.spaces[space_index],
loop_normals[mirrorj],
loop_normals[mirrorj],
clnors[mirrorj]);