24 {
SOCK_RGBA,
N_(
"Color"), 1.0f, 0.0f, 0.0f, 1.0f}, {-1,
""}};
30#define COMMON_INPUTS \
31 {SOCK_RGBA, "Color 1", 0.0f, 0.0f, 0.0f, 1.0f}, {SOCK_RGBA, "Color 2", 1.0f, 1.0f, 1.0f, 1.0f}
61 Tex tex = blender::dna::shallow_copy(*((
Tex *)(node->
storage)));
62 float col1[4], col2[4];
82#define ProcNoInputs(name) \
83 static void name##_map_inputs( \
84 Tex * , bNodeStack ** , TexParams * , short ) \
88#define ProcDef(name) \
89 static void name##_colorfn( \
90 float *result, TexParams *p, bNode *node, bNodeStack **in, short thread) \
92 texfn(result, p, node, in, &name##_map_inputs, thread); \
94 static void name##_exec(void *data, \
97 bNodeExecData *execdata, \
101 int outs = count_outputs(node); \
103 tex_output(node, execdata, in, out[0], &name##_colorfn, static_cast<TexCallData *>(data)); \
251#define TexDef(TEXTYPE, idname, outputs, name, Name, EnumNameLegacy) \
252 void register_node_type_tex_proc_##name(void) \
254 static blender::bke::bNodeType ntype; \
256 tex_node_type_base(&ntype, idname, TEX_NODE_PROC + TEXTYPE); \
257 ntype.ui_name = Name; \
258 ntype.enum_name_legacy = EnumNameLegacy; \
259 ntype.nclass = 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
284 TEX_DISTNOISE,
"TextureNodeTexDistNoise",
CV, distnoise,
"Distorted Noise",
"TEX_DISTNOISE");
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])
ATTR_WARN_UNUSED_RESULT const size_t num
void * MEM_callocN(size_t len, const char *str)
static float noise(int n)
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)
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[]
#define TexDef(TEXTYPE, idname, outputs, name, Name, EnumNameLegacy)
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.
static int marble(const Tex *tex, const float texvec[3], TexResult *texres)
static int stucci(const Tex *tex, const float texvec[3], TexResult *texres)
static int wood(const Tex *tex, const float texvec[3], TexResult *texres)
static int magic(const Tex *tex, const float texvec[3], TexResult *texres)
int multitex_nodes(Tex *tex, const float texvec[3], TexResult *texres, const short thread, short which_output, const MTex *mtex, ImagePool *pool)
static int blend(const Tex *tex, const float texvec[3], TexResult *texres)
static int clouds(const Tex *tex, const float texvec[3], TexResult *texres)