[Bf-blender-cvs] [3633499] master: Fix T45737: Vertex colors show washed-out

Campbell Barton noreply at git.blender.org
Mon Aug 24 17:09:03 CEST 2015


Commit: 3633499f4ea93ad3313afd19a122c5e04b59b066
Author: Campbell Barton
Date:   Tue Aug 25 01:02:28 2015 +1000
Branches: master
https://developer.blender.org/rB3633499f4ea93ad3313afd19a122c5e04b59b066

Fix T45737: Vertex colors show washed-out

Blender-Internal and GLSL-nodes missed converting sRGB to linear color.

===================================================================

M	source/blender/gpu/shaders/gpu_shader_material.glsl
M	source/blender/nodes/shader/nodes/node_shader_geom.c

===================================================================

diff --git a/source/blender/gpu/shaders/gpu_shader_material.glsl b/source/blender/gpu/shaders/gpu_shader_material.glsl
index 54864b2..311fcb8 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 2fb0353..cd52c4e 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];
 		}




More information about the Bf-blender-cvs mailing list