22 b.add_input<
decl::Color>(
"Color"_ustr).default_value({1.0f, 1.0f, 1.0f, 1.0f});
25 b.add_input<
decl::Float>(
"Weight"_ustr).available(is_gpu_internal);
46 case NodeItem::Type::BSDF: {
47 NodeItem
color = get_input_value(
"Color", NodeItem::Type::Color3);
49 return create_node(
"oren_nayar_diffuse_bsdf", NodeItem::Type::BSDF, {{
"color",
color}});
51 case NodeItem::Type::SurfaceOpacity: {
52 NodeItem color = get_input_value(
"Color", NodeItem::Type::Color3);
54 return val(1.0f) - color.dotproduct(val(1.0f / 3.0f));
74 ntype.
ui_name =
"Ray Portal BSDF";
75 ntype.
ui_description =
"Continue tracing from an arbitrary new position and in a new direction";
79 ntype.
declare = file_ns::node_declare;
81 ntype.
gpu_fn = file_ns::node_shader_gpu_bsdf_ray_portal;
#define NODE_CLASS_SHADER
#define SH_NODE_BSDF_RAY_PORTAL
void node_register_type(bNodeType &ntype)
static int node_shader_gpu_bsdf_ray_portal(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_cycles_shader_nodes_poll(const bContext *C)
@ GPU_MATFLAG_TRANSPARENT
void sh_node_type_base(bke::bNodeType *ntype, UString idname, const std::optional< int16_t > legacy_type)
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_ray_portal()
GPUNodeLink * GPU_shading_data()
@ NTREE_IS_GPU_SHADER_INTERNAL
GPUNodeLink * GPU_kernel_globals()
MINLINE bool is_zero_v3(const float v[3]) ATTR_WARN_UNUSED_RESULT
#define NODE_SHADER_MATERIALX_BEGIN
#define NODE_SHADER_MATERIALX_END
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)