Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2016-06-01 12:52:31 +0300
committerJeroen Bakker <j.bakker@atmind.nl>2016-06-08 22:45:40 +0300
commit6e7b4edab63f4ffe986d6b327aa9bfedab15fd0c (patch)
treeaec2cf1a78b76a349cfcbc178b30e4543cb8a02e
parente563e1c37028b67eb83fbb5a2230adc5d5dc419b (diff)
Fix wrong vertex colors in edit mode
-rw-r--r--source/blender/blenkernel/intern/editderivedmesh.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/blenkernel/intern/editderivedmesh.c b/source/blender/blenkernel/intern/editderivedmesh.c
index 0de4d1b4dd5..fbb5069425c 100644
--- a/source/blender/blenkernel/intern/editderivedmesh.c
+++ b/source/blender/blenkernel/intern/editderivedmesh.c
@@ -1452,15 +1452,15 @@ static void emdm_pass_attrib_vertex_glsl(const DMVertexAttribs *attribs, const B
glUniform1i(attribs->tface[i].gl_info_index, 0);
}
for (i = 0; i < attribs->totmcol; i++) {
- GLubyte col[4];
+ float col[4];
if (attribs->mcol[i].em_offset != -1) {
const MLoopCol *cp = BM_ELEM_CD_GET_VOID_P(loop, attribs->mcol[i].em_offset);
- copy_v4_v4_uchar(col, &cp->r);
+ rgba_uchar_to_float(col, &cp->r);
}
else {
- col[0] = 0; col[1] = 0; col[2] = 0; col[3] = 0;
+ col[0] = 0.0f; col[1] = 0.0f; col[2] = 0.0f; col[3] = 0.0f;
}
- glVertexAttrib4ubv(attribs->mcol[i].gl_index, col);
+ glVertexAttrib4fv(attribs->mcol[i].gl_index, col);
glUniform1i(attribs->mcol[i].gl_info_index, GPU_ATTR_INFO_SRGB);
}