From b1d02f3d576629b9573847ab9a4f52251032cb21 Mon Sep 17 00:00:00 2001 From: Antony Riakiotakis Date: Thu, 19 Feb 2015 16:46:05 +0100 Subject: Projective painting: Only dither if factor is more than zero --- source/blender/editors/sculpt_paint/paint_image_proj.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'source') diff --git a/source/blender/editors/sculpt_paint/paint_image_proj.c b/source/blender/editors/sculpt_paint/paint_image_proj.c index 15a65cd3e3a..1c8e9fedd73 100644 --- a/source/blender/editors/sculpt_paint/paint_image_proj.c +++ b/source/blender/editors/sculpt_paint/paint_image_proj.c @@ -4299,7 +4299,12 @@ static void do_projectpaint_draw(ProjPaintState *ps, ProjPixel *projPixel, const copy_v3_v3(rgb, ps->paint_color); } - float_to_byte_dither_v3(rgba_ub, rgb, dither, u, v); + if (dither > 0.0f) { + float_to_byte_dither_v3(rgba_ub, rgb, dither, u, v); + } + else { + F3TOCHAR3(rgb, rgba_ub); + } rgba_ub[3] = f_to_char(mask); if (ps->do_masking) { @@ -4489,7 +4494,13 @@ static void *do_projectpaint_thread(void *ph_v) } else { linearrgb_to_srgb_v3_v3(color_f, color_f); - float_to_byte_dither_v3(projPixel->newColor.ch, color_f, ps->dither, projPixel->x_px, projPixel->y_px); + + if (ps->dither > 0.0f) { + float_to_byte_dither_v3(projPixel->newColor.ch, color_f, ps->dither, projPixel->x_px, projPixel->y_px); + } + else { + F3TOCHAR3(color_f, projPixel->newColor.ch); + } projPixel->newColor.ch[3] = FTOCHAR(color_f[3]); IMB_blend_color_byte(projPixel->pixel.ch_pt, projPixel->origColor.ch_pt, projPixel->newColor.ch, ps->blend); -- cgit v1.2.3