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:
Diffstat (limited to 'source/blender/nodes/intern/SHD_nodes/SHD_normal.c')
-rw-r--r--source/blender/nodes/intern/SHD_nodes/SHD_normal.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/source/blender/nodes/intern/SHD_nodes/SHD_normal.c b/source/blender/nodes/intern/SHD_nodes/SHD_normal.c
index f1ffd3446af..9d4ea1ccf67 100644
--- a/source/blender/nodes/intern/SHD_nodes/SHD_normal.c
+++ b/source/blender/nodes/intern/SHD_nodes/SHD_normal.c
@@ -57,6 +57,14 @@ static void node_shader_exec_normal(void *data, bNode *node, bNodeStack **in, bN
out[1]->vec[0]= -INPR(out[0]->vec, vec);
}
+static int gpu_shader_normal(GPUMaterial *mat, bNode *node, GPUNodeStack *in, GPUNodeStack *out)
+{
+ bNodeSocket *sock= node->outputs.first;
+ GPUNodeLink *vec = GPU_uniform(sock->ns.vec);
+
+ return GPU_stack_link(mat, "normal", in, out, vec);
+}
+
bNodeType sh_node_normal= {
/* *next,*prev */ NULL, NULL,
/* type code */ SH_NODE_NORMAL,
@@ -71,6 +79,7 @@ bNodeType sh_node_normal= {
/* initfunc */ NULL,
/* freestoragefunc */ NULL,
/* copystoragefunc */ NULL,
- /* id */ NULL
+ /* id */ NULL, NULL, NULL,
+ /* gpufunc */ gpu_shader_normal
};