Cleanup: Put all Bump dx/dy code in the beginning here, same as with other nodes.
authorThomas Dinges <blender@dingto.org>
Sat, 21 Feb 2015 11:55:19 +0000 (12:55 +0100)
committerThomas Dinges <blender@dingto.org>
Sat, 21 Feb 2015 11:55:19 +0000 (12:55 +0100)
intern/cycles/render/nodes.cpp

index e82dd540ccd77e77b2a0e4e7cbf79e169066d073..fa6ffffd9b4e56ba9f16cc6b06138a62bb8dc736 100644 (file)
@@ -2192,11 +2192,16 @@ void GeometryNode::compile(SVMCompiler& compiler)
 {
        ShaderOutput *out;
        NodeType geom_node = NODE_GEOMETRY;
+       NodeType attr_node = NODE_ATTR;
 
-       if(bump == SHADER_BUMP_DX)
+       if(bump == SHADER_BUMP_DX) {
                geom_node = NODE_GEOMETRY_BUMP_DX;
-       else if(bump == SHADER_BUMP_DY)
+               attr_node = NODE_ATTR_BUMP_DX;
+       }
+       else if(bump == SHADER_BUMP_DY) {
                geom_node = NODE_GEOMETRY_BUMP_DY;
+               attr_node = NODE_ATTR_BUMP_DY;
+       }
        
        out = output("Position");
        if(!out->links.empty()) {
@@ -2242,13 +2247,6 @@ void GeometryNode::compile(SVMCompiler& compiler)
 
        out = output("Pointiness");
        if(!out->links.empty()) {
-               NodeType attr_node = NODE_ATTR;
-               if(bump == SHADER_BUMP_DX) {
-                       attr_node = NODE_ATTR_BUMP_DX;
-               }
-               else if(bump == SHADER_BUMP_DY) {
-                       attr_node = NODE_ATTR_BUMP_DY;
-               }
                compiler.stack_assign(out);
                compiler.add_node(attr_node,
                                  ATTR_STD_POINTINESS,