diff options
Diffstat (limited to 'source/blender/blenkernel/intern/DerivedMesh.c')
-rw-r--r-- | source/blender/blenkernel/intern/DerivedMesh.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/DerivedMesh.c b/source/blender/blenkernel/intern/DerivedMesh.c index 7d5a6118100..c00218f8145 100644 --- a/source/blender/blenkernel/intern/DerivedMesh.c +++ b/source/blender/blenkernel/intern/DerivedMesh.c @@ -924,8 +924,12 @@ static void weightpaint_color(unsigned char r_col[4], ColorBand *coba, const flo weight_to_rgb(colf, input); } - rgb_float_to_uchar(r_col, colf); - r_col[3] = 255; /* really redundant */ + /* don't use rgb_float_to_uchar() here because + * the resulting float doesn't need 0-1 clamp check */ + r_col[0] = (unsigned char)(colf[0] * 255.0f); + r_col[1] = (unsigned char)(colf[1] * 255.0f); + r_col[2] = (unsigned char)(colf[2] * 255.0f); + r_col[3] = 255; } |