diff options
Diffstat (limited to 'intern/cycles/blender/blender_mesh.cpp')
-rw-r--r-- | intern/cycles/blender/blender_mesh.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/intern/cycles/blender/blender_mesh.cpp b/intern/cycles/blender/blender_mesh.cpp index 6fe650f3699..b7d6c1bb36d 100644 --- a/intern/cycles/blender/blender_mesh.cpp +++ b/intern/cycles/blender/blender_mesh.cpp @@ -401,7 +401,8 @@ static void attr_create_vertex_color(Scene *scene, int n = p->loop_total(); for(int i = 0; i < n; i++) { float3 color = get_float3(l->data[p->loop_start() + i].color()); - *(cdata++) = color_float_to_byte(color_srgb_to_scene_linear_v3(color)); + /* Encode vertex color using the sRGB curve. */ + *(cdata++) = color_float_to_byte(color_srgb_to_linear_v3(color)); } } } @@ -424,12 +425,13 @@ static void attr_create_vertex_color(Scene *scene, int tri_a[3], tri_b[3]; face_split_tri_indices(face_flags[i], tri_a, tri_b); + /* Encode vertex color using the sRGB curve. */ uchar4 colors[4]; - colors[0] = color_float_to_byte(color_srgb_to_scene_linear_v3(get_float3(c->color1()))); - colors[1] = color_float_to_byte(color_srgb_to_scene_linear_v3(get_float3(c->color2()))); - colors[2] = color_float_to_byte(color_srgb_to_scene_linear_v3(get_float3(c->color3()))); + colors[0] = color_float_to_byte(color_srgb_to_linear_v3(get_float3(c->color1()))); + colors[1] = color_float_to_byte(color_srgb_to_linear_v3(get_float3(c->color2()))); + colors[2] = color_float_to_byte(color_srgb_to_linear_v3(get_float3(c->color3()))); if(nverts[i] == 4) { - colors[3] = color_float_to_byte(color_srgb_to_scene_linear_v3(get_float3(c->color4()))); + colors[3] = color_float_to_byte(color_srgb_to_linear_v3(get_float3(c->color4()))); } cdata[0] = colors[tri_a[0]]; |