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);
54 if (
in[0].might_be_tinted()) {
66 if (to_type_ != NodeItem::Type::BSDF) {
70 NodeItem
color = get_input_value(
"Color", NodeItem::Type::Color3);
71 NodeItem roughness = get_input_value(
"Roughness", NodeItem::Type::Vector2);
72 NodeItem anisotropy = get_input_value(
"Anisotropy", NodeItem::Type::Color3);
73 NodeItem normal = get_input_link(
"Normal", NodeItem::Type::Vector3);
74 NodeItem tangent = get_input_link(
"Tangent", NodeItem::Type::Vector3);
76 NodeItem artistic_ior = create_node(
"artistic_ior",
77 NodeItem::Type::Multioutput,
78 {{
"reflectivity",
color}, {
"edge_color", color}});
79 NodeItem ior_out = artistic_ior.add_output(
"ior", NodeItem::Type::Color3);
80 NodeItem extinction_out = artistic_ior.add_output(
"extinction", NodeItem::Type::Color3);
82 return create_node(
"conductor_bsdf",
87 {
"extinction", extinction_out},
88 {
"roughness", roughness}});
105 "Reflection with microfacet distribution, used for materials such as metal or mirrors";
108 ntype.
declare = file_ns::node_declare;
112 ntype.
initfunc = file_ns::node_shader_init_glossy;
113 ntype.
gpu_fn = file_ns::node_shader_gpu_bsdf_glossy;
#define NODE_CLASS_SHADER
#define SH_NODE_BSDF_GLOSSY
bool GPU_stack_link(GPUMaterial *mat, const bNode *node, const char *name, GPUNodeStack *in, GPUNodeStack *out,...)
GPUNodeLink * GPU_constant(const float *num)
@ GPU_MATFLAG_REFLECTION_MAYBE_COLORED
void GPU_material_flag_set(GPUMaterial *mat, eGPUMaterialFlag flag)
bool GPU_link(GPUMaterial *mat, const char *name,...)
@ UI_ITEM_R_SPLIT_EMPTY_NAME
void node_register_alias(bNodeType &nt, StringRef alias)
void node_register_type(bNodeType &ntype)
void node_type_size_preset(bNodeType &ntype, eNodeSizePreset size)
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, std::string idname, const std::optional< int16_t > legacy_type)
bool object_shader_nodes_poll(const bContext *C)
NodeMaterialXFunction materialx_fn
std::string ui_description
bool(* add_ui_poll)(const bContext *C)
void(* initfunc)(bNodeTree *ntree, bNode *node)
NodeGPUExecFunction gpu_fn
const char * enum_name_legacy
void(* draw_buttons)(uiLayout *, bContext *C, PointerRNA *ptr)
NodeDeclareFunction declare
void prop(PointerRNA *ptr, PropertyRNA *prop, int index, int value, eUI_Item_Flag flag, std::optional< blender::StringRef > name_opt, int icon, std::optional< blender::StringRef > placeholder=std::nullopt)