[Bf-blender-cvs] [f4f190a399f] master: Fix T69971 EEVEE: Bump does not work using a UVMap node as input

Clément Foucault noreply at git.blender.org
Thu Sep 19 19:43:30 CEST 2019


Commit: f4f190a399fb1bb17d5d80f5f8951a655ca519c6
Author: Clément Foucault
Date:   Thu Sep 19 19:39:26 2019 +0200
Branches: master
https://developer.blender.org/rBf4f190a399fb1bb17d5d80f5f8951a655ca519c6

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.

===================================================================

M	source/blender/nodes/shader/nodes/node_shader_attribute.c
M	source/blender/nodes/shader/nodes/node_shader_uvmap.c

===================================================================

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 */



More information about the Bf-blender-cvs mailing list