diff options
author | Campbell Barton <ideasman42@gmail.com> | 2015-08-24 18:02:28 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2015-08-24 18:02:28 +0300 |
commit | 3633499f4ea93ad3313afd19a122c5e04b59b066 (patch) | |
tree | af051ef3ceb6c5dc1f60d1d871e0c74d1becbcec /source/blender | |
parent | 46d275b626773d332af5a90c9af50aa6df54e606 (diff) |
Fix T45737: Vertex colors show washed-out
Blender-Internal and GLSL-nodes missed converting sRGB to linear color.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/gpu/shaders/gpu_shader_material.glsl | 1 | ||||
-rw-r--r-- | source/blender/nodes/shader/nodes/node_shader_geom.c | 2 |
2 files changed, 2 insertions, 1 deletions
diff --git a/source/blender/gpu/shaders/gpu_shader_material.glsl b/source/blender/gpu/shaders/gpu_shader_material.glsl index 54864b2b185..311fcb8ead2 100644 --- a/source/blender/gpu/shaders/gpu_shader_material.glsl +++ b/source/blender/gpu/shaders/gpu_shader_material.glsl @@ -149,6 +149,7 @@ void geom(vec3 co, vec3 nor, mat4 viewinvmat, vec3 attorco, vec2 attuv, vec4 att uv_attribute(attuv, uv); normal = -normalize(nor); /* blender render normal is negated */ vcol_attribute(attvcol, vcol); + srgb_to_linearrgb(vcol, vcol); vcol_alpha = attvcol.a; frontback = (gl_FrontFacing)? 1.0: 0.0; } diff --git a/source/blender/nodes/shader/nodes/node_shader_geom.c b/source/blender/nodes/shader/nodes/node_shader_geom.c index 2fb03536bbe..cd52c4e2547 100644 --- a/source/blender/nodes/shader/nodes/node_shader_geom.c +++ b/source/blender/nodes/shader/nodes/node_shader_geom.c @@ -91,7 +91,7 @@ static void node_shader_exec_geom(void *data, int UNUSED(thread), bNode *node, b } } - copy_v3_v3(out[GEOM_OUT_VCOL]->vec, scol->col); + srgb_to_linearrgb_v3_v3(out[GEOM_OUT_VCOL]->vec, scol->col); out[GEOM_OUT_VCOL]->vec[3] = scol->col[3]; out[GEOM_OUT_VCOL_ALPHA]->vec[0] = scol->col[3]; } |