23 {
SOCK_RGBA,
N_(
"Color"), 1.0f, 0.0f, 0.0f, 1.0f}, {-1,
""}};
29#define COMMON_INPUTS \
30 {SOCK_RGBA, "Color 1", 0.0f, 0.0f, 0.0f, 1.0f}, \
32 SOCK_RGBA, "Color 2", 1.0f, 1.0f, 1.0f, 1.0f \
64 Tex tex = blender::dna::shallow_copy(*((
Tex *)(node->storage)));
65 float col1[4], col2[4];
85#define ProcNoInputs(name) \
86 static void name##_map_inputs( \
87 Tex * , bNodeStack ** , TexParams * , short ) \
91#define ProcDef(name) \
92 static void name##_colorfn( \
93 float *result, TexParams *p, bNode *node, bNodeStack **in, short thread) \
95 texfn(result, p, node, in, &name##_map_inputs, thread); \
97 static void name##_exec(void *data, \
100 bNodeExecData *execdata, \
104 int outs = count_outputs(node); \
106 tex_output(node, execdata, in, out[0], &name##_colorfn, static_cast<TexCallData *>(data)); \
254#define TexDef(TEXTYPE, outputs, name, Name) \
255 void register_node_type_tex_proc_##name(void) \
257 static blender::bke::bNodeType ntype; \
259 tex_node_type_base(&ntype, TEX_NODE_PROC + TEXTYPE, Name, NODE_CLASS_TEXTURE); \
260 blender::bke::node_type_socket_templates(&ntype, name##_inputs, outputs); \
261 blender::bke::node_type_size_preset(&ntype, blender::bke::eNodeSizePreset::Middle); \
262 ntype.initfunc = init; \
263 blender::bke::node_type_storage( \
264 &ntype, "Tex", node_free_standard_storage, node_copy_standard_storage); \
265 ntype.exec_fn = name##_exec; \
266 ntype.flag |= NODE_PREVIEW; \
268 blender::bke::node_register_type(&ntype); \
271#define C outputs_color_only
272#define CV outputs_both
277TexDef(TEX_MUSGRAVE,
CV, musgrave, "Musgrave")
TexDef(TEX_NOISE, C, noise, "Noise");
279TexDef(TEX_DISTNOISE,
CV, distnoise, "Distorted Noise");
General operations, lookup, etc. for materials.
void ramp_blend(int type, float r_col[3], float fac, const float col[3])
void BKE_texture_default(struct Tex *tex)
#define LISTBASE_FOREACH(type, var, list)
MINLINE void copy_v4_v4(float r[4], const float a[4])
void *(* MEM_callocN)(size_t len, const char *str)
static blender::bke::bNodeSocketTemplate blend_inputs[]
static void voronoi_map_inputs(Tex *tex, bNodeStack **in, TexParams *p, short thread)
static void distnoise_map_inputs(Tex *tex, bNodeStack **in, TexParams *p, short thread)
static blender::bke::bNodeSocketTemplate marble_inputs[]
static void texfn(float *result, TexParams *p, bNode *node, bNodeStack **in, MapFn map_inputs, short thread)
static blender::bke::bNodeSocketTemplate magic_inputs[]
static int count_outputs(bNode *node)
static void clouds_map_inputs(Tex *tex, bNodeStack **in, TexParams *p, short thread)
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 blender::bke::bNodeSocketTemplate musgrave_inputs[]
#define ProcNoInputs(name)
#define TexDef(TEXTYPE, outputs, name, Name)
static void do_proc(float *result, TexParams *p, const float col1[4], const float col2[4], Tex *tex, const short thread)
static blender::bke::bNodeSocketTemplate outputs_color_only[]
static void marble_map_inputs(Tex *tex, bNodeStack **in, TexParams *p, short thread)
static blender::bke::bNodeSocketTemplate clouds_inputs[]
static blender::bke::bNodeSocketTemplate wood_inputs[]
static blender::bke::bNodeSocketTemplate distnoise_inputs[]
static void musgrave_map_inputs(Tex *tex, bNodeStack **in, TexParams *p, short thread)
void(*)(Tex *tex, bNodeStack **in, TexParams *p, const short thread) MapFn
static void stucci_map_inputs(Tex *tex, bNodeStack **in, TexParams *p, short thread)
static blender::bke::bNodeSocketTemplate voronoi_inputs[]
static blender::bke::bNodeSocketTemplate noise_inputs[]
static blender::bke::bNodeSocketTemplate stucci_inputs[]
static blender::bke::bNodeSocketTemplate outputs_both[]
float tex_input_value(bNodeStack *in, TexParams *params, short thread)
void tex_input_rgba(float *out, bNodeStack *in, TexParams *params, short thread)
Compact definition of a node socket.
int multitex_nodes(Tex *tex, const float texvec[3], float dxt[3], float dyt[3], int osatex, TexResult *texres, const short thread, short which_output, const MTex *mtex, ImagePool *pool)
static int stucci(const Tex *tex, const float texvec[3], TexResult *texres)
static int magic(const Tex *tex, const float texvec[3], TexResult *texres)
static int clouds(const Tex *tex, const float texvec[3], TexResult *texres)