diff options
author | Antony Riakiotakis <kalast@gmail.com> | 2013-05-01 00:57:45 +0400 |
---|---|---|
committer | Antony Riakiotakis <kalast@gmail.com> | 2013-05-01 00:57:45 +0400 |
commit | 8b80b497218edd9dc0e4f063b9fdcf93e3f282a3 (patch) | |
tree | f171a221ca57031931339a9092cce614b8054ebf /source | |
parent | 256a84ea7e1cdbbd8014933b964b67fcb55922b9 (diff) |
Fix: texture alpha masking not functional after recent commits. Mask is
used to see if area has been covered by brush, so exclude the texture
alpha and texture alpha masks from mask comparisons. Coming next:
texture masks for 2d painting.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_image_proj.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_image_proj.c b/source/blender/editors/sculpt_paint/paint_image_proj.c index 2e0ad9e0020..79c41a79042 100644 --- a/source/blender/editors/sculpt_paint/paint_image_proj.c +++ b/source/blender/editors/sculpt_paint/paint_image_proj.c @@ -3833,6 +3833,7 @@ static void *do_projectpaint_thread(void *ph_v) if (falloff > 0.0f) { float texrgb[3]; float mask = falloff; + float mixalpha = 1.0; if (ps->is_texbrush) { MTex *mtex = &brush->mtex; @@ -3852,11 +3853,11 @@ static void *do_projectpaint_thread(void *ph_v) BKE_brush_sample_tex_3D(ps->scene, brush, samplecos, texrgba, thread_index, pool); copy_v3_v3(texrgb, texrgba); - mask *= texrgba[3]; + mixalpha *= texrgba[3]; } if (ps->is_maskbrush) { - mask *= BKE_brush_sample_masktex(ps->scene, ps->brush, projPixel->projCoSS, thread_index, pool); + mixalpha *= BKE_brush_sample_masktex(ps->scene, ps->brush, projPixel->projCoSS, thread_index, pool); } CLAMP(mask, 0.0f, 1.0f); @@ -3924,8 +3925,8 @@ static void *do_projectpaint_thread(void *ph_v) else do_projectpaint_soften(ps, projPixel, mask, softenArena, &softenPixels); break; default: - if (is_floatbuf) do_projectpaint_draw_f(ps, projPixel, texrgb, mask); - else do_projectpaint_draw(ps, projPixel, texrgb, mask); + if (is_floatbuf) do_projectpaint_draw_f(ps, projPixel, texrgb, mask*mixalpha); + else do_projectpaint_draw(ps, projPixel, texrgb, mask*mixalpha); break; } } |