diff options
author | Hans Goudey <h.goudey@me.com> | 2021-08-02 20:47:32 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2021-08-02 20:47:32 +0300 |
commit | 8b93265c19feeed2b758046359ac102a1f21278a (patch) | |
tree | 326627b050801dbda6994957c62c49c9b4518006 /source/blender/blenkernel/intern/mesh_remesh_voxel.cc | |
parent | a2203a27d9298f7e51948e825e6aea992b3ac5b2 (diff) |
Mesh: Tag normals dirty instead of calculating
Because mesh vertex and face normals are just derived data, they can
be calculated lazily instead of eagerly. Often normal calculation is
a relatively expensive task, and the calculation is often redundant
if the mesh is deformed afterwards anyway.
Instead, normals should be calculated only when they are needed. This
commit moves in that direction by adding a new function to tag a mesh's
normals dirty and replacing normal calculation with it in some places.
Differential Revision: https://developer.blender.org/D12107
Diffstat (limited to 'source/blender/blenkernel/intern/mesh_remesh_voxel.cc')
-rw-r--r-- | source/blender/blenkernel/intern/mesh_remesh_voxel.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/mesh_remesh_voxel.cc b/source/blender/blenkernel/intern/mesh_remesh_voxel.cc index 4484dd5bf09..63b0403dcea 100644 --- a/source/blender/blenkernel/intern/mesh_remesh_voxel.cc +++ b/source/blender/blenkernel/intern/mesh_remesh_voxel.cc @@ -270,7 +270,7 @@ static Mesh *remesh_voxel_volume_to_mesh(const openvdb::FloatGrid::Ptr level_set } BKE_mesh_calc_edges(mesh, false, false); - BKE_mesh_calc_normals(mesh); + BKE_mesh_normals_tag_dirty(mesh); return mesh; } |