31#define COMMON_INPUTS \
32 {SOCK_RGBA, "Color 1", 0.0f, 0.0f, 0.0f, 1.0f}, {SOCK_RGBA, "Color 2", 1.0f, 1.0f, 1.0f, 1.0f}
63 float col1[4], col2[4];
74 return node->outputs.count();
79#define ProcNoInputs(name) \
80 static void name##_map_inputs( \
81 Tex * , bNodeStack ** , TexParams * , short ) \
85#define ProcDef(name) \
86 static void name##_colorfn( \
87 float *result, TexParams *p, bNode *node, bNodeStack **in, short thread) \
89 texfn(result, p, node, in, &name##_map_inputs, thread); \
91 static void name##_exec(void *data, \
94 bNodeExecData *execdata, \
98 int outs = count_outputs(node); \
100 tex_output(node, execdata, in, out[0], &name##_colorfn, static_cast<TexCallData *>(data)); \
236 Tex *tex = MEM_new<Tex>(
"Tex");
248#define TexDef(TEXTYPE, idname, outputs, name, Name, EnumNameLegacy) \
249 void register_node_type_tex_proc_##name(void) \
251 static bke::bNodeType ntype; \
253 tex_node_type_base(&ntype, UString(idname), TEX_NODE_PROC + TEXTYPE); \
254 ntype.ui_name = Name; \
255 ntype.enum_name_legacy = EnumNameLegacy; \
256 ntype.nclass = NODE_CLASS_TEXTURE; \
257 bke::node_type_socket_templates(&ntype, name##_inputs, outputs); \
258 ntype.default_width = bke::NodeWidth::_160; \
259 ntype.initfunc = init; \
260 bke::node_type_storage(ntype, "Tex", node_free_standard_storage, node_copy_standard_storage); \
261 ntype.exec_fn = name##_exec; \
262 ntype.flag |= NODE_PREVIEW; \
264 bke::node_register_type(ntype); \
267#define C outputs_color_only
268#define CV outputs_both
280 TEX_DISTNOISE,
"TextureNodeTexDistNoise",
CV, distnoise,
"Distorted Noise",
"TEX_DISTNOISE");
General operations, lookup, etc. for materials.
internal::ShallowDataConstRef< T > shallow_copy(const T &other)
void ramp_blend(int type, float r_col[4], float fac, const float col[4])
static void stucci_map_inputs(Tex *tex, bNodeStack **in, TexParams *p, short thread)
static bke::bNodeSocketTemplate outputs_both[]
void tex_input_rgba(float *out, bNodeStack *in, TexParams *params, short thread)
static void clouds_map_inputs(Tex *tex, bNodeStack **in, TexParams *p, short thread)
static void distnoise_map_inputs(Tex *tex, bNodeStack **in, TexParams *p, short thread)
static bke::bNodeSocketTemplate outputs_color_only[]
static void texfn(float *result, TexParams *p, bNode *node, bNodeStack **in, MapFn map_inputs, short thread)
static bke::bNodeSocketTemplate blend_inputs[]
static bke::bNodeSocketTemplate noise_inputs[]
static void musgrave_map_inputs(Tex *tex, bNodeStack **in, TexParams *p, short thread)
static void voronoi_map_inputs(Tex *tex, bNodeStack **in, TexParams *p, short thread)
static bke::bNodeSocketTemplate clouds_inputs[]
static bke::bNodeSocketTemplate marble_inputs[]
void BKE_texture_default(struct Tex *tex)
static bke::bNodeSocketTemplate magic_inputs[]
static int count_outputs(bNode *node)
static bke::bNodeSocketTemplate wood_inputs[]
TexDef(TEX_VORONOI, "TextureNodeTexVoronoi", CV, voronoi, "Voronoi", "TEX_VORONOI")
int multitex_nodes(Tex *tex, const float texvec[3], TexResult *texres, const short thread, short which_output, const MTex *mtex, ImagePool *pool)
float tex_input_value(bNodeStack *in, TexParams *params, short thread)
static void do_proc(float *result, TexParams *p, const float col1[4], const float col2[4], Tex *tex, const short thread)
static bke::bNodeSocketTemplate voronoi_inputs[]
void(*)(Tex *tex, bNodeStack **in, TexParams *p, const short thread) MapFn
static bke::bNodeSocketTemplate distnoise_inputs[]
MINLINE void copy_v4_v4(float r[4], const float a[4])
static void marble_map_inputs(Tex *tex, bNodeStack **in, TexParams *p, short thread)
static bke::bNodeSocketTemplate musgrave_inputs[]
static void wood_map_inputs(Tex *tex, bNodeStack **in, TexParams *p, short thread)
static void magic_map_inputs(Tex *tex, bNodeStack **in, TexParams *p, short thread)
static bke::bNodeSocketTemplate stucci_inputs[]
Compact definition of a node socket.