diff options
author | Jacques Lucke <jacques@blender.org> | 2021-04-12 10:18:35 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2021-04-12 10:18:35 +0300 |
commit | 175c1382da4d0079209d6e2adedc7c408f327a21 (patch) | |
tree | 614179f8d47af447a3214b61dd170e571755632e /source | |
parent | 1a4d0fa72d83bf6c7413d70172766801976c1671 (diff) |
Fix T87348: convert vertex colors to linear color space
Differential Revision: https://developer.blender.org/D10956
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenkernel/intern/geometry_component_mesh.cc | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/source/blender/blenkernel/intern/geometry_component_mesh.cc b/source/blender/blenkernel/intern/geometry_component_mesh.cc index df451b5db1d..150cc4589c8 100644 --- a/source/blender/blenkernel/intern/geometry_component_mesh.cc +++ b/source/blender/blenkernel/intern/geometry_component_mesh.cc @@ -814,14 +814,16 @@ static void set_loop_uv(MLoopUV &uv, const float2 &co) static Color4f get_loop_color(const MLoopCol &col) { - Color4f value; - rgba_uchar_to_float(value, &col.r); - return value; + Color4f srgb_color; + rgba_uchar_to_float(srgb_color, &col.r); + Color4f linear_color; + srgb_to_linearrgb_v4(linear_color, srgb_color); + return linear_color; } -static void set_loop_color(MLoopCol &col, const Color4f &value) +static void set_loop_color(MLoopCol &col, const Color4f &linear_color) { - rgba_float_to_uchar(&col.r, value); + linearrgb_to_srgb_uchar4(&col.r, linear_color); } static float get_crease(const MEdge &edge) |