diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-01-17 20:09:47 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-01-18 14:29:53 +0300 |
commit | fb053ae2e5676e61b7b10d5ee730ee24fd13fa46 (patch) | |
tree | bb99df7bda3d65d6e56259ec7e2be8d3f3f72f89 /source/blender/blenkernel/intern/multires_reshape.c | |
parent | cb5302f962185b827e8c8b40f7a10dceebe310f9 (diff) |
Multires: Correct averaging
Before that only normal component was averaged, which is not
really correct.
Unfortunately, the new code is somewhat slower due to more
involved math to deal properly with non-quad faces, but the
plan is to move averaging from runtime to edit time, This
means, that mdisps will always be continuous around the edges
and no averaging on every frame change of animated character
will be needed.
Diffstat (limited to 'source/blender/blenkernel/intern/multires_reshape.c')
-rw-r--r-- | source/blender/blenkernel/intern/multires_reshape.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/multires_reshape.c b/source/blender/blenkernel/intern/multires_reshape.c index aea626b09fb..0c4edf4de9d 100644 --- a/source/blender/blenkernel/intern/multires_reshape.c +++ b/source/blender/blenkernel/intern/multires_reshape.c @@ -148,7 +148,7 @@ static void multires_reshape_ensure_grids(Mesh *mesh, const int grid_level) /* Convert normalized coordinate within a grid to a normalized coordinate within * a ptex face. */ -static void multires_reshape_grid_coord_to_ptex( +static void multires_reshape_corner_coord_to_ptex( const MPoly *coarse_poly, const int corner, const float corner_u, const float corner_v, float *r_ptex_face_u, float *r_ptex_face_v) @@ -176,8 +176,9 @@ static void multires_reshape_sample_surface( float r_P[3], float r_dPdu[3], float r_dPdv[3]) { float ptex_face_u, ptex_face_v; - multires_reshape_grid_coord_to_ptex(coarse_poly, corner, corner_u, corner_v, - &ptex_face_u, &ptex_face_v); + multires_reshape_corner_coord_to_ptex( + coarse_poly, corner, corner_u, corner_v, + &ptex_face_u, &ptex_face_v); BKE_subdiv_eval_limit_point_and_derivatives( subdiv, ptex_face_index, ptex_face_u, ptex_face_v, |