diff options
author | Joseph Eagar <joeedh@gmail.com> | 2022-05-12 11:29:42 +0300 |
---|---|---|
committer | Joseph Eagar <joeedh@gmail.com> | 2022-05-12 11:29:42 +0300 |
commit | 31202ea628d2da2a5a2e6494d12bf32b7886f4cf (patch) | |
tree | 2d2c195eaf36a789d067916014c42a1010d0c26a /source | |
parent | 59637cf0732a7b085626a8ea2e196710b43c8976 (diff) | |
parent | 0eb2244f0ae785aec08e608458804b780ea4957b (diff) |
Merge branch 'blender-v3.2-release'
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/gpu/intern/gpu_node_graph.c | 2 | ||||
-rw-r--r-- | source/blender/nodes/shader/nodes/node_shader_vertex_color.cc | 16 |
2 files changed, 15 insertions, 3 deletions
diff --git a/source/blender/gpu/intern/gpu_node_graph.c b/source/blender/gpu/intern/gpu_node_graph.c index b3a091ffbb0..91fb0544cf6 100644 --- a/source/blender/gpu/intern/gpu_node_graph.c +++ b/source/blender/gpu/intern/gpu_node_graph.c @@ -333,6 +333,8 @@ static char attr_prefix_get(CustomDataType type) switch (type) { case CD_TANGENT: return 't'; + case CD_MCOL: + return 'c'; case CD_AUTO_FROM_NAME: return 'a'; case CD_HAIRLENGTH: diff --git a/source/blender/nodes/shader/nodes/node_shader_vertex_color.cc b/source/blender/nodes/shader/nodes/node_shader_vertex_color.cc index a2a9aa9ad91..cba944c671c 100644 --- a/source/blender/nodes/shader/nodes/node_shader_vertex_color.cc +++ b/source/blender/nodes/shader/nodes/node_shader_vertex_color.cc @@ -42,10 +42,20 @@ static int node_shader_gpu_vertex_color(GPUMaterial *mat, GPUNodeStack *out) { NodeShaderVertexColor *vertexColor = (NodeShaderVertexColor *)node->storage; - /* NOTE: using CD_AUTO_FROM_NAME instead of CD_MCOL or CD_PROP_COLOR as geometry nodes may - * overwrite data which will also change the CustomDataType. This will also make EEVEE and Cycles + /* NOTE: using CD_AUTO_FROM_NAME instead of CD_MCOL or CD_PROP_COLOR for named attributes + * as geometry nodes may overwrite data which will also change the CustomDataType. + * This will also make EEVEE and Cycles * consistent. See T93179. */ - GPUNodeLink *vertexColorLink = GPU_attribute(mat, CD_AUTO_FROM_NAME, vertexColor->layer_name); + + GPUNodeLink *vertexColorLink; + + if (vertexColor->layer_name[0]) { + vertexColorLink = GPU_attribute(mat, CD_AUTO_FROM_NAME, vertexColor->layer_name); + } + else { /* Fall back on active render color attribute. */ + vertexColorLink = GPU_attribute(mat, CD_MCOL, vertexColor->layer_name); + } + return GPU_stack_link(mat, node, "node_vertex_color", in, out, vertexColorLink); } |