Page MenuHome

BI: Washed out vertex color from material node
Closed, ResolvedPublic

Description

System Information
Win 10 64 bit, Ubuntu, Linux Mint; GTX 560ti, GTX 680, GTX 970

Blender Version
Broken: 2.75a

Short description of error


Vertex color is watched out if previewed and rendered from geometry node in BI.
The vertex color should behave similar to a shadeless material node with vertex color paint turned ON.
Note: Problem confirmed by few artists.

Exact steps for others to reproduce the error
Open file, plug either material node or geometry node to output node.
Blend File:

PS: Please enjoy the ice cream sandwich :D

Revisions and Commits

Event Timeline

WK Bong (lightbwk) raised the priority of this task from to 90.
WK Bong (lightbwk) updated the task description. (Show Details)
WK Bong (lightbwk) added a project: BF Blender.
WK Bong (lightbwk) edited a custom field.
Sergey Sharybin (sergey) lowered the priority of this task from 90 to 50.Aug 24 2015, 11:24 AM

This is most likely a missing vertex color linearization issue in the render pipeline. Will have a look later.

Checked on a fix.

The issue is caused by vertex color being sRGB but its treated as linear in areas.

  • Blender Internal Render (washed out)
  • GLSL view (washed out)
  • Multitexture (OK)

The patch fixes the 2x washed out cases, so they both match multi-texture view.

1diff --git a/source/blender/gpu/shaders/gpu_shader_material.glsl b/source/blender/gpu/shaders/gpu_shader_material.glsl
2index 54864b2..311fcb8 100644
3--- a/source/blender/gpu/shaders/gpu_shader_material.glsl
4+++ b/source/blender/gpu/shaders/gpu_shader_material.glsl
5@@ -149,6 +149,7 @@ void geom(vec3 co, vec3 nor, mat4 viewinvmat, vec3 attorco, vec2 attuv, vec4 att
6 uv_attribute(attuv, uv);
7 normal = -normalize(nor); /* blender render normal is negated */
8 vcol_attribute(attvcol, vcol);
9+ srgb_to_linearrgb(vcol, vcol);
10 vcol_alpha = attvcol.a;
11 frontback = (gl_FrontFacing)? 1.0: 0.0;
12 }
13diff --git a/source/blender/nodes/shader/nodes/node_shader_geom.c b/source/blender/nodes/shader/nodes/node_shader_geom.c
14index 2fb0353..cd52c4e 100644
15--- a/source/blender/nodes/shader/nodes/node_shader_geom.c
16+++ b/source/blender/nodes/shader/nodes/node_shader_geom.c
17@@ -91,7 +91,7 @@ static void node_shader_exec_geom(void *data, int UNUSED(thread), bNode *node, b
18 }
19 }
20
21- copy_v3_v3(out[GEOM_OUT_VCOL]->vec, scol->col);
22+ srgb_to_linearrgb_v3_v3(out[GEOM_OUT_VCOL]->vec, scol->col);
23 out[GEOM_OUT_VCOL]->vec[3] = scol->col[3];
24 out[GEOM_OUT_VCOL_ALPHA]->vec[0] = scol->col[3];
25 }