23 b.add_input<
decl::Color>(
"Color"_ustr).default_value({0.8f, 0.8f, 0.8f, 1.0f});
29 b.add_input<
decl::Float>(
"Anisotropy"_ustr).default_value(0.0f).min(-1.0f).max(1.0f);
37 b.add_input<
decl::Float>(
"Weight"_ustr).available(is_gpu_internal);
63 if (
in[0].might_be_tinted()) {
82 if (to_type_ != NodeItem::Type::BSDF) {
86 NodeItem
color = get_input_value(
"Color", NodeItem::Type::Color3);
87 NodeItem roughness = get_input_value(
"Roughness", NodeItem::Type::Vector2);
88 NodeItem anisotropy = get_input_value(
"Anisotropy", NodeItem::Type::Color3);
89 NodeItem normal = get_input_link(
"Normal", NodeItem::Type::Vector3);
90 NodeItem tangent = get_input_link(
"Tangent", NodeItem::Type::Vector3);
92 NodeItem artistic_ior = create_node(
"artistic_ior",
93 NodeItem::Type::Multioutput,
94 {{
"reflectivity",
color}, {
"edge_color", color}});
95 NodeItem ior_out = artistic_ior.add_output(
"ior", NodeItem::Type::Color3);
96 NodeItem extinction_out = artistic_ior.add_output(
"extinction", NodeItem::Type::Color3);
98 return create_node(
"conductor_bsdf",
101 {
"tangent", tangent},
103 {
"extinction", extinction_out},
104 {
"roughness", roughness}});
121 "Reflection with microfacet distribution, used for materials such as metal or mirrors";
124 ntype.
declare = file_ns::node_declare;
129 ntype.
initfunc = file_ns::node_shader_init_glossy;
130 ntype.
gpu_fn = file_ns::node_shader_gpu_bsdf_glossy;
#define NODE_CLASS_SHADER
#define SH_NODE_BSDF_GLOSSY
void node_register_type(bNodeType &ntype)
void node_register_alias(bNodeType &nt, UString alias)
static void node_shader_buts_glossy(ui::Layout &layout, bContext *, PointerRNA *ptr)
static void node_shader_init_glossy(bNodeTree *, bNode *node)
static int node_shader_gpu_bsdf_glossy(GPUMaterial *mat, bNode *node, bNodeExecData *, GPUNodeStack *in, GPUNodeStack *out)
static void node_declare(NodeDeclarationBuilder &b)
@ ITEM_R_SPLIT_EMPTY_NAME
bool GPU_stack_link(GPUMaterial *mat, const bNode *node, const char *name, GPUNodeStack *in, GPUNodeStack *out,...)
bool object_shader_nodes_poll(const bContext *C)
@ GPU_MATFLAG_REFLECTION_MAYBE_COLORED
void sh_node_type_base(bke::bNodeType *ntype, UString idname, const std::optional< int16_t > legacy_type)
GPUNodeLink * GPU_constant(const float *num)
bool GPU_link(GPUMaterial *mat, const char *name,...)
void search_link_ops_for_shader_bsdf_node(nodes::GatherLinkSearchOpParams ¶ms)
void GPU_material_flag_set(GPUMaterial *mat, eGPUMaterialFlag flag)
GPUNodeLink * GPU_shading_data()
@ NTREE_IS_GPU_SHADER_INTERNAL
GPUNodeLink * GPU_kernel_globals()
void register_node_type_sh_bsdf_glossy()
#define NODE_SHADER_MATERIALX_BEGIN
#define NODE_SHADER_MATERIALX_END
static constexpr int _160
NodeMaterialXFunction materialx_fn
void(*) draw_buttons(ui::Layout &, bContext *C, PointerRNA *ptr)
std::string ui_description
NodeGPUExecFunction gpu_fn
void(*) initfunc(bNodeTree *ntree, bNode *node)
const char * enum_name_legacy
NodeGatherSocketLinkOperationsFunction gather_link_search_ops
NodeDeclareFunction declare
bool(*) add_ui_poll(const bContext *C)
void prop(PointerRNA *ptr, PropertyRNA *prop, int index, int value, eUI_Item_Flag flag, std::optional< StringRef > name_opt, int icon, std::optional< StringRef > placeholder=std::nullopt)