Page MenuHome

Fix artifact in Clay Strips when producing large deformations
ClosedPublic

Authored by Pablo Dobarro (pablodp606) on Jun 11 2020, 11:55 PM.

Details

Summary

The clay strips brush tip tests distances against a cube with beveled Z
aligned edges. This cube was positioned with its center in the surface
of the mesh, so when producing large deformation, some vertices that
should be deformed were positioned further than the cube's Z dimension,
so they were left behind, producing artifacts.
This displaces and deforms the local space to position the brush tip
cube (now a prism) towards the deformation direction, so more vertices
can be included, removing most of these artifacts.

Before

After

Diff Detail

Repository
rB Blender

Event Timeline

Pablo Dobarro (pablodp606) requested review of this revision.Jun 11 2020, 11:55 PM
Sergey Sharybin (sergey) requested changes to this revision.Jun 12 2020, 9:12 AM
Sergey Sharybin (sergey) added inline comments.
source/blender/editors/sculpt_paint/sculpt.c
4709–4710

What is a single direction?
Why the artifacts happen?
Why 0.7?

4736

Why 1.25? Should it be complementary to 0.7 from above (currently it is not, so intuitively there is an "energy" loss here).

This revision now requires changes to proceed.Jun 12 2020, 9:12 AM

@Sergey Sharybin (sergey) Currently, Clay Strips works like this:


When the Add direction is enabled, vertices that are below the blue plane and inside the cube are projected to it. This cube does not have falloff in the Z axis, it only has falloff in the X and Y, so if a vertex is below the plane but outside of the cube it produces those artifacts. This patch does the following:


The 0.7 value controls where the blue plane is positioned inside of the cube in relation to the center, the 1.25 value controls how much the cube is stretched in the Z axis. As this brush does not have falloff in Z the values don't need to be related, so I just put some defaults that don't produce artifacts in most situations. They can be exposed in the UI, but I don't think most users will find this useful.

All these explanations belongs to the comment in the code.

Pablo Dobarro (pablodp606) marked 2 inline comments as done.
Pablo Dobarro (pablodp606) edited the summary of this revision. (Show Details)
  • Review update

Add information about 0.7 and 1.25 into the comment as well, mentioning that this is a bit arbitrary and deals with common source of artifacts. Also mention that there is no dependency between them.

This revision is now accepted and ready to land.Jun 22 2020, 11:45 AM