30 .description(
"Amount of influence the node exerts on the output vector");
32 "Vector which would be mapped to the curve");
56 float start_slopes[
CM_TOT];
59 float range_minimums[
CM_TOT];
61 float range_dividers[
CM_TOT];
66 "curves_vector_mixed",
87 builder.single_input<
float>(
"Fac");
88 builder.single_input<
float3>(
"Vector");
89 builder.single_output<
float3>(
"Vector");
101 mask.foreach_index([&](
const int64_t i) {
103 if (fac[i] != 1.0f) {
122 return get_input_value(
"Vector", NodeItem::Type::Vector3);
136 ntype.
declare = file_ns::sh_node_curve_vec_declare;
137 ntype.
initfunc = file_ns::node_shader_init_curve_vec;
140 ntype.
gpu_fn = file_ns::gpu_shader_curve_vec;
153 b.is_function_node();
160 .description(
"Amount of influence the node exerts on the output color");
162 .default_value({1.0f, 1.0f, 1.0f, 1.0f})
163 .description(
"Color input on which correction will be applied");
187 float start_slopes[
CM_TOT];
190 float range_minimums[
CM_TOT];
192 float range_dividers[
CM_TOT];
196 float black_level[4] = {0.0f, 0.0f, 0.0f, 1.0f};
197 float white_level[4] = {1.0f, 1.0f, 1.0f, 1.0f};
206 "curves_combined_only",
221 "curves_combined_rgb",
244 builder.single_input<
float>(
"Fac");
260 mask.foreach_index([&](
const int64_t i) {
262 if (fac[i] != 1.0f) {
282 return get_input_value(
"Color", NodeItem::Type::Color4);
296 ntype.
declare = file_ns::sh_node_curve_rgb_declare;
297 ntype.
initfunc = file_ns::node_shader_init_curve_rgb;
300 ntype.
gpu_fn = file_ns::gpu_shader_curve_rgb;
313 b.is_function_node();
344 float start_slopes[
CM_TOT];
347 float range_minimums[
CM_TOT];
349 float range_dividers[
CM_TOT];
354 "curves_float_mixed",
375 builder.single_input<
float>(
"Factor");
376 builder.single_input<
float>(
"Value");
377 builder.single_output<
float>(
"Value");
389 mask.foreach_index([&](
const int64_t i) {
391 if (fac[i] != 1.0f) {
392 val_out[i] = (1.0f - fac[i]) * val_in[i] + fac[i] * val_out[i];
410 return get_input_value(
"Value", NodeItem::Type::Float);
424 ntype.
declare = file_ns::sh_node_curve_float_declare;
425 ntype.
initfunc = file_ns::node_shader_init_curve_float;
428 ntype.
gpu_fn = file_ns::gpu_shader_curve_float;
#define SH_NODE_CURVE_FLOAT
#define NODE_CLASS_CONVERTER
#define SH_NODE_CURVE_VEC
#define NODE_CLASS_OP_VECTOR
#define SH_NODE_CURVE_RGB
#define NODE_CLASS_OP_COLOR
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)
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)
local_group_size(16, 16) .push_constant(Type b
void node_type_size_preset(bNodeType *ntype, eNodeSizePreset size)
void node_type_storage(bNodeType *ntype, const char *storagename, void(*freefunc)(bNode *node), void(*copyfunc)(bNodeTree *dest_ntree, bNode *dest_node, const bNode *src_node))
void node_register_type(bNodeType *ntype)
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)
#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 sh_fn_node_type_base(blender::bke::bNodeType *ntype, int type, const char *name, short nclass)
void node_copy_curves(bNodeTree *, bNode *dest_node, const bNode *src_node)
void node_free_curves(bNode *node)
NodeMaterialXFunction materialx_fn
void(* initfunc)(bNodeTree *ntree, bNode *node)
NodeGPUExecFunction gpu_fn
NodeMultiFunctionBuildFunction build_multi_function
NodeDeclareFunction declare