23 #define COMMON_INPUTS \
24 {SOCK_RGBA, "Color 1", 0.0f, 0.0f, 0.0f, 1.0f}, \
26 SOCK_RGBA, "Color 2", 1.0f, 1.0f, 1.0f, 1.0f \
59 float col1[4], col2[4];
72 for (sock =
node->outputs.first; sock; sock = sock->
next) {
80 #define ProcNoInputs(name) \
81 static void name##_map_inputs( \
82 Tex *UNUSED(tex), bNodeStack **UNUSED(in), TexParams *UNUSED(p), short UNUSED(thread)) \
86 #define ProcDef(name) \
87 static void name##_colorfn( \
88 float *result, TexParams *p, bNode *node, bNodeStack **in, short thread) \
90 texfn(result, p, node, in, &name##_map_inputs, thread); \
92 static void name##_exec(void *data, \
95 bNodeExecData *execdata, \
99 int outs = count_outputs(node); \
101 tex_output(node, execdata, in, out[0], &name##_colorfn, data); \
249 #define TexDef(TEXTYPE, outputs, name, Name) \
250 void register_node_type_tex_proc_##name(void) \
252 static bNodeType ntype; \
254 tex_node_type_base(&ntype, TEX_NODE_PROC + TEXTYPE, Name, NODE_CLASS_TEXTURE); \
255 node_type_socket_templates(&ntype, name##_inputs, outputs); \
256 node_type_size_preset(&ntype, NODE_SIZE_MIDDLE); \
257 node_type_init(&ntype, init); \
258 node_type_storage(&ntype, "Tex", node_free_standard_storage, node_copy_standard_storage); \
259 node_type_exec(&ntype, NULL, NULL, name##_exec); \
260 ntype.flag |= NODE_PREVIEW; \
262 nodeRegisterType(&ntype); \
265 #define C outputs_color_only
266 #define CV outputs_both
void ramp_blend(int type, float r_col[3], float fac, const float col[3])
void BKE_texture_default(struct Tex *tex)
MINLINE void copy_v4_v4(float r[4], const float a[4])
in reality light always falls off quadratically Particle Retrieve the data of the particle that spawned the object for example to give variation to multiple instances of an object Point Retrieve information about points in a point cloud Retrieve the edges of an object as it appears to Cycles topology will always appear triangulated Convert a blackbody temperature to an RGB value Normal Generate a perturbed normal from an RGB normal map image Typically used for faking highly detailed surfaces Generate an OSL shader from a file or text data block Image Sample an image file as a texture Sky Generate a procedural sky texture Noise Generate fractal Perlin noise Wave Generate procedural bands or rings with noise TEX_VORONOI
in reality light always falls off quadratically Particle Retrieve the data of the particle that spawned the object for example to give variation to multiple instances of an object Point Retrieve information about points in a point cloud Retrieve the edges of an object as it appears to Cycles topology will always appear triangulated Convert a blackbody temperature to an RGB value Normal Generate a perturbed normal from an RGB normal map image Typically used for faking highly detailed surfaces Generate an OSL shader from a file or text data block Image Sample an image file as a texture Sky Generate a procedural sky texture Noise Generate fractal Perlin noise Wave Generate procedural bands or rings with noise Voronoi Generate Worley noise based on the distance to random points Typically used to generate textures such as or biological cells Brick Generate a procedural texture producing bricks Texture Retrieve multiple types of texture coordinates nTypically used as inputs for texture nodes Vector Convert a or normal between and object coordinate space Combine Create a color from its and value channels Color Retrieve a color or the default fallback if none is specified Separate Split a vector into its and Z components Generates normals with round corners and may slow down renders Vector Displace the surface along an arbitrary direction White Noise
in reality light always falls off quadratically Particle Retrieve the data of the particle that spawned the object for example to give variation to multiple instances of an object Point Retrieve information about points in a point cloud Retrieve the edges of an object as it appears to Cycles topology will always appear triangulated Convert a blackbody temperature to an RGB value Normal Generate a perturbed normal from an RGB normal map image Typically used for faking highly detailed surfaces Generate an OSL shader from a file or text data block Image Sample an image file as a texture Sky Generate a procedural sky texture TEX_NOISE
SyclQueue void void size_t num_bytes void
void *(* MEM_callocN)(size_t len, const char *str)
static float noise(int n)
static bNodeSocketTemplate outputs_color_only[]
static bNodeSocketTemplate outputs_both[]
static bNodeSocketTemplate stucci_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 void texfn(float *result, TexParams *p, bNode *node, bNodeStack **in, MapFn map_inputs, short thread)
static bNodeSocketTemplate distnoise_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)
#define ProcNoInputs(name)
#define TexDef(TEXTYPE, outputs, name, Name)
static bNodeSocketTemplate clouds_inputs[]
static void do_proc(float *result, TexParams *p, const float col1[4], const float col2[4], Tex *tex, const short thread)
static bNodeSocketTemplate musgrave_inputs[]
static bNodeSocketTemplate wood_inputs[]
static void marble_map_inputs(Tex *tex, bNodeStack **in, TexParams *p, short thread)
static bNodeSocketTemplate magic_inputs[]
static bNodeSocketTemplate noise_inputs[]
static void musgrave_map_inputs(Tex *tex, bNodeStack **in, TexParams *p, short thread)
void(* MapFn)(Tex *tex, bNodeStack **in, TexParams *p, const short thread)
static void stucci_map_inputs(Tex *tex, bNodeStack **in, TexParams *p, short thread)
static bNodeSocketTemplate marble_inputs[]
static bNodeSocketTemplate blend_inputs[]
static void init(bNodeTree *UNUSED(ntree), bNode *node)
static bNodeSocketTemplate voronoi_inputs[]
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.
struct bNodeSocket * next
static int marble(const Tex *tex, const float texvec[3], TexResult *texres)
static int stucci(const Tex *tex, const float texvec[3], TexResult *texres)
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, MTex *mtex, struct ImagePool *pool)
static int wood(const Tex *tex, const float texvec[3], TexResult *texres)
static int magic(const Tex *tex, const float texvec[3], TexResult *texres)
static int blend(const Tex *tex, const float texvec[3], TexResult *texres)
static int clouds(const Tex *tex, const float texvec[3], TexResult *texres)