19 b.add_input<
decl::Color>(
"Color").default_value({0.5f, 0.5f, 0.5f, 1.0f});
29 float coefficients[3];
37 NodeItem
color = get_input_value(
"Color", NodeItem::Type::Color3);
38 return create_node(
"luminance", NodeItem::Type::Color3, {{
"in",
color}});
53 ntype.
ui_description =
"Convert a color's luminance to a grayscale value";
56 ntype.
declare = file_ns::sh_node_rgbtobw_declare;
57 ntype.
gpu_fn = file_ns::gpu_shader_rgbtobw;
#define NODE_CLASS_CONVERTER
bool GPU_stack_link(GPUMaterial *mat, const bNode *node, const char *name, GPUNodeStack *in, GPUNodeStack *out,...)
GPUNodeLink * GPU_constant(const float *num)
BLI_INLINE void IMB_colormanagement_get_luminance_coefficients(float r_rgb[3])
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)
#define NODE_SHADER_MATERIALX_BEGIN
#define NODE_SHADER_MATERIALX_END
void register_node_type_sh_rgbtobw()
void sh_node_type_base(blender::bke::bNodeType *ntype, std::string idname, const std::optional< int16_t > legacy_type)
NodeMaterialXFunction materialx_fn
std::string ui_description
NodeGPUExecFunction gpu_fn
const char * enum_name_legacy
NodeDeclareFunction declare