[Bf-blender-cvs] [3135ed376bb] blender2.8: Texture Paint: prevent normal angle masking duplicating backface culling.

Alexander Gavrilov noreply at git.blender.org
Sun Nov 25 17:07:15 CET 2018


Commit: 3135ed376bba357f3a41f7025db3fb79fd6c0f61
Author: Alexander Gavrilov
Date:   Sun Nov 25 18:50:21 2018 +0300
Branches: blender2.8
https://developer.blender.org/rB3135ed376bba357f3a41f7025db3fb79fd6c0f61

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.

===================================================================

M	source/blender/editors/sculpt_paint/paint_image_proj.c

===================================================================

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*/
 		}



More information about the Bf-blender-cvs mailing list