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:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2013-06-05 19:54:39 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2013-06-05 19:54:39 +0400
commite66f3eb499eed2121b63c7189c81453315e7611e (patch)
tree2c3ba25138bfa2a4f05abaadf6faf3583a73c9a0 /source/blender/nodes
parent32f35056af6909610c563dcca8f9b11b55acbe40 (diff)
Cycles: GLSL materials now can use multiple UV maps with the attribute node.
Diffstat (limited to 'source/blender/nodes')
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_attribute.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/source/blender/nodes/shader/nodes/node_shader_attribute.c b/source/blender/nodes/shader/nodes/node_shader_attribute.c
index d525393f09f..608595a6fdb 100644
--- a/source/blender/nodes/shader/nodes/node_shader_attribute.c
+++ b/source/blender/nodes/shader/nodes/node_shader_attribute.c
@@ -42,6 +42,14 @@ static void node_shader_init_attribute(bNodeTree *UNUSED(ntree), bNode *node)
node->storage = attr;
}
+static int node_shader_gpu_attribute(GPUMaterial *mat, bNode *node, bNodeExecData *UNUSED(execdata), GPUNodeStack *in, GPUNodeStack *out)
+{
+ NodeShaderAttribute *attr = node->storage;
+ GPUNodeLink *mtface = GPU_attribute(CD_MTFACE, attr->name);
+
+ return GPU_stack_link(mat, "node_attribute", in, out, mtface);
+}
+
/* node type definition */
void register_node_type_sh_attribute(void)
{
@@ -52,6 +60,8 @@ void register_node_type_sh_attribute(void)
node_type_socket_templates(&ntype, NULL, sh_node_attribute_out);
node_type_init(&ntype, node_shader_init_attribute);
node_type_storage(&ntype, "NodeShaderAttribute", node_free_standard_storage, node_copy_standard_storage);
+ node_type_gpu(&ntype, node_shader_gpu_attribute);
nodeRegisterType(&ntype);
}
+