Texture Paint: prevent normal angle masking duplicating backface culling.

If backface culling is off, the user obviously wants to paint on
back faces, so the normal angle cutoff designed to prevent painting
at glancing angles shouldn't do the culling as a side effect.
This commit is contained in:
Alexander Gavrilov 2018-11-25 18:50:21 +03:00
parent 4c3ed98ca2
commit 3135ed376b
1 changed files with 5 additions and 0 deletions

View File

@ -1461,6 +1461,11 @@ static float project_paint_uvpixel_mask(
angle_cos = dot_v3v3(viewDirPersp, no);
}
/* If backface culling is disabled, allow painting on back faces. */
if (!ps->do_backfacecull) {
angle_cos = fabsf(angle_cos);
}
if (angle_cos <= ps->normal_angle__cos) {
return 0.0f; /* outsize the normal limit*/
}