[Bf-blender-cvs] [3fb6946b766] master: Multires: Fix spike issues when sculpting on triangles

Sergey Sharybin noreply at git.blender.org
Fri Jan 18 12:30:23 CET 2019


Commit: 3fb6946b76699e462a927d44d8372e4f0b30cf21
Author: Sergey Sharybin
Date:   Thu Jan 17 10:49:43 2019 +0100
Branches: master
https://developer.blender.org/rB3fb6946b76699e462a927d44d8372e4f0b30cf21

Multires: Fix spike issues when sculpting on triangles

The boundary copy code was not dealing correct with flipping
tangent vectors, hence causing discontinuity in the final
positions.

Now we only copy boundaries for quads, where we know how to
deal with tangent vectors and where we know that this is
needed.

More clear solution could be to change the code in a way that
handles handles displacement grids of quads in the same way
as it's done for non-quad faces.

===================================================================

M	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 b15f4be148e..96f5e9b6b01 100644
--- a/source/blender/blenkernel/intern/multires_reshape.c
+++ b/source/blender/blenkernel/intern/multires_reshape.c
@@ -314,10 +314,16 @@ static void multires_reshape_vertex_from_final_data(
 	if (grid_paint_mask != NULL) {
 		grid_paint_mask->data[index] = final_mask;
 	}
-	/* Copy boundary to the next/previous grids */
-	copy_boundary_displacement(
-	        ctx, coarse_poly, face_corner, grid_x, grid_y,
-	        displacement_grid, grid_paint_mask);
+	/* Copy boundary to the next/previous grids.
+	 *
+	 * NOTE: Only do this for quads faces, since other ones will call reshape
+	 * for every boundary vertex, ensuring proper continuity across boundaries.
+	*/
+	if (coarse_poly->totloop == 4) {
+		copy_boundary_displacement(
+		        ctx, coarse_poly, face_corner, grid_x, grid_y,
+		        displacement_grid, grid_paint_mask);
+	}
 }
 
 /* =============================================================================



More information about the Bf-blender-cvs mailing list