From f4f190a399fb1bb17d5d80f5f8951a655ca519c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Foucault?= Date: Thu, 19 Sep 2019 19:39:26 +0200 Subject: Fix T69971 EEVEE: Bump does not work using a UVMap node as input This fixes both the attribute and the uvmap node. Some other nodes are not supported but I think it makes little sense. --- source/blender/nodes/shader/nodes/node_shader_attribute.c | 9 ++++++++- source/blender/nodes/shader/nodes/node_shader_uvmap.c | 6 +++++- 2 files changed, 13 insertions(+), 2 deletions(-) (limited to 'source/blender/nodes/shader') diff --git a/source/blender/nodes/shader/nodes/node_shader_attribute.c b/source/blender/nodes/shader/nodes/node_shader_attribute.c index c92ae28f2e6..ecb8c53c312 100644 --- a/source/blender/nodes/shader/nodes/node_shader_attribute.c +++ b/source/blender/nodes/shader/nodes/node_shader_attribute.c @@ -67,7 +67,14 @@ static int node_shader_gpu_attribute(GPUMaterial *mat, } else { GPUNodeLink *cd_attr = GPU_attribute(CD_AUTO_FROM_NAME, attr->name); - return GPU_stack_link(mat, node, "node_attribute", in, out, cd_attr); + GPU_stack_link(mat, node, "node_attribute", in, out, cd_attr); + + /* for each output. */ + for (int i = 0; sh_node_attribute_out[i].type != -1; i++) { + node_shader_gpu_bump_tex_coord(mat, node, &out[i].link); + } + + return 1; } } diff --git a/source/blender/nodes/shader/nodes/node_shader_uvmap.c b/source/blender/nodes/shader/nodes/node_shader_uvmap.c index 73fb022e476..a2e47735490 100644 --- a/source/blender/nodes/shader/nodes/node_shader_uvmap.c +++ b/source/blender/nodes/shader/nodes/node_shader_uvmap.c @@ -43,7 +43,11 @@ static int node_shader_gpu_uvmap(GPUMaterial *mat, NodeShaderUVMap *attr = node->storage; GPUNodeLink *mtface = GPU_attribute(CD_MTFACE, attr->uv_map); - return GPU_stack_link(mat, node, "node_uvmap", in, out, mtface); + GPU_stack_link(mat, node, "node_uvmap", in, out, mtface); + + node_shader_gpu_bump_tex_coord(mat, node, &out[0].link); + + return 1; } /* node type definition */ -- cgit v1.2.3