12 .default_value({1.0f, 1.0f, 1.0f, 1.0f})
13 .description(
"Color input on which correction will be applied");
15 "Brightness correction value.\n"
16 "An additive-type factor by which to increase the overall brightness of the image. "
17 "Use a negative number to darken an image, and a positive number to brighten it");
23 "Contrast correction value.\n"
24 "A scaling type factor by which to make brighter pixels brighter, but keeping the "
25 "darker pixels dark. "
26 "Use a negative number to decrease contrast, and a positive number to increase it");
42 NodeItem color = get_input_value(
"Color", NodeItem::Type::Color3);
43 NodeItem bright = get_input_value(
"Bright", NodeItem::Type::Float);
44 NodeItem contrast = get_input_value(
"Contrast", NodeItem::Type::Float);
47 return (bright + color * (contrast + val(1.0f)) - contrast * val(0.5f)).max(val(0.0f));
61 ntype.
declare = file_ns::node_declare;
62 ntype.
gpu_fn = file_ns::gpu_shader_brightcontrast;
#define SH_NODE_BRIGHTCONTRAST
#define NODE_CLASS_OP_COLOR
bool GPU_stack_link(GPUMaterial *mat, const bNode *node, const char *name, GPUNodeStack *in, GPUNodeStack *out,...)
local_group_size(16, 16) .push_constant(Type b
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, int type, const char *name, short nclass)
NodeMaterialXFunction materialx_fn
NodeGPUExecFunction gpu_fn
NodeDeclareFunction declare