13 b.add_input<
decl::Color>(
"Color").default_value({1.0f, 1.0f, 1.0f, 1.0f});
34 case NodeItem::Type::BSDF: {
35 NodeItem
color = get_input_value(
"Color", NodeItem::Type::Color3);
37 return create_node(
"oren_nayar_diffuse_bsdf", NodeItem::Type::BSDF, {{
"color",
color}});
39 case NodeItem::Type::SurfaceOpacity: {
40 NodeItem color = get_input_value(
"Color", NodeItem::Type::Color3);
42 return val(1.0f) - color.dotproduct(val(1.0f / 3.0f));
62 ntype.
ui_name =
"Transparent BSDF";
64 "Transparency without refraction, passing straight through the surface as if there were no "
69 ntype.
declare = file_ns::node_declare;
70 ntype.
gpu_fn = file_ns::node_shader_gpu_bsdf_transparent;
#define NODE_CLASS_SHADER
#define SH_NODE_BSDF_TRANSPARENT
MINLINE bool is_zero_v3(const float v[3]) ATTR_WARN_UNUSED_RESULT
bool GPU_stack_link(GPUMaterial *mat, const bNode *node, const char *name, GPUNodeStack *in, GPUNodeStack *out,...)
@ GPU_MATFLAG_TRANSPARENT
void GPU_material_flag_set(GPUMaterial *mat, eGPUMaterialFlag flag)
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)
#define NODE_SHADER_MATERIALX_BEGIN
#define NODE_SHADER_MATERIALX_END
void register_node_type_sh_bsdf_transparent()
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