20 b.add_input<
decl::Color>(
"Color"_ustr).default_value({1.0f, 1.0f, 1.0f, 1.0f});
26 b.add_input<
decl::Float>(
"IOR"_ustr).default_value(1.45f).min(0.0f).max(1000.0f);
28 b.add_input<
decl::Float>(
"Weight"_ustr).available(is_gpu_internal);
48 if (
in[0].might_be_tinted()) {
59 if (to_type_ != NodeItem::Type::BSDF) {
63 NodeItem
color = get_input_value(
"Color", NodeItem::Type::Color3);
64 NodeItem roughness = get_input_value(
"Roughness", NodeItem::Type::Vector2);
65 NodeItem ior = get_input_value(
"IOR", NodeItem::Type::Float);
66 NodeItem normal = get_input_link(
"Normal", NodeItem::Type::Vector3);
68 return create_node(
"dielectric_bsdf",
72 {
"roughness", roughness},
74 {
"scatter_mode", val(std::string(
"T"))}});
89 ntype.
ui_name =
"Refraction BSDF";
91 "Glossy refraction with sharp or microfacet distribution, typically used for materials that "
95 ntype.
declare = file_ns::node_declare;
99 ntype.
initfunc = file_ns::node_shader_init_refraction;
100 ntype.
gpu_fn = file_ns::node_shader_gpu_bsdf_refraction;
#define NODE_CLASS_SHADER
#define SH_NODE_BSDF_REFRACTION
void node_register_type(bNodeType &ntype)
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)
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_REFRACTION_MAYBE_COLORED
void sh_node_type_base(bke::bNodeType *ntype, UString idname, const std::optional< int16_t > legacy_type)
void register_node_type_sh_bsdf_refraction()
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()
#define NODE_SHADER_MATERIALX_BEGIN
#define NODE_SHADER_MATERIALX_END
static constexpr int _160
NodeMaterialXFunction materialx_fn
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)