14 b.add_input<
decl::Color>(
"Color").default_value({0.8f, 0.8f, 0.8f, 1.0f});
20 b.add_input<
decl::Float>(
"Anisotropy").default_value(0.0f).min(-1.0f).max(1.0f);
49 GPU_link(mat,
"world_normals_get", &in[4].link);
62 if (to_type_ != NodeItem::Type::BSDF) {
66 NodeItem color = get_input_value(
"Color", NodeItem::Type::Color3);
67 NodeItem roughness = get_input_value(
"Roughness", NodeItem::Type::Vector2);
68 NodeItem anisotropy = get_input_value(
"Anisotropy", NodeItem::Type::Color3);
69 NodeItem normal = get_input_link(
"Normal", NodeItem::Type::Vector3);
70 NodeItem tangent = get_input_link(
"Tangent", NodeItem::Type::Vector3);
72 NodeItem artistic_ior = create_node(
"artistic_ior",
73 NodeItem::Type::Multioutput,
74 {{
"reflectivity", color}, {
"edge_color", color}});
75 NodeItem ior_out = artistic_ior.add_output(
"ior", NodeItem::Type::Color3);
76 NodeItem extinction_out = artistic_ior.add_output(
"extinction", NodeItem::Type::Color3);
78 return create_node(
"conductor_bsdf",
83 {
"extinction", extinction_out},
84 {
"roughness", roughness}});
99 ntype.
declare = file_ns::node_declare;
103 ntype.
initfunc = file_ns::node_shader_init_glossy;
104 ntype.
gpu_fn = file_ns::node_shader_gpu_bsdf_glossy;
#define NODE_CLASS_SHADER
bool GPU_stack_link(GPUMaterial *mat, const bNode *node, const char *name, GPUNodeStack *in, GPUNodeStack *out,...)
GPUNodeLink * GPU_constant(const float *num)
void GPU_material_flag_set(GPUMaterial *mat, eGPUMaterialFlag flag)
bool GPU_link(GPUMaterial *mat, const char *name,...)
void uiItemR(uiLayout *layout, PointerRNA *ptr, const char *propname, eUI_Item_Flag flag, const char *name, int icon)
@ UI_ITEM_R_SPLIT_EMPTY_NAME
local_group_size(16, 16) .push_constant(Type b
void node_register_alias(bNodeType *nt, const char *alias)
void node_type_size_preset(bNodeType *ntype, eNodeSizePreset size)
void node_register_type(bNodeType *ntype)
static void node_shader_init_glossy(bNodeTree *, bNode *node)
static void node_shader_buts_glossy(uiLayout *layout, bContext *, PointerRNA *ptr)
static int node_shader_gpu_bsdf_glossy(GPUMaterial *mat, bNode *node, bNodeExecData *, GPUNodeStack *in, GPUNodeStack *out)
static void node_declare(NodeDeclarationBuilder &b)
#define NODE_SHADER_MATERIALX_BEGIN
#define NODE_SHADER_MATERIALX_END
void register_node_type_sh_bsdf_glossy()
void sh_node_type_base(blender::bke::bNodeType *ntype, int type, const char *name, short nclass)
bool object_shader_nodes_poll(const bContext *C)
NodeMaterialXFunction materialx_fn
bool(* add_ui_poll)(const bContext *C)
void(* initfunc)(bNodeTree *ntree, bNode *node)
NodeGPUExecFunction gpu_fn
void(* draw_buttons)(uiLayout *, bContext *C, PointerRNA *ptr)
NodeDeclareFunction declare