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:
authorAntony Riakiotakis <kalast@gmail.com>2015-05-07 15:49:40 +0300
committerAntony Riakiotakis <kalast@gmail.com>2015-05-07 15:49:40 +0300
commite6a7fdd3092939d4a0a1a08459c464597970427a (patch)
treebbf98e82e72b283f2a5d28cd92412430e7213023
parente39ec27bbaebcb85b2541e9756b408c554f602cb (diff)
Fix T44627, black spots with lock alpha in projection paint:
Painting would revert alpha even on unpainted pixels, where values would contain garbage.
-rw-r--r--source/blender/editors/sculpt_paint/paint_image_proj.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_image_proj.c b/source/blender/editors/sculpt_paint/paint_image_proj.c
index 6f34db4e424..00fac6b1c8e 100644
--- a/source/blender/editors/sculpt_paint/paint_image_proj.c
+++ b/source/blender/editors/sculpt_paint/paint_image_proj.c
@@ -4837,18 +4837,18 @@ static void *do_projectpaint_thread(void *ph_v)
else do_projectpaint_draw(ps, projPixel, texrgb, mask, ps->dither, projPixel->x_px, projPixel->y_px);
break;
}
- }
- if (lock_alpha) {
- if (is_floatbuf) {
- /* slightly more involved case since floats are in premultiplied space we need
- * to make sure alpha is consistent, see T44627 */
- float rgb_straight[4];
- premul_to_straight_v4_v4(rgb_straight, projPixel->pixel.f_pt);
- rgb_straight[3] = projPixel->origColor.f_pt[3];
- straight_to_premul_v4_v4(projPixel->pixel.f_pt, rgb_straight);
+ if (lock_alpha) {
+ if (is_floatbuf) {
+ /* slightly more involved case since floats are in premultiplied space we need
+ * to make sure alpha is consistent, see T44627 */
+ float rgb_straight[4];
+ premul_to_straight_v4_v4(rgb_straight, projPixel->pixel.f_pt);
+ rgb_straight[3] = projPixel->origColor.f_pt[3];
+ straight_to_premul_v4_v4(projPixel->pixel.f_pt, rgb_straight);
+ }
+ else projPixel->pixel.ch_pt[3] = projPixel->origColor.ch_pt[3];
}
- else projPixel->pixel.ch_pt[3] = projPixel->origColor.ch_pt[3];
}
/* done painting */