Cycles: Anisotropic BSDF enabled, with tangents now computed from the active UV map.
authorBrecht Van Lommel <brechtvanlommel@pandora.be>
Wed, 10 Oct 2012 13:02:20 +0000 (13:02 +0000)
committerBrecht Van Lommel <brechtvanlommel@pandora.be>
Wed, 10 Oct 2012 13:02:20 +0000 (13:02 +0000)
It's using the Ward BSDF currently, which has some energy loss so might be a bit
dark. More/better BSDF options can be implemented later.

Patch by Mike Farnsworth, some modifications by me. Currently it's not possible yet
to set a custom tangent, that will follow as part of per-bsdf normals patch.

21 files changed:
intern/cycles/blender/blender_mesh.cpp
intern/cycles/blender/blender_shader.cpp
intern/cycles/kernel/kernel_montecarlo.h
intern/cycles/kernel/kernel_shader.h
intern/cycles/kernel/kernel_types.h
intern/cycles/kernel/svm/bsdf_ward.h
intern/cycles/kernel/svm/svm.h
intern/cycles/kernel/svm/svm_closure.h
intern/cycles/kernel/svm/svm_geometry.h
intern/cycles/kernel/svm/svm_types.h
intern/cycles/render/attribute.cpp
intern/cycles/render/graph.cpp
intern/cycles/render/graph.h
intern/cycles/render/nodes.cpp
intern/cycles/render/nodes.h
intern/cycles/util/util_types.h
source/blender/blenkernel/intern/node.c
source/blender/makesrna/intern/rna_nodetree_types.h
source/blender/nodes/CMakeLists.txt
source/blender/nodes/NOD_shader.h
source/blender/nodes/shader/nodes/node_shader_bsdf_anisotropic.c

index 9764f24a89356667baa47caf44f35c4f28d850b3..8f737be9765ab4e289b5f09638df2795a3cb62d1 100644 (file)
@@ -33,6 +33,28 @@ CCL_NAMESPACE_BEGIN
 
 /* Find/Add */
 
+static float3 tri_calc_tangent(float3 v0, float3 v1, float3 v2, float3 tx0, float3 tx1, float3 tx2)
+{
+       float3 duv1 = tx2 - tx0;
+       float3 duv2 = tx2 - tx1;
+       float3 dp1 = v2 - v0;
+       float3 dp2 = v2 - v1;
+       float det = duv1[0] * duv2[1] - duv1[1] * duv2[0];
+
+       if(det != 0.0f) {
+               return normalize(dp1 * duv2[1] - dp2 * duv1[1]);
+       }
+       else {
+               /* give back a sane default, using a valid edge as a fallback */
+               float3 edge = v1 - v0;
+
+               if(len(edge) == 0.0f)
+                       edge = v2 - v0;
+
+               return normalize(edge);
+       }
+}
+
 static void create_mesh(Scene *scene, Mesh *mesh, BL::Mesh b_mesh, const vector<uint>& used_shaders)
 {
        /* create vertices */
@@ -157,6 +179,67 @@ static void create_mesh(Scene *scene, Mesh *mesh, BL::Mesh b_mesh, const vector<
                        }
                }
        }
+
+       /* create texcoord-based tangent attributes */
+       {
+               BL::Mesh::tessface_uv_textures_iterator l;
+
+               for(b_mesh.tessface_uv_textures.begin(l); l != b_mesh.tessface_uv_textures.end(); ++l) {
+                       AttributeStandard std = (l->active_render())? ATTR_STD_TANGENT: ATTR_STD_NONE;
+
+                       if(!mesh->need_attribute(scene, std))
+                               continue;
+
+                       Attribute *attr = mesh->attributes.add(std, ustring("Tangent"));
+
+                       /* compute average tangents per vertex */
+                       float3 *tangents = attr->data_float3();
+                       memset(tangents, 0, sizeof(float3)*mesh->verts.size());
+
+                       BL::MeshTextureFaceLayer::data_iterator t;
+
+                       size_t fi = 0; /* face index */
+                       b_mesh.tessfaces.begin(f);
+                       for(l->data.begin(t); t != l->data.end() && f != b_mesh.tessfaces.end(); ++t, ++fi, ++f) {
+                               int4 vi = get_int4(f->vertices_raw());
+
+                               float3 tx0 = get_float3(t->uv1());
+                               float3 tx1 = get_float3(t->uv2());
+                               float3 tx2 = get_float3(t->uv3());
+
+                               float3 v0 = mesh->verts[vi[0]];
+                               float3 v1 = mesh->verts[vi[1]];
+                               float3 v2 = mesh->verts[vi[2]];
+
+                               /* calculate tangent for the triangle;
+                                * get vertex positions, and find change in position with respect
+                                * to the texture coords in the first texture coord dimension */
+                               float3 tangent0 = tri_calc_tangent(v0, v1, v2, tx0, tx1, tx2);
+
+                               if(nverts[fi] == 4) {
+                                       /* quad tangent */
+                                       float3 tx3 = get_float3(t->uv4());
+                                       float3 v3 = mesh->verts[vi[3]];
+                                       float3 tangent1 = tri_calc_tangent(v0, v2, v3, tx0, tx2, tx3);
+
+                                       tangents[vi[0]] += 0.5f*(tangent0 + tangent1);
+                                       tangents[vi[1]] += tangent0;
+                                       tangents[vi[2]] += 0.5f*(tangent0 + tangent1);
+                                       tangents[vi[3]] += tangent1;
+                               }
+                               else {
+                                       /* triangle tangent */
+                                       tangents[vi[0]] += tangent0;
+                                       tangents[vi[1]] += tangent0;
+                                       tangents[vi[2]] += tangent0;
+                               }
+                       }
+
+                       /* normalize tangent vectors */
+                       for(int i = 0; i < mesh->verts.size(); i++)
+                               tangents[i] = normalize(tangents[i]);
+               }
+       }
 }
 
 static void create_subd_mesh(Mesh *mesh, BL::Mesh b_mesh, PointerRNA *cmesh, const vector<uint>& used_shaders)
index b6d5cc623bb58691def0f64bd8db219b69f33cb4..5654861364795867178dca80be33685f6c2b7b7b 100644 (file)
@@ -315,6 +315,10 @@ static ShaderNode *add_node(BL::BlendData b_data, BL::Scene b_scene, ShaderGraph
                        node = new HoldoutNode();
                        break;
                }
+               case BL::ShaderNode::type_BSDF_ANISOTROPIC: {
+                       node = new WardBsdfNode();
+                       break;
+               }
                case BL::ShaderNode::type_BSDF_DIFFUSE: {
                        node = new DiffuseBsdfNode();
                        break;
index d0b588a88d455e428a5009b8fe52a7afd5f3c786..48d1aa64c9fec0987d97c9479c8881290dd925a5 100644 (file)
@@ -72,7 +72,7 @@ __device void to_unit_disk(float *x, float *y)
 
 __device void make_orthonormals_tangent(const float3 N, const float3 T, float3 *a, float3 *b)
 {
-       *b = cross(N, T);
+       *b = normalize(cross(N, T));
        *a = cross(*b, N);
 }
 
index ee4460a8541c842edb4a16016b4a5479bf01f203..1ed5e3d352ccac3683ade1fc3c32df1754da8ac7 100644 (file)
@@ -93,6 +93,7 @@ __device_inline void shader_setup_from_ray(KernelGlobals *kg, ShaderData *sd,
 #ifdef __DPDU__
        /* dPdu/dPdv */
        triangle_dPdudv(kg, &sd->dPdu, &sd->dPdv, sd->prim);
+       sd->T = make_float3(0.0f, 0.0f, 0.0f);
 #endif
 
 #ifdef __INSTANCING__
@@ -117,6 +118,7 @@ __device_inline void shader_setup_from_ray(KernelGlobals *kg, ShaderData *sd,
 #ifdef __DPDU__
                sd->dPdu = -sd->dPdu;
                sd->dPdv = -sd->dPdv;
+               sd->T = make_float3(0.0f, 0.0f, 0.0f);
 #endif
        }
 
@@ -208,6 +210,8 @@ __device void shader_setup_from_sample(KernelGlobals *kg, ShaderData *sd,
                }
 #endif
        }
+
+       sd->T = make_float3(0.0f, 0.0f, 0.0f);
 #endif
 
        /* backfacing test */
@@ -293,6 +297,7 @@ __device_inline void shader_setup_from_background(KernelGlobals *kg, ShaderData
        /* dPdu/dPdv */
        sd->dPdu = make_float3(0.0f, 0.0f, 0.0f);
        sd->dPdv = make_float3(0.0f, 0.0f, 0.0f);
+       sd->T = make_float3(0.0f, 0.0f, 0.0f);
 #endif
 
 #ifdef __RAY_DIFFERENTIALS__
index b290d4c42d937be123ec1aef5dfbc241c3fac892..ae9b0ac6d990bc80726653a761587256fcd7c6b7 100644 (file)
@@ -447,6 +447,9 @@ typedef struct ShaderData {
        /* differential of P w.r.t. parametric coordinates. note that dPdu is
         * not readily suitable as a tangent for shading on triangles. */
        float3 dPdu, dPdv;
+
+       /* tangent for shading */
+       float3 T;
 #endif
 
 #ifdef __MULTI_CLOSURE__
index 6ae45948a73b6c91e9c742083a0998f6cbf35d91..56b8ad72c895fbcc9d02f0684c318b5ffb7ed92a 100644 (file)
@@ -67,7 +67,7 @@ __device float3 bsdf_ward_eval_reflect(const ShaderData *sd, const ShaderClosure
        float m_ax = sc->data0;
        float m_ay = sc->data1;
        float3 m_N = sd->N;
-       float3 m_T = normalize(sd->dPdu);
+       float3 m_T = sd->T;
 
        float cosNO = dot(m_N, I);
        float cosNI = dot(m_N, omega_in);
@@ -90,6 +90,7 @@ __device float3 bsdf_ward_eval_reflect(const ShaderData *sd, const ShaderClosure
                *pdf = exp_val / denom;
                return make_float3 (out, out, out);
        }
+
        return make_float3 (0, 0, 0);
 }
 
@@ -108,7 +109,7 @@ __device int bsdf_ward_sample(const ShaderData *sd, const ShaderClosure *sc, flo
        float m_ax = sc->data0;
        float m_ay = sc->data1;
        float3 m_N = sd->N;
-       float3 m_T = normalize(sd->dPdu);
+       float3 m_T = sd->T;
 
        float cosNO = dot(m_N, sd->I);
        if(cosNO > 0) {
index 5b0f192ea478c337ea8fb2f80c03ca458f07af90..e5167a4f6703c14390236b9189ce5dc1cc264ce4 100644 (file)
@@ -205,6 +205,14 @@ __device_noinline void svm_eval_nodes(KernelGlobals *kg, ShaderData *sd, ShaderT
                        case NODE_CLOSURE_WEIGHT:
                                svm_node_closure_weight(sd, stack, node.y);
                                break;
+#ifdef __DPDU__
+                       case NODE_CLOSURE_SET_TANGENT:
+                               svm_node_closure_set_tangent(sd, node.y, node.z, node.w);
+                               break;
+                       case NODE_CLOSURE_TANGENT:
+                               svm_node_closure_tangent(sd, stack, node.y);
+                               break;
+#endif
                        case NODE_EMISSION_WEIGHT:
                                svm_node_emission_weight(kg, sd, stack, node);
                                break;
@@ -261,14 +269,14 @@ __device_noinline void svm_eval_nodes(KernelGlobals *kg, ShaderData *sd, ShaderT
                                svm_node_camera(kg, sd, stack, node.y, node.z, node.w);
                                break;
                        case NODE_GEOMETRY:
-                               svm_node_geometry(sd, stack, node.y, node.z);
+                               svm_node_geometry(kg, sd, stack, node.y, node.z);
                                break;
 #ifdef __EXTRA_NODES__
                        case NODE_GEOMETRY_BUMP_DX:
-                               svm_node_geometry_bump_dx(sd, stack, node.y, node.z);
+                               svm_node_geometry_bump_dx(kg, sd, stack, node.y, node.z);
                                break;
                        case NODE_GEOMETRY_BUMP_DY:
-                               svm_node_geometry_bump_dy(sd, stack, node.y, node.z);
+                               svm_node_geometry_bump_dy(kg, sd, stack, node.y, node.z);
                                break;
                        case NODE_LIGHT_PATH:
                                svm_node_light_path(sd, stack, node.y, node.z, path_flag);
index 935504026ef60e41832447802acd28a845fef30b..c942d50908c611c4907e302e93c0f1cb8a02deed 100644 (file)
@@ -179,7 +179,7 @@ __device void svm_node_closure_bsdf(KernelGlobals *kg, ShaderData *sd, float *st
                        float roughness_u = param1;
                        float roughness_v = param2;
 
-                       bsdf_ward_setup(sd, sc, normalize(sd->dPdu), roughness_u, roughness_v);
+                       bsdf_ward_setup(sd, sc, normalize(sd->T), roughness_u, roughness_v);
                        break;
                }
 #endif
@@ -425,5 +425,24 @@ __device void svm_node_add_closure(ShaderData *sd, float *stack, uint unused,
 #endif
 }
 
+#ifdef __DPDU__
+__device_inline void svm_node_closure_store_tangent(ShaderData *sd, float3 tangent)
+{
+       sd->T = normalize(tangent);
+}
+
+__device void svm_node_closure_set_tangent(ShaderData *sd, uint x, uint y, uint z)
+{
+       float3 tangent = make_float3(__int_as_float(x), __int_as_float(y), __int_as_float(z));
+       svm_node_closure_store_tangent(sd, tangent);
+}
+
+__device void svm_node_closure_tangent(ShaderData *sd, float *stack, uint tangent_offset)
+{
+       float3 tangent = stack_load_float3(stack, tangent_offset);
+       svm_node_closure_store_tangent(sd, tangent);
+}
+#endif
+
 CCL_NAMESPACE_END
 
index 22741bdb067c1bfc5e15b3913f0ffbbbc5cad6e9..582c079fd6a74c16410ae8e9ce1d8e5c847cfbde 100644 (file)
@@ -20,7 +20,7 @@ CCL_NAMESPACE_BEGIN
 
 /* Geometry Node */
 
-__device void svm_node_geometry(ShaderData *sd, float *stack, uint type, uint out_offset)
+__device void svm_node_geometry(KernelGlobals *kg, ShaderData *sd, float *stack, uint type, uint out_offset)
 {
        float3 data;
 
@@ -28,7 +28,16 @@ __device void svm_node_geometry(ShaderData *sd, float *stack, uint type, uint ou
                case NODE_GEOM_P: data = sd->P; break;
                case NODE_GEOM_N: data = sd->N; break;
 #ifdef __DPDU__
-               case NODE_GEOM_T: data = normalize(sd->dPdu); break;
+               case NODE_GEOM_T: {
+                       int attr_offset = find_attribute(kg, sd, ATTR_STD_TANGENT);
+
+                       if(attr_offset == ATTR_STD_NOT_FOUND)
+                               data = normalize(sd->dPdu);
+                       else
+                               data = triangle_attribute_float3(kg, sd, ATTR_ELEMENT_VERTEX, attr_offset, NULL, NULL);
+
+                       break;
+               }
 #endif
                case NODE_GEOM_I: data = sd->I; break;
                case NODE_GEOM_Ng: data = sd->Ng; break;
@@ -40,7 +49,7 @@ __device void svm_node_geometry(ShaderData *sd, float *stack, uint type, uint ou
        stack_store_float3(stack, out_offset, data);
 }
 
-__device void svm_node_geometry_bump_dx(ShaderData *sd, float *stack, uint type, uint out_offset)
+__device void svm_node_geometry_bump_dx(KernelGlobals *kg, ShaderData *sd, float *stack, uint type, uint out_offset)
 {
 #ifdef __RAY_DIFFERENTIALS__
        float3 data;
@@ -48,16 +57,16 @@ __device void svm_node_geometry_bump_dx(ShaderData *sd, float *stack, uint type,
        switch(type) {
                case NODE_GEOM_P: data = sd->P + sd->dP.dx; break;
                case NODE_GEOM_uv: data = make_float3(sd->u + sd->du.dx, sd->v + sd->dv.dx, 0.0f); break;
-               default: svm_node_geometry(sd, stack, type, out_offset); return;
+               default: svm_node_geometry(kg, sd, stack, type, out_offset); return;
        }
 
        stack_store_float3(stack, out_offset, data);
 #else
-       svm_node_geometry(sd, stack, type, out_offset);
+       svm_node_geometry(kg, sd, stack, type, out_offset);
 #endif
 }
 
-__device void svm_node_geometry_bump_dy(ShaderData *sd, float *stack, uint type, uint out_offset)
+__device void svm_node_geometry_bump_dy(KernelGlobals *kg, ShaderData *sd, float *stack, uint type, uint out_offset)
 {
 #ifdef __RAY_DIFFERENTIALS__
        float3 data;
@@ -65,12 +74,12 @@ __device void svm_node_geometry_bump_dy(ShaderData *sd, float *stack, uint type,
        switch(type) {
                case NODE_GEOM_P: data = sd->P + sd->dP.dy; break;
                case NODE_GEOM_uv: data = make_float3(sd->u + sd->du.dy, sd->v + sd->dv.dy, 0.0f); break;
-               default: svm_node_geometry(sd, stack, type, out_offset); return;
+               default: svm_node_geometry(kg, sd, stack, type, out_offset); return;
        }
 
        stack_store_float3(stack, out_offset, data);
 #else
-       svm_node_geometry(sd, stack, type, out_offset);
+       svm_node_geometry(kg, sd, stack, type, out_offset);
 #endif
 }
 
index ee423573cdf501aa6192071087314f681e05a9e7..22afa30443269549a374074da6004612f762ea5b 100644 (file)
@@ -92,7 +92,9 @@ typedef enum NodeType {
        NODE_LIGHT_FALLOFF,
        NODE_OBJECT_INFO,
        NODE_PARTICLE_INFO,
-       NODE_TEX_BRICK
+       NODE_TEX_BRICK,
+       NODE_CLOSURE_SET_TANGENT,
+       NODE_CLOSURE_TANGENT,
 } NodeType;
 
 typedef enum NodeAttributeType {
index 5122c1af4101ff3baf68f446539cd3ff601f9c96..4bcaef0fb176d1575aeb2ba247ae4d790f759a55 100644 (file)
@@ -162,6 +162,8 @@ Attribute *AttributeSet::add(AttributeStandard std, ustring name)
                attr = add(name, TypeDesc::TypeNormal, Attribute::FACE);
        else if(std == ATTR_STD_UV)
                attr = add(name, TypeDesc::TypePoint, Attribute::CORNER);
+       else if(std == ATTR_STD_TANGENT)
+               attr = add(name, TypeDesc::TypeVector, Attribute::VERTEX);
        else if(std == ATTR_STD_GENERATED)
                attr = add(name, TypeDesc::TypePoint, Attribute::VERTEX);
        else if(std == ATTR_STD_POSITION_UNDEFORMED)
index 62758128a73d2bb6e206f7bd3e2b4503c3523e6b..c13102e9567caed993ebaad78de5342a8b3f31b4 100644 (file)
@@ -468,6 +468,12 @@ void ShaderGraph::default_inputs(bool do_osl)
 
                                        connect(geom->output("Position"), input);
                                }
+                               else if(input->default_value == ShaderInput::TANGENT) {
+                                       if(!geom)
+                                               geom = new GeometryNode();
+
+                                       connect(geom->output("Tangent"), input);
+                               }
                        }
                }
        }
index c3b674d0f23b5c0d2a741ad80c7e2bc0468b3dd5..d485ed021502ab4eb26e5f730810c117e202f2a6 100644 (file)
@@ -112,6 +112,7 @@ public:
                INCOMING,
                NORMAL,
                POSITION,
+               TANGENT,
                NONE
        };
 
index 4e16eea27744cf64fd744b5bbbb66c0a15930b9a..da31a5283104272f2d18b74b8bcdf0b927558824 100644 (file)
@@ -1221,12 +1221,35 @@ WardBsdfNode::WardBsdfNode()
 {
        closure = CLOSURE_BSDF_WARD_ID;
 
+       add_input("Tangent", SHADER_SOCKET_VECTOR, ShaderInput::TANGENT);
+
        add_input("Roughness U", SHADER_SOCKET_FLOAT, 0.2f);
        add_input("Roughness V", SHADER_SOCKET_FLOAT, 0.2f);
 }
 
+void WardBsdfNode::attributes(AttributeRequestSet *attributes)
+{
+       ShaderInput *tangent_in = input("Tangent");
+
+       if(!tangent_in->link)
+               attributes->add(ATTR_STD_TANGENT);
+
+       ShaderNode::attributes(attributes);
+}
+
 void WardBsdfNode::compile(SVMCompiler& compiler)
 {
+       ShaderInput *tangent_in = input("Tangent");
+
+       if(tangent_in->link) {
+               int attr = compiler.attribute(ATTR_STD_TANGENT);
+               compiler.stack_assign(tangent_in);
+               compiler.add_node(NODE_ATTR, attr, tangent_in->stack_offset, NODE_ATTR_FLOAT3);
+               compiler.add_node(NODE_CLOSURE_TANGENT, tangent_in->stack_offset);
+       }
+       else
+               compiler.add_node(NODE_CLOSURE_SET_TANGENT, tangent_in->value);
+
        BsdfNode::compile(compiler, input("Roughness U"), input("Roughness V"));
 }
 
@@ -1566,6 +1589,14 @@ GeometryNode::GeometryNode()
        add_output("Backfacing", SHADER_SOCKET_FLOAT);
 }
 
+void GeometryNode::attributes(AttributeRequestSet *attributes)
+{
+       if(!output("Tangent")->links.empty())
+               attributes->add(ATTR_STD_TANGENT);
+
+       ShaderNode::attributes(attributes);
+}
+
 void GeometryNode::compile(SVMCompiler& compiler)
 {
        ShaderOutput *out;
index e8e584dd8ef2576aecf0a2e37a777dd056bf608f..6e5d7be0091ceb18954691c593c2a5a6542750e1 100644 (file)
@@ -201,6 +201,7 @@ public:
 class WardBsdfNode : public BsdfNode {
 public:
        SHADER_NODE_CLASS(WardBsdfNode)
+       void attributes(AttributeRequestSet *attributes);
 };
 
 class DiffuseBsdfNode : public BsdfNode {
@@ -278,6 +279,7 @@ public:
 class GeometryNode : public ShaderNode {
 public:
        SHADER_NODE_CLASS(GeometryNode)
+       void attributes(AttributeRequestSet *attributes);
 };
 
 class TextureCoordinateNode : public ShaderNode {
index 5c6b9d5bb786c0a6548cdae69accb87525b97d27..f2c02cadcbfa369e4e0689481f19b0583efdb265 100644 (file)
@@ -449,6 +449,7 @@ typedef enum AttributeStandard {
        ATTR_STD_VERTEX_NORMAL,
        ATTR_STD_FACE_NORMAL,
        ATTR_STD_UV,
+       ATTR_STD_TANGENT,
        ATTR_STD_GENERATED,
        ATTR_STD_POSITION_UNDEFORMED,
        ATTR_STD_POSITION_UNDISPLACED,
index 8965488a9b3ca19d5faa28926698176799f62df7..2fd54baf96f5b1243ba89e3484e06a389626bcfe 100644 (file)
@@ -2248,6 +2248,7 @@ static void registerShaderNodes(bNodeTreeType *ttype)
        register_node_type_sh_particle_info(ttype);
 
        register_node_type_sh_background(ttype);
+       register_node_type_sh_bsdf_anisotropic(ttype);
        register_node_type_sh_bsdf_diffuse(ttype);
        register_node_type_sh_bsdf_glossy(ttype);
        register_node_type_sh_bsdf_glass(ttype);
index db1e1e16adf0091ee6ba3a088acf7422f35ce5f3..aa48a8cf26db3014fd5c29f7b13f7f86d1ee6c11 100644 (file)
@@ -67,6 +67,7 @@ DefNode( ShaderNode,     SH_NODE_ADD_SHADER,         0,                      "AD
 DefNode( ShaderNode,     SH_NODE_ATTRIBUTE,          def_sh_attribute,       "ATTRIBUTE",          Attribute,        "Attribute",         ""       )
 DefNode( ShaderNode,     SH_NODE_BACKGROUND,         0,                      "BACKGROUND",         Background,       "Background",        ""       )
 DefNode( ShaderNode,     SH_NODE_HOLDOUT,            0,                      "HOLDOUT",            Holdout,          "Holdout",           ""       )
+DefNode( ShaderNode,     SH_NODE_BSDF_ANISOTROPIC,   0,                      "BSDF_ANISOTROPIC",   BsdfAnisotropic,  "Anisotropic Bsdf",  ""       )
 DefNode( ShaderNode,     SH_NODE_BSDF_DIFFUSE,       0,                      "BSDF_DIFFUSE",       BsdfDiffuse,      "Diffuse Bsdf",      ""       )
 DefNode( ShaderNode,     SH_NODE_BSDF_GLOSSY,        def_glossy,             "BSDF_GLOSSY",        BsdfGlossy,       "Glossy Bsdf",       ""       )
 DefNode( ShaderNode,     SH_NODE_BSDF_GLASS,         def_glossy,             "BSDF_GLASS",         BsdfGlass,        "Glass Bsdf",        ""       )
index 08e0e7b0f932fb3ec9877c1f213c2c69ff9ee24d..f4e427ce3e3af0dfc99c8807dac646ed0cceade8 100644 (file)
@@ -146,7 +146,7 @@ set(SRC
        shader/nodes/node_shader_vectMath.c
        shader/nodes/node_shader_attribute.c
        shader/nodes/node_shader_background.c
-       # shader/nodes/node_shader_bsdf_anisotropic.c  # XXX, why not included?
+       shader/nodes/node_shader_bsdf_anisotropic.c
        shader/nodes/node_shader_bsdf_diffuse.c
        shader/nodes/node_shader_bsdf_glossy.c
        shader/nodes/node_shader_bsdf_glass.c
index 49428c06e5f3eaafea9d57e344c031816886009f..306dd50d7e2f7ce74136d5d82cab63969ca971b2 100644 (file)
@@ -88,6 +88,7 @@ void register_node_type_sh_bsdf_glass(struct bNodeTreeType *ttype);
 void register_node_type_sh_bsdf_translucent(struct bNodeTreeType *ttype);
 void register_node_type_sh_bsdf_transparent(struct bNodeTreeType *ttype);
 void register_node_type_sh_bsdf_velvet(struct bNodeTreeType *ttype);
+void register_node_type_sh_bsdf_anisotropic(struct bNodeTreeType *ttype);
 void register_node_type_sh_emission(struct bNodeTreeType *ttype);
 void register_node_type_sh_holdout(struct bNodeTreeType *ttype);
 void register_node_type_sh_volume_transparent(struct bNodeTreeType *ttype);
index 9157728b54619e26f8773e52d124be399a70e4c2..2b368420a7660e361c2a9f6e4ccb20576f5074d3 100644 (file)
@@ -51,7 +51,7 @@ void register_node_type_sh_bsdf_anisotropic(bNodeTreeType *ttype)
 {
        static bNodeType ntype;
 
-       node_type_base(ttype, &ntype, SH_NODE_BSDF_ANISOTROPIC, "Glossy Anisotropic BSDF", NODE_CLASS_SHADER, 0);
+       node_type_base(ttype, &ntype, SH_NODE_BSDF_ANISOTROPIC, "Anisotropic BSDF", NODE_CLASS_SHADER, 0);
        node_type_compatibility(&ntype, NODE_NEW_SHADING);
        node_type_socket_templates(&ntype, sh_node_bsdf_anisotropic_in, sh_node_bsdf_anisotropic_out);
        node_type_size(&ntype, 150, 60, 200);