11 b.add_input<
decl::Color>(
"Color").default_value({1.0f, 1.0f, 1.0f, 1.0f});
17 b.add_input<
decl::Float>(
"IOR").default_value(1.45f).min(0.0f).max(1000.0f);
35 GPU_link(mat,
"world_normals_get", &
in[3].link);
39 if (
in[0].might_be_tinted()) {
49 if (to_type_ != NodeItem::Type::BSDF) {
53 NodeItem
color = get_input_value(
"Color", NodeItem::Type::Color3);
54 NodeItem roughness = get_input_value(
"Roughness", NodeItem::Type::Vector2);
55 NodeItem ior = get_input_value(
"IOR", NodeItem::Type::Float);
56 NodeItem normal = get_input_link(
"Normal", NodeItem::Type::Vector3);
58 return create_node(
"dielectric_bsdf",
62 {
"roughness", roughness},
64 {
"scatter_mode", val(std::string(
"T"))}});
79 ntype.
ui_name =
"Refraction BSDF";
81 "Glossy refraction with sharp or microfacet distribution, typically used for materials that "
85 ntype.
declare = file_ns::node_declare;
88 ntype.
initfunc = file_ns::node_shader_init_refraction;
89 ntype.
gpu_fn = file_ns::node_shader_gpu_bsdf_refraction;
#define NODE_CLASS_SHADER
#define SH_NODE_BSDF_REFRACTION
bool GPU_stack_link(GPUMaterial *mat, const bNode *node, const char *name, GPUNodeStack *in, GPUNodeStack *out,...)
@ GPU_MATFLAG_REFRACTION_MAYBE_COLORED
void GPU_material_flag_set(GPUMaterial *mat, eGPUMaterialFlag flag)
bool GPU_link(GPUMaterial *mat, const char *name,...)
void node_register_type(bNodeType &ntype)
void node_type_size_preset(bNodeType &ntype, eNodeSizePreset size)
static void node_shader_init_refraction(bNodeTree *, bNode *node)
static int node_shader_gpu_bsdf_refraction(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_refraction()
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
NodeDeclareFunction declare