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.5f).min(0.0f).max(1000.0f);
35 GPU_link(mat,
"world_normals_get", &in[3].link);
48 if (to_type_ != NodeItem::Type::BSDF) {
52 NodeItem
color = get_input_value(
"Color", NodeItem::Type::Color3);
53 NodeItem roughness = get_input_value(
"Roughness", NodeItem::Type::Vector2);
54 NodeItem ior = get_input_value(
"IOR", NodeItem::Type::Float);
55 NodeItem normal = get_input_link(
"Normal", NodeItem::Type::Vector3);
57 return create_node(
"dielectric_bsdf",
61 {
"roughness", roughness},
63 {
"scatter_mode", val(std::string(
"RT"))}});
78 ntype.
declare = file_ns::node_declare;
81 ntype.
initfunc = file_ns::node_shader_init_glass;
82 ntype.
gpu_fn = file_ns::node_shader_gpu_bsdf_glass;
#define SH_NODE_BSDF_GLASS
#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,...)
Group Output data from inside of a node group A color picker Mix two input colors RGB to Convert a color s luminance to a grayscale value Generate a normal vector and a dot product Brightness Control the brightness and contrast of the input color Vector Map input vector components with curves Camera Retrieve information about the camera and how it relates to the current shading point s position Clamp a value between a minimum and a maximum Vector Perform vector math operation Invert Invert a color
local_group_size(16, 16) .push_constant(Type b
void node_type_size_preset(bNodeType *ntype, eNodeSizePreset size)
void node_register_type(bNodeType *ntype)
static void node_declare(NodeDeclarationBuilder &b)
static void node_shader_init_glass(bNodeTree *, bNode *node)
static int node_shader_gpu_bsdf_glass(GPUMaterial *mat, bNode *node, bNodeExecData *, GPUNodeStack *in, GPUNodeStack *out)
#define NODE_SHADER_MATERIALX_BEGIN
#define NODE_SHADER_MATERIALX_END
void register_node_type_sh_bsdf_glass()
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
NodeDeclareFunction declare