Fix wrong scale of vertex color values when doing border render of Cycles viewport
authorSergey Sharybin <sergey.vfx@gmail.com>
Mon, 23 May 2016 12:40:04 +0000 (14:40 +0200)
committerSergey Sharybin <sergey.vfx@gmail.com>
Mon, 23 May 2016 12:40:04 +0000 (14:40 +0200)
source/blender/blenkernel/intern/DerivedMesh.c

index 9c500fad2ca9cdee61bd1b426315e9f5db6a6eff..423b8fade39f11c8c4dfd3fe678b5db416164e97 100644 (file)
@@ -3791,17 +3791,17 @@ void DM_draw_attrib_vertex(DMVertexAttribs *attribs, int a, int index, int vert,
 
        /* vertex colors */
        for (b = 0; b < attribs->totmcol; b++) {
-               GLubyte col[4];
+               GLfloat col[4];
 
                if (attribs->mcol[b].array) {
                        const MLoopCol *cp = &attribs->mcol[b].array[loop];
-                       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;
+                       zero_v4(col);
                }
 
-               glVertexAttrib4ubv(attribs->mcol[b].gl_index, col);
+               glVertexAttrib4fv(attribs->mcol[b].gl_index, col);
        }
 
        /* tangent for normal mapping */