Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2019-01-17 12:49:43 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2019-01-18 14:29:53 +0300
commit3fb6946b76699e462a927d44d8372e4f0b30cf21 (patch)
tree860d5313bf4541bb8fe635ff2b0c88af3593b40b /source/blender/blenkernel/intern/multires_reshape.c
parent9db73be975ccc3fbbad17361166060cacd84692e (diff)
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.
Diffstat (limited to 'source/blender/blenkernel/intern/multires_reshape.c')
-rw-r--r--source/blender/blenkernel/intern/multires_reshape.c14
1 files changed, 10 insertions, 4 deletions
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);
+ }
}
/* =============================================================================