GPencil: Fix unreported jagged lines when using Stroke mode
When use the Stroke reproject mode, the precission of the conversion makes the line produce a very small noise effect. Now, if the stroke mode is enabled, a small smooth is done using a factor depending of the input samples. The values of the smooth effect were provided by @pepeland after several testing.
This commit is contained in:
@@ -1145,6 +1145,16 @@ static void gp_stroke_newfrombuffer(tGPsdata *p)
|
||||
reduce += 0.25f; /* reduce the factor */
|
||||
}
|
||||
}
|
||||
/* If reproject the stroke using Stroke mode, need to apply a smooth because
|
||||
* the reprojection creates small jitter. */
|
||||
if (ts->gpencil_v3d_align & GP_PROJECT_DEPTH_STROKE) {
|
||||
float ifac = (float)brush->gpencil_settings->input_samples / 10.0f;
|
||||
float sfac = interpf(1.0f, 0.2f, ifac);
|
||||
for (i = 0; i < gps->totpoints - 1; i++) {
|
||||
BKE_gpencil_stroke_smooth(gps, i, sfac);
|
||||
BKE_gpencil_stroke_smooth_strength(gps, i, sfac);
|
||||
}
|
||||
}
|
||||
|
||||
/* Simplify adaptive */
|
||||
if ((brush->gpencil_settings->flag & GP_BRUSH_GROUP_SETTINGS) &&
|
||||
|
||||
Reference in New Issue
Block a user