Fix T87348: convert vertex colors to linear color space

Differential Revision: https://developer.blender.org/D10956
This commit is contained in:
Jacques Lucke 2021-04-12 09:18:35 +02:00
parent 1a4d0fa72d
commit 175c1382da
Notes: blender-bot 2023-02-14 08:33:26 +01:00
Referenced by issue #87348, Geometry Nodes don't convert vertex colors accurately when data is realized
1 changed files with 7 additions and 5 deletions

View File

@ -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)