11 b.add_input<
decl::Color>(
"Color").default_value({0.8f, 0.8f, 0.8f, 1.0f});
29 GPU_link(mat,
"world_normals_get", &
in[2].link);
40 if (to_type_ != NodeItem::Type::BSDF) {
44 NodeItem
color = get_input_value(
"Color", NodeItem::Type::Color3);
45 NodeItem roughness = get_input_value(
"Roughness", NodeItem::Type::Float);
46 NodeItem normal = get_input_link(
"Normal", NodeItem::Type::Vector3);
48 return create_node(
"oren_nayar_diffuse_bsdf",
50 {{
"color",
color}, {
"roughness", roughness}, {
"normal", normal}});
66 ntype.
ui_description =
"Lambertian and Oren-Nayar diffuse reflection";
69 ntype.
declare = file_ns::node_declare;
72 ntype.
gpu_fn = file_ns::node_shader_gpu_bsdf_diffuse;
#define NODE_CLASS_SHADER
#define SH_NODE_BSDF_DIFFUSE
bool GPU_stack_link(GPUMaterial *mat, const bNode *node, const char *name, GPUNodeStack *in, GPUNodeStack *out,...)
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 int node_shader_gpu_bsdf_diffuse(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_diffuse()
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)
NodeGPUExecFunction gpu_fn
const char * enum_name_legacy
NodeDeclareFunction declare