21 b.add_input<
decl::Color>(
"Color"_ustr).default_value({0.5f, 0.5f, 0.5f, 1.0f});
31 float coefficients[3];
39 NodeItem
color = get_input_value(
"Color", NodeItem::Type::Color3);
40 return create_node(
"luminance", NodeItem::Type::Color3, {{
"in",
color}});
55 ntype.
ui_description =
"Convert a color's luminance to a grayscale value";
58 ntype.
declare = file_ns::sh_node_rgbtobw_declare;
59 ntype.
gpu_fn = file_ns::gpu_shader_rgbtobw;
#define NODE_CLASS_CONVERTER
void node_register_type(bNodeType &ntype)
static void sh_node_rgbtobw_declare(NodeDeclarationBuilder &b)
static int gpu_shader_rgbtobw(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,...)
BLI_INLINE void IMB_colormanagement_get_luminance_coefficients(float r_rgb[3])
void sh_node_type_base(bke::bNodeType *ntype, UString idname, const std::optional< int16_t > legacy_type)
GPUNodeLink * GPU_constant(const float *num)
void register_node_type_sh_rgbtobw()
#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
NodeDeclareFunction declare