22 b.add_input<
decl::Color>(
"Color"_ustr).default_value({1.0f, 1.0f, 1.0f, 1.0f});
23 b.add_input<
decl::Float>(
"Weight"_ustr).available(is_gpu_internal);
36 if (
in[0].might_be_tinted()) {
48 case NodeItem::Type::BSDF: {
49 NodeItem
color = get_input_value(
"Color", NodeItem::Type::Color3);
51 return create_node(
"oren_nayar_diffuse_bsdf", NodeItem::Type::BSDF, {{
"color",
color}});
53 case NodeItem::Type::SurfaceOpacity: {
54 NodeItem color = get_input_value(
"Color", NodeItem::Type::Color3);
56 return val(1.0f) - color.dotproduct(val(1.0f / 3.0f));
76 ntype.
ui_name =
"Transparent BSDF";
78 "Transparency without refraction, passing straight through the surface as if there were no "
83 ntype.
declare = file_ns::node_declare;
85 ntype.
gpu_fn = file_ns::node_shader_gpu_bsdf_transparent;
#define NODE_CLASS_SHADER
#define SH_NODE_BSDF_TRANSPARENT
void node_register_type(bNodeType &ntype)
static void node_declare(NodeDeclarationBuilder &b)
static int node_shader_gpu_bsdf_transparent(GPUMaterial *mat, bNode *node, bNodeExecData *, GPUNodeStack *in, GPUNodeStack *out)
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_TRANSPARENT_MAYBE_COLORED
@ 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 register_node_type_sh_bsdf_transparent()
void GPU_material_flag_set(GPUMaterial *mat, eGPUMaterialFlag flag)
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)