18 .default_value({1.0f, 1.0f, 1.0f, 1.0f})
19 .description(
"Color input on which correction will be applied");
20 b.add_input<
decl::Float>(
"Brightness"_ustr,
"Bright"_ustr)
25 "Brightness correction value.\n"
26 "An additive-type factor by which to increase the overall brightness of the image. "
27 "Use a negative number to darken an image, and a positive number to brighten it");
33 "Contrast correction value.\n"
34 "A scaling type factor by which to make brighter pixels brighter, but keeping the "
35 "darker pixels dark. "
36 "Use a negative number to decrease contrast, and a positive number to increase it");
52 NodeItem
color = get_input_value(
"Color", NodeItem::Type::Color3);
53 NodeItem bright = get_input_value(
"Bright", NodeItem::Type::Float);
54 NodeItem contrast = get_input_value(
"Contrast", NodeItem::Type::Float);
57 return (bright +
color * (contrast + val(1.0f)) - contrast * val(0.5f)).max(val(0.0f));
71 ntype.
ui_name =
"Brightness/Contrast";
72 ntype.
ui_description =
"Control the brightness and contrast of the input color";
75 ntype.
declare = file_ns::node_declare;
76 ntype.
gpu_fn = file_ns::gpu_shader_brightcontrast;
#define NODE_CLASS_OP_COLOR
#define SH_NODE_BRIGHTCONTRAST
void node_register_type(bNodeType &ntype)
static void node_declare(NodeDeclarationBuilder &b)
static int gpu_shader_brightcontrast(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,...)
void sh_node_type_base(bke::bNodeType *ntype, UString idname, const std::optional< int16_t > legacy_type)
void register_node_type_sh_brightcontrast()
#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