Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Gavrilov <angavrilov@gmail.com>2018-11-25 18:50:21 +0300
committerAlexander Gavrilov <angavrilov@gmail.com>2018-11-25 18:51:36 +0300
commit3135ed376bba357f3a41f7025db3fb79fd6c0f61 (patch)
treed28dc16c377f734a771497a4914582ca7daa16c2 /source/blender/editors/sculpt_paint/paint_image_proj.c
parent4c3ed98ca27667c3403361199096e31eaa93cce2 (diff)
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.
Diffstat (limited to 'source/blender/editors/sculpt_paint/paint_image_proj.c')
-rw-r--r--source/blender/editors/sculpt_paint/paint_image_proj.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_image_proj.c b/source/blender/editors/sculpt_paint/paint_image_proj.c
index 6ef4a230a57..f3af52f4f47 100644
--- a/source/blender/editors/sculpt_paint/paint_image_proj.c
+++ b/source/blender/editors/sculpt_paint/paint_image_proj.c
@@ -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*/
}