12 .default_value({1.0f, 1.0f, 1.0f, 1.0f})
13 .description(
"Color input on which correction will be applied");
19 "Brightness correction value.\n"
20 "An additive-type factor by which to increase the overall brightness of the image. "
21 "Use a negative number to darken an image, and a positive number to brighten it");
27 "Contrast correction value.\n"
28 "A scaling type factor by which to make brighter pixels brighter, but keeping the "
29 "darker pixels dark. "
30 "Use a negative number to decrease contrast, and a positive number to increase it");
46 NodeItem
color = get_input_value(
"Color", NodeItem::Type::Color3);
47 NodeItem bright = get_input_value(
"Bright", NodeItem::Type::Float);
48 NodeItem contrast = get_input_value(
"Contrast", NodeItem::Type::Float);
51 return (bright +
color * (contrast + val(1.0f)) - contrast * val(0.5f)).max(val(0.0f));
65 ntype.
ui_name =
"Brightness/Contrast";
66 ntype.
ui_description =
"Control the brightness and contrast of the input color";
69 ntype.
declare = file_ns::node_declare;
70 ntype.
gpu_fn = file_ns::gpu_shader_brightcontrast;
#define NODE_CLASS_OP_COLOR
#define SH_NODE_BRIGHTCONTRAST
bool GPU_stack_link(GPUMaterial *mat, const bNode *node, const char *name, GPUNodeStack *in, GPUNodeStack *out,...)
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)
#define NODE_SHADER_MATERIALX_BEGIN
#define NODE_SHADER_MATERIALX_END
void register_node_type_sh_brightcontrast()
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