forked from bartvdbraak/blender
fix a glitch where overlapping feathering could give random bad pixels, this was caused by feather edge going in a different direction to the mask edge - creating bowtie quads.
This commit is contained in:
parent
ab1badf9a2
commit
7cfe6e0fda
@ -1991,8 +1991,13 @@ void barycentric_weights_v2(const float v1[2], const float v2[2], const float v3
|
|||||||
void barycentric_weights_v2_quad(const float v1[2], const float v2[2], const float v3[2], const float v4[2],
|
void barycentric_weights_v2_quad(const float v1[2], const float v2[2], const float v3[2], const float v4[2],
|
||||||
const float co[2], float w[4])
|
const float co[2], float w[4])
|
||||||
{
|
{
|
||||||
#define MEAN_VALUE_HALF_TAN_V2(_area, i1, i2) ((_area = cross_v2v2(dirs[i1], dirs[i2])) != 0.0f ? \
|
/* note: fabsf() here is not needed for convex quads (and not used in interp_weights_poly_v2).
|
||||||
(((lens[i1] * lens[i2]) - dot_v2v2(dirs[i1], dirs[i2])) / _area) : 0.0f)
|
* but in the case of concave/bowtie quads for the mask rasterizer it gives unreliable results
|
||||||
|
* without adding absf(). If this becomes an issue for more general useage we could have
|
||||||
|
* this optional or use a different function - Campbell */
|
||||||
|
#define MEAN_VALUE_HALF_TAN_V2(_area, i1, i2) \
|
||||||
|
((_area = cross_v2v2(dirs[i1], dirs[i2])) != 0.0f ? \
|
||||||
|
fabsf(((lens[i1] * lens[i2]) - dot_v2v2(dirs[i1], dirs[i2])) / _area) : 0.0f)
|
||||||
|
|
||||||
float wtot, area;
|
float wtot, area;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user