15 .default_value({0.617f, 0.577f, 0.540f, 1.0f})
16 .description(
"Color of the material");
18 .default_value({0.695f, 0.726f, 0.770f, 1.0f})
20 "Tint reflection at near-grazing incidence to simulate complex index of refraction");
22 .default_value({2.757f, 2.513f, 2.231f})
25 .
description(
"Real part of the conductor's refractive index, often called n");
27 .default_value({3.867f, 3.404f, 3.009f})
30 .
description(
"Imaginary part of the conductor's refractive index, often called k");
37 "Microfacet roughness of the surface (0.0 is a perfect mirror reflection, 1.0 is "
46 "Amount of anisotropy for reflection. Higher values give elongated highlights along the "
53 .description(
"Rotates the direction of anisotropy, with 1.0 going full circle");
79 GPU_link(mat,
"world_normals_get", &in[7].link);
113 if (to_type_ != NodeItem::Type::BSDF) {
117 NodeItem color = get_input_value(
"Base Color", NodeItem::Type::Color3);
118 NodeItem edge_tint = get_input_value(
"Edge Tint", NodeItem::Type::Color3);
119 NodeItem roughness = get_input_value(
"Roughness", NodeItem::Type::Vector2);
120 NodeItem anisotropy = get_input_value(
"Anisotropy", NodeItem::Type::Color3);
121 NodeItem normal = get_input_link(
"Normal", NodeItem::Type::Vector3);
122 NodeItem tangent = get_input_link(
"Tangent", NodeItem::Type::Vector3);
124 NodeItem ior_out, extinction_out;
126 ior_out = get_input_value(
"IOR", NodeItem::Type::Color3);
127 extinction_out = get_input_value(
"Extinction", NodeItem::Type::Color3);
130 NodeItem artistic_ior = create_node(
"artistic_ior",
131 NodeItem::Type::Multioutput,
132 {{
"reflectivity", color}, {
"edge_color", edge_tint}});
133 ior_out = artistic_ior.add_output(
"ior", NodeItem::Type::Color3);
134 extinction_out = artistic_ior.add_output(
"extinction", NodeItem::Type::Color3);
137 return create_node(
"conductor_bsdf",
138 NodeItem::Type::BSDF,
140 {
"tangent", tangent},
142 {
"extinction", extinction_out},
143 {
"roughness", roughness}});
158 ntype.
declare = file_ns::node_declare;
160 ntype.
draw_buttons = file_ns::node_shader_buts_metallic;
162 ntype.
initfunc = file_ns::node_shader_init_metallic;
163 ntype.
gpu_fn = file_ns::node_shader_gpu_bsdf_metallic;
164 ntype.
updatefunc = file_ns::node_shader_update_metallic;
#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_type_size_preset(bNodeType *ntype, eNodeSizePreset size)
void node_set_socket_availability(bNodeTree *ntree, bNodeSocket *sock, bool is_available)
void node_register_type(bNodeType *ntype)
bNodeSocket * node_find_socket(bNode *node, eNodeSocketInOut in_out, StringRef identifier)
#define NODE_SHADER_MATERIALX_BEGIN
#define NODE_SHADER_MATERIALX_END
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
void(* updatefunc)(bNodeTree *ntree, bNode *node)