diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2018-08-01 23:08:08 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2018-08-01 23:08:36 +0300 |
commit | 504454ee5ec608de89b07476a8abb91b70ca12a2 (patch) | |
tree | de6f67f1505b2a274e6679d5ad9348c57bd1173f | |
parent | 48e661e05de59a055a261430e877f7d8bc4d4c5f (diff) |
GPUMaterial: Normal Map Node: Make default inputs interactives
-rw-r--r-- | source/blender/nodes/shader/nodes/node_shader_normal_map.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/source/blender/nodes/shader/nodes/node_shader_normal_map.c b/source/blender/nodes/shader/nodes/node_shader_normal_map.c index 3c0fb145987..e4b5aaef72d 100644 --- a/source/blender/nodes/shader/nodes/node_shader_normal_map.c +++ b/source/blender/nodes/shader/nodes/node_shader_normal_map.c @@ -63,11 +63,21 @@ static int gpu_shader_normal_map(GPUMaterial *mat, bNode *node, bNodeExecData *U if (in[0].link) strength = in[0].link; + else if (node->original) { + bNodeSocket *socket = BLI_findlink(&node->original->inputs, 0); + bNodeSocketValueFloat *socket_data = socket->default_value; + strength = GPU_uniform_buffer(&socket_data->value, GPU_FLOAT); + } else strength = GPU_uniform(in[0].vec); if (in[1].link) realnorm = in[1].link; + else if (node->original) { + bNodeSocket *socket = BLI_findlink(&node->original->inputs, 1); + bNodeSocketValueRGBA *socket_data = socket->default_value; + realnorm = GPU_uniform_buffer(socket_data->value, GPU_VEC3); + } else realnorm = GPU_uniform(in[1].vec); |