31 "The value used to map onto the color gradient. 0.0 results in the leftmost color, "
32 "while 1.0 results in the rightmost");
61 mul_bias[1] = -mul_bias[0] * coba->
data[0].
pos;
64 "valtorgb_opti_linear",
74 "valtorgb_opti_constant",
82 mul_bias[1] = -mul_bias[0] * coba->
data[0].
pos;
113 static const mf::Signature
signature = []() {
115 mf::SignatureBuilder builder{
"Color Band",
signature};
116 builder.single_input<
float>(
"Value");
118 builder.single_output<
float>(
"Alpha");
151 NodeItem res = empty();
167 ntype.
ui_description =
"Map values to colors with the use of a gradient";
170 ntype.
declare = file_ns::sh_node_valtorgb_declare;
171 ntype.
initfunc = file_ns::node_shader_init_valtorgb;
175 ntype.
gpu_fn = file_ns::gpu_shader_valtorgb;
void BKE_colorband_evaluate_table_rgba(const ColorBand *coba, float **array, int *size)
bool BKE_colorband_evaluate(const ColorBand *coba, float in, float out[4])
ColorBand * BKE_colorband_add(bool rangetype)
#define NODE_CLASS_CONVERTER
MINLINE float max_ff(float a, float b)
@ COLBAND_INTERP_CONSTANT
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)
bool GPU_link(GPUMaterial *mat, const char *name,...)
GPUNodeLink * GPU_uniform(const float *num)
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
const Signature & signature() const
void set_signature(const Signature *signature)
void construct_and_set_matching_fn(Args &&...args)
ColorBandFunction(const ColorBand &color_band)
void call(const IndexMask &mask, mf::Params params, mf::Context) const override
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 node_shader_init_valtorgb(bNodeTree *, bNode *node)
static void sh_node_valtorgb_build_multi_function(nodes::NodeMultiFunctionBuilder &builder)
static void sh_node_valtorgb_declare(NodeDeclarationBuilder &b)
static int gpu_shader_valtorgb(GPUMaterial *mat, bNode *node, bNodeExecData *, GPUNodeStack *in, GPUNodeStack *out)
ColorSceneLinear4f< eAlpha::Premultiplied > ColorGeometry4f
#define NODE_SHADER_MATERIALX_BEGIN
#define NODE_SHADER_MATERIALX_END
void register_node_type_sh_valtorgb()
void common_node_type_base(blender::bke::bNodeType *ntype, std::string idname, const std::optional< int16_t > legacy_type)
void node_free_standard_storage(bNode *node)
void node_copy_standard_storage(bNodeTree *, bNode *dest_node, const bNode *src_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