From fb053ae2e5676e61b7b10d5ee730ee24fd13fa46 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Thu, 17 Jan 2019 18:09:47 +0100 Subject: 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. --- source/blender/blenkernel/intern/multires_reshape.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'source/blender/blenkernel/intern/multires_reshape.c') 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, -- cgit v1.2.3