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.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
/* =============================================================================
|
||||
|
||||
Reference in New Issue
Block a user