[Bf-blender-cvs] [b1d02f3] master: Projective painting: Only dither if factor is more than zero

Antony Riakiotakis noreply at git.blender.org
Thu Feb 19 16:48:56 CET 2015


Commit: b1d02f3d576629b9573847ab9a4f52251032cb21
Author: Antony Riakiotakis
Date:   Thu Feb 19 16:46:05 2015 +0100
Branches: master
https://developer.blender.org/rBb1d02f3d576629b9573847ab9a4f52251032cb21

Projective painting: Only dither if factor is more than zero

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

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 15a65cd..1c8e9fe 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);




More information about the Bf-blender-cvs mailing list