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-05-31 15:39:49 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2016-05-31 15:41:51 +0300
commite9c8917e10dfada55aa0aefcde9f7098a0e8e3c7 (patch)
treee809c6d4c1f56293a0d4baf2f3b6e9c14aeaeaf2 /source/blender/blenkernel/intern/editderivedmesh.c
parent19cfc84328ba8b658c2518721dee253cb93432c2 (diff)
Properly handle vertex color color space for Cycles GLSL
A bit tricky, need to pass additional information about what the attribute is and how to deal with it. BI path stays unchanged, just to make things simplier for now. Fixes T48555: Cycles GLSL- Incorrect Vertex Color results from Attribute node
Diffstat (limited to 'source/blender/blenkernel/intern/editderivedmesh.c')
-rw-r--r--source/blender/blenkernel/intern/editderivedmesh.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/editderivedmesh.c b/source/blender/blenkernel/intern/editderivedmesh.c
index 6c117447664..0de4d1b4dd5 100644
--- a/source/blender/blenkernel/intern/editderivedmesh.c
+++ b/source/blender/blenkernel/intern/editderivedmesh.c
@@ -57,6 +57,7 @@
#include "MEM_guardedalloc.h"
#include "GPU_glew.h"
+#include "GPU_buffers.h"
#include "GPU_shader.h"
#include "GPU_basic_shader.h"
@@ -1431,6 +1432,7 @@ static void emdm_pass_attrib_vertex_glsl(const DMVertexAttribs *attribs, const B
glTexCoord3fv(orco);
else
glVertexAttrib3fv(attribs->orco.gl_index, orco);
+ glUniform1i(attribs->orco.gl_info_index, 0);
}
for (i = 0; i < attribs->tottface; i++) {
const float *uv;
@@ -1447,6 +1449,7 @@ static void emdm_pass_attrib_vertex_glsl(const DMVertexAttribs *attribs, const B
glTexCoord2fv(uv);
else
glVertexAttrib2fv(attribs->tface[i].gl_index, uv);
+ glUniform1i(attribs->tface[i].gl_info_index, 0);
}
for (i = 0; i < attribs->totmcol; i++) {
GLubyte col[4];
@@ -1458,6 +1461,7 @@ static void emdm_pass_attrib_vertex_glsl(const DMVertexAttribs *attribs, const B
col[0] = 0; col[1] = 0; col[2] = 0; col[3] = 0;
}
glVertexAttrib4ubv(attribs->mcol[i].gl_index, col);
+ glUniform1i(attribs->mcol[i].gl_info_index, GPU_ATTR_INFO_SRGB);
}
for (i = 0; i < attribs->tottang; i++) {
@@ -1469,6 +1473,7 @@ static void emdm_pass_attrib_vertex_glsl(const DMVertexAttribs *attribs, const B
tang = zero;
}
glVertexAttrib4fv(attribs->tang[i].gl_index, tang);
+ glUniform1i(attribs->tang[i].gl_info_index, 0);
}
}