20 b.add_input<
decl::Color>(
"Color"_ustr).default_value({0.8f, 0.8f, 0.8f, 1.0f});
27 b.add_input<
decl::Float>(
"Weight"_ustr).available(is_gpu_internal);
50 if (to_type_ != NodeItem::Type::BSDF) {
54 NodeItem
color = get_input_value(
"Color", NodeItem::Type::Color3);
55 NodeItem roughness = get_input_value(
"Roughness", NodeItem::Type::Float);
56 NodeItem normal = get_input_link(
"Normal", NodeItem::Type::Vector3);
58 return create_node(
"oren_nayar_diffuse_bsdf",
60 {{
"color",
color}, {
"roughness", roughness}, {
"normal", normal}});
76 ntype.
ui_description =
"Lambertian and Oren-Nayar diffuse reflection";
79 ntype.
declare = file_ns::node_declare;
83 ntype.
gpu_fn = file_ns::node_shader_gpu_bsdf_diffuse;
#define NODE_CLASS_SHADER
#define SH_NODE_BSDF_DIFFUSE
void node_register_type(bNodeType &ntype)
static int node_shader_gpu_bsdf_diffuse(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)
void sh_node_type_base(bke::bNodeType *ntype, UString idname, const std::optional< int16_t > legacy_type)
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)
void register_node_type_sh_bsdf_diffuse()
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
const char * enum_name_legacy
NodeGatherSocketLinkOperationsFunction gather_link_search_ops
NodeDeclareFunction declare
bool(*) add_ui_poll(const bContext *C)