30 .description(
"Amount of influence the node exerts on the output vector")
31 .compositor_domain_priority(1);
35 .
description(
"Vector which would be mapped to the curve")
36 .compositor_domain_priority(0);
60 float start_slopes[
CM_TOT];
63 float range_minimums[
CM_TOT];
65 float range_dividers[
CM_TOT];
70 "curves_vector_mixed",
88 static const mf::Signature
signature = []() {
90 mf::SignatureBuilder builder{
"Curve Vec",
signature};
91 builder.single_input<
float>(
"Fac");
92 builder.single_input<
float3>(
"Vector");
93 builder.single_output<
float3>(
"Vector");
107 if (fac[
i] != 1.0f) {
126 return get_input_value(
"Vector", NodeItem::Type::Vector3);
140 ntype.
ui_name =
"Vector Curves";
144 ntype.
declare = file_ns::sh_node_curve_vec_declare;
145 ntype.
initfunc = file_ns::node_shader_init_curve_vec;
148 ntype.
gpu_fn = file_ns::gpu_shader_curve_vec;
161 b.is_function_node();
168 .description(
"Amount of influence the node exerts on the output color")
169 .compositor_domain_priority(1);
171 .default_value({1.0f, 1.0f, 1.0f, 1.0f})
172 .description(
"Color input on which correction will be applied")
197 float start_slopes[
CM_TOT];
200 float range_minimums[
CM_TOT];
202 float range_dividers[
CM_TOT];
206 float black_level[4] = {0.0f, 0.0f, 0.0f, 1.0f};
207 float white_level[4] = {1.0f, 1.0f, 1.0f, 1.0f};
216 "curves_combined_only",
231 "curves_combined_rgb",
251 static const mf::Signature
signature = []() {
253 mf::SignatureBuilder builder{
"Curve RGB",
signature};
254 builder.single_input<
float>(
"Fac");
272 if (fac[
i] != 1.0f) {
292 return get_input_value(
"Color", NodeItem::Type::Color3);
307 ntype.
ui_description =
"Apply color corrections for each color channel";
310 ntype.
declare = file_ns::sh_node_curve_rgb_declare;
311 ntype.
initfunc = file_ns::node_shader_init_curve_rgb;
314 ntype.
gpu_fn = file_ns::gpu_shader_curve_rgb;
327 b.is_function_node();
334 .compositor_domain_priority(1);
338 .compositor_domain_priority(0);
362 float start_slopes[
CM_TOT];
365 float range_minimums[
CM_TOT];
367 float range_dividers[
CM_TOT];
372 "curves_float_mixed",
390 static const mf::Signature
signature = []() {
392 mf::SignatureBuilder builder{
"Curve Float",
signature};
393 builder.single_input<
float>(
"Factor");
394 builder.single_input<
float>(
"Value");
395 builder.single_output<
float>(
"Value");
409 if (fac[
i] != 1.0f) {
410 val_out[
i] = (1.0f - fac[
i]) * val_in[
i] + fac[
i] * val_out[
i];
428 return get_input_value(
"Value", NodeItem::Type::Float);
443 ntype.
ui_description =
"Map an input float to a curve and outputs a float value";
446 ntype.
declare = file_ns::sh_node_curve_float_declare;
447 ntype.
initfunc = file_ns::node_shader_init_curve_float;
450 ntype.
gpu_fn = file_ns::gpu_shader_curve_float;
#define NODE_CLASS_CONVERTER
#define NODE_CLASS_OP_VECTOR
#define NODE_CLASS_OP_COLOR
#define SH_NODE_CURVE_FLOAT
#define SH_NODE_CURVE_VEC
#define SH_NODE_CURVE_RGB
void interp_v3_v3v3(float r[3], const float a[3], const float b[3], float t)
bool GPU_stack_link(GPUMaterial *mat, const bNode *node, const char *name, GPUNodeStack *in, GPUNodeStack *out,...)
GPUNodeLink * GPU_constant(const float *num)
GPUNodeLink * GPU_color_band(GPUMaterial *mat, int size, float *pixels, float *r_row)
GPUNodeLink * GPU_uniform(const float *num)
const Signature & signature() const
void set_signature(const Signature *signature)
void construct_and_set_matching_fn(Args &&...args)
int compositor_domain_priority() const
bool is_default_link_socket
void call(const IndexMask &mask, mf::Params params, mf::Context) const override
CurveFloatFunction(const CurveMapping &cumap)
void call(const IndexMask &mask, mf::Params params, mf::Context) const override
CurveRGBFunction(const CurveMapping &cumap)
void call(const IndexMask &mask, mf::Params params, mf::Context) const override
CurveVecFunction(const CurveMapping &cumap)
ccl_device_inline float2 mask(const MaskType mask, const float2 a)
void node_register_type(bNodeType &ntype)
void node_type_storage(bNodeType &ntype, std::optional< StringRefNull > storagename, void(*freefunc)(bNode *node), void(*copyfunc)(bNodeTree *dest_ntree, bNode *dest_node, const bNode *src_node))
void node_type_size_preset(bNodeType &ntype, eNodeSizePreset size)
static void sh_node_curve_float_declare(NodeDeclarationBuilder &b)
static void sh_node_curve_float_build_multi_function(NodeMultiFunctionBuilder &builder)
static void node_shader_init_curve_float(bNodeTree *, bNode *node)
static int gpu_shader_curve_float(GPUMaterial *mat, bNode *node, bNodeExecData *, GPUNodeStack *in, GPUNodeStack *out)
static void sh_node_curve_rgb_build_multi_function(NodeMultiFunctionBuilder &builder)
static int gpu_shader_curve_rgb(GPUMaterial *mat, bNode *node, bNodeExecData *, GPUNodeStack *in, GPUNodeStack *out)
static void sh_node_curve_rgb_declare(NodeDeclarationBuilder &b)
static void node_shader_init_curve_rgb(bNodeTree *, bNode *node)
static void node_shader_init_curve_vec(bNodeTree *, bNode *node)
static int gpu_shader_curve_vec(GPUMaterial *mat, bNode *node, bNodeExecData *, GPUNodeStack *in, GPUNodeStack *out)
static void sh_node_curve_vec_declare(NodeDeclarationBuilder &b)
static void sh_node_curve_vec_build_multi_function(NodeMultiFunctionBuilder &builder)
ColorSceneLinear4f< eAlpha::Premultiplied > ColorGeometry4f
VecBase< float, 3 > float3
#define NODE_SHADER_MATERIALX_BEGIN
#define NODE_SHADER_MATERIALX_END
void register_node_type_sh_curve_float()
void register_node_type_sh_curve_rgb()
void register_node_type_sh_curve_vec()
void common_node_type_base(blender::bke::bNodeType *ntype, std::string idname, const std::optional< int16_t > legacy_type)
void node_copy_curves(bNodeTree *, bNode *dest_node, const bNode *src_node)
void node_free_curves(bNode *node)
NodeMaterialXFunction materialx_fn
std::string ui_description
void(* initfunc)(bNodeTree *ntree, bNode *node)
NodeGPUExecFunction gpu_fn
NodeMultiFunctionBuildFunction build_multi_function
const char * enum_name_legacy
NodeDeclareFunction declare