Blender  V3.3
Macros | Typedefs | Functions | Variables
node_texture_proc.c File Reference
#include "NOD_texture.h"
#include "node_texture_util.h"
#include "RE_texture.h"

Go to the source code of this file.

Macros

#define I   2 /* count */
 
#define COMMON_INPUTS
 
#define ProcNoInputs(name)
 
#define ProcDef(name)
 
#define TexDef(TEXTYPE, outputs, name, Name)
 
#define C   outputs_color_only
 
#define CV   outputs_both
 

Typedefs

typedef void(* MapFn) (Tex *tex, bNodeStack **in, TexParams *p, const short thread)
 

Functions

static void do_proc (float *result, TexParams *p, const float col1[4], const float col2[4], Tex *tex, const short thread)
 
static void texfn (float *result, TexParams *p, bNode *node, bNodeStack **in, MapFn map_inputs, short thread)
 
static int count_outputs (bNode *node)
 
static void voronoi_map_inputs (Tex *tex, bNodeStack **in, TexParams *p, short thread)
 
 ProcDef (voronoi)
 
 ProcNoInputs (blend)
 
 ProcDef (blend)
 
static void magic_map_inputs (Tex *tex, bNodeStack **in, TexParams *p, short thread)
 
 ProcDef (magic)
 
static void marble_map_inputs (Tex *tex, bNodeStack **in, TexParams *p, short thread)
 
 ProcDef (marble)
 
static void clouds_map_inputs (Tex *tex, bNodeStack **in, TexParams *p, short thread)
 
 ProcDef (clouds)
 
static void distnoise_map_inputs (Tex *tex, bNodeStack **in, TexParams *p, short thread)
 
 ProcDef (distnoise)
 
static void wood_map_inputs (Tex *tex, bNodeStack **in, TexParams *p, short thread)
 
 ProcDef (wood)
 
static void musgrave_map_inputs (Tex *tex, bNodeStack **in, TexParams *p, short thread)
 
 ProcDef (musgrave)
 
 ProcNoInputs (noise)
 
 ProcDef (noise)
 
static void stucci_map_inputs (Tex *tex, bNodeStack **in, TexParams *p, short thread)
 
 ProcDef (stucci)
 
static void init (bNodeTree *UNUSED(ntree), bNode *node)
 

Variables

static bNodeSocketTemplate outputs_both []
 
static bNodeSocketTemplate outputs_color_only [] = {{SOCK_RGBA, N_("Color")}, {-1, ""}}
 
static bNodeSocketTemplate voronoi_inputs []
 
static bNodeSocketTemplate blend_inputs [] = {COMMON_INPUTS, {-1, ""}}
 
static bNodeSocketTemplate magic_inputs []
 
static bNodeSocketTemplate marble_inputs []
 
static bNodeSocketTemplate clouds_inputs []
 
static bNodeSocketTemplate distnoise_inputs []
 
static bNodeSocketTemplate wood_inputs []
 
static bNodeSocketTemplate musgrave_inputs []
 
static bNodeSocketTemplate noise_inputs [] = {COMMON_INPUTS, {-1, ""}}
 
static bNodeSocketTemplate stucci_inputs []
 

Macro Definition Documentation

◆ C

Definition at line 265 of file node_texture_proc.c.

◆ COMMON_INPUTS

#define COMMON_INPUTS
Value:
{SOCK_RGBA, "Color 1", 0.0f, 0.0f, 0.0f, 1.0f}, \
{ \
SOCK_RGBA, "Color 2", 1.0f, 1.0f, 1.0f, 1.0f \
}
@ SOCK_RGBA

Definition at line 23 of file node_texture_proc.c.

◆ CV

#define CV   outputs_both

Definition at line 266 of file node_texture_proc.c.

◆ I

#define I   2 /* count */

Definition at line 22 of file node_texture_proc.c.

◆ ProcDef

#define ProcDef (   name)
Value:
static void name##_colorfn( \
float *result, TexParams *p, bNode *node, bNodeStack **in, short thread) \
{ \
texfn(result, p, node, in, &name##_map_inputs, thread); \
} \
static void name##_exec(void *data, \
int UNUSED(thread), \
bNode *node, \
bNodeExecData *execdata, \
bNodeStack **in, \
{ \
int outs = count_outputs(node); \
if (outs >= 1) { \
tex_output(node, execdata, in, out[0], &name##_colorfn, data); \
} \
}
#define UNUSED(x)
Definition: thread.h:34
OperationNode * node
static const pxr::TfToken out("out", pxr::TfToken::Immortal)
static int count_outputs(bNode *node)

Definition at line 86 of file node_texture_proc.c.

◆ ProcNoInputs

#define ProcNoInputs (   name)
Value:
static void name##_map_inputs( \
{ \
}

Definition at line 80 of file node_texture_proc.c.

◆ TexDef

#define TexDef (   TEXTYPE,
  outputs,
  name,
  Name 
)
Value:
void register_node_type_tex_proc_##name(void) \
{ \
static bNodeType ntype; \
node_type_socket_templates(&ntype, name##_inputs, outputs); \
node_type_size_preset(&ntype, NODE_SIZE_MIDDLE); \
node_type_init(&ntype, init); \
node_type_storage(&ntype, "Tex", node_free_standard_storage, node_copy_standard_storage); \
node_type_exec(&ntype, NULL, NULL, name##_exec); \
ntype.flag |= NODE_PREVIEW; \
}
#define NODE_CLASS_TEXTURE
Definition: BKE_node.h:355
#define TEX_NODE_PROC
Definition: BKE_node.h:1374
void nodeRegisterType(struct bNodeType *ntype)
Definition: node.cc:1357
@ NODE_SIZE_MIDDLE
Definition: BKE_node.h:366
#define NODE_PREVIEW
static bNodeSocketTemplate outputs[]
static void init(bNodeTree *UNUSED(ntree), bNode *node)
void tex_node_type_base(struct bNodeType *ntype, int type, const char *name, short nclass)
void node_copy_standard_storage(bNodeTree *UNUSED(dest_ntree), bNode *dest_node, const bNode *src_node)
Definition: node_util.c:55
void node_free_standard_storage(bNode *node)
Definition: node_util.c:43
Defines a node type.
Definition: BKE_node.h:226

Definition at line 249 of file node_texture_proc.c.

Typedef Documentation

◆ MapFn

typedef void(* MapFn) (Tex *tex, bNodeStack **in, TexParams *p, const short thread)

Definition at line 53 of file node_texture_proc.c.

Function Documentation

◆ clouds_map_inputs()

static void clouds_map_inputs ( Tex tex,
bNodeStack **  in,
TexParams p,
short  thread 
)
static

Definition at line 163 of file node_texture_proc.c.

References I, Tex::noisesize, tex, and tex_input_value().

◆ count_outputs()

static int count_outputs ( bNode node)
static

Definition at line 68 of file node_texture_proc.c.

References bNodeSocket::next, and node.

◆ distnoise_map_inputs()

static void distnoise_map_inputs ( Tex tex,
bNodeStack **  in,
TexParams p,
short  thread 
)
static

Definition at line 175 of file node_texture_proc.c.

References Tex::dist_amount, I, Tex::noisesize, tex, and tex_input_value().

◆ do_proc()

static void do_proc ( float result,
TexParams p,
const float  col1[4],
const float  col2[4],
Tex tex,
const short  thread 
)
static

◆ init()

static void init ( bNodeTree UNUSEDntree,
bNode node 
)
static

◆ magic_map_inputs()

static void magic_map_inputs ( Tex tex,
bNodeStack **  in,
TexParams p,
short  thread 
)
static

Definition at line 139 of file node_texture_proc.c.

References I, tex, tex_input_value(), and Tex::turbul.

◆ marble_map_inputs()

static void marble_map_inputs ( Tex tex,
bNodeStack **  in,
TexParams p,
short  thread 
)
static

Definition at line 151 of file node_texture_proc.c.

References I, Tex::noisesize, tex, tex_input_value(), and Tex::turbul.

◆ musgrave_map_inputs()

static void musgrave_map_inputs ( Tex tex,
bNodeStack **  in,
TexParams p,
short  thread 
)
static

◆ ProcDef() [1/10]

ProcDef ( blend  )

◆ ProcDef() [2/10]

ProcDef ( clouds  )

◆ ProcDef() [3/10]

ProcDef ( distnoise  )

◆ ProcDef() [4/10]

ProcDef ( magic  )

◆ ProcDef() [5/10]

ProcDef ( marble  )

◆ ProcDef() [6/10]

ProcDef ( musgrave  )

◆ ProcDef() [7/10]

ProcDef ( noise  )

◆ ProcDef() [8/10]

ProcDef ( stucci  )

◆ ProcDef() [9/10]

ProcDef ( voronoi  )

◆ ProcDef() [10/10]

ProcDef ( wood  )

◆ ProcNoInputs() [1/2]

ProcNoInputs ( blend  )

◆ ProcNoInputs() [2/2]

ProcNoInputs ( noise  )

◆ stucci_map_inputs()

static void stucci_map_inputs ( Tex tex,
bNodeStack **  in,
TexParams p,
short  thread 
)
static

Definition at line 226 of file node_texture_proc.c.

References I, Tex::noisesize, tex, tex_input_value(), and Tex::turbul.

◆ texfn()

static void texfn ( float result,
TexParams p,
bNode node,
bNodeStack **  in,
MapFn  map_inputs,
short  thread 
)
static

Definition at line 55 of file node_texture_proc.c.

References do_proc(), node, result, tex, and tex_input_rgba().

Referenced by tex_output().

◆ voronoi_map_inputs()

static void voronoi_map_inputs ( Tex tex,
bNodeStack **  in,
TexParams p,
short  thread 
)
static

◆ wood_map_inputs()

static void wood_map_inputs ( Tex tex,
bNodeStack **  in,
TexParams p,
short  thread 
)
static

Definition at line 188 of file node_texture_proc.c.

References I, Tex::noisesize, tex, tex_input_value(), and Tex::turbul.

Variable Documentation

◆ blend_inputs

bNodeSocketTemplate blend_inputs[] = {COMMON_INPUTS, {-1, ""}}
static

Definition at line 130 of file node_texture_proc.c.

◆ clouds_inputs

bNodeSocketTemplate clouds_inputs[]
static
Initial value:
= {
{SOCK_FLOAT, N_("Size"), 0.25f, 0.0f, 0.0f, 0.0f, 0.0001f, 2.0f, PROP_UNSIGNED},
{-1, ""}}
@ SOCK_FLOAT
@ PROP_UNSIGNED
Definition: RNA_types.h:142
#define COMMON_INPUTS
#define N_(msgid)

Definition at line 159 of file node_texture_proc.c.

◆ distnoise_inputs

bNodeSocketTemplate distnoise_inputs[]
static
Initial value:
= {
{SOCK_FLOAT, N_("Size"), 0.25f, 0.0f, 0.0f, 0.0f, 0.0001f, 2.0f, PROP_UNSIGNED},
{SOCK_FLOAT, N_("Distortion"), 1.00f, 0.0f, 0.0f, 0.0f, 0.0000f, 10.0f, PROP_UNSIGNED},
{-1, ""}}

Definition at line 170 of file node_texture_proc.c.

◆ magic_inputs

bNodeSocketTemplate magic_inputs[]
static
Initial value:
= {
{SOCK_FLOAT, N_("Turbulence"), 5.0f, 0.0f, 0.0f, 0.0f, 0.0f, 200.0f, PROP_UNSIGNED},
{-1, ""}}

Definition at line 135 of file node_texture_proc.c.

◆ marble_inputs

bNodeSocketTemplate marble_inputs[]
static
Initial value:
= {
{SOCK_FLOAT, N_("Size"), 0.25f, 0.0f, 0.0f, 0.0f, 0.0001f, 2.0f, PROP_UNSIGNED},
{SOCK_FLOAT, N_("Turbulence"), 5.0f, 0.0f, 0.0f, 0.0f, 0.0f, 200.0f, PROP_UNSIGNED},
{-1, ""}}

Definition at line 146 of file node_texture_proc.c.

◆ musgrave_inputs

bNodeSocketTemplate musgrave_inputs[]
static
Initial value:
= {
{SOCK_FLOAT, N_("H"), 1.0f, 0.0f, 0.0f, 0.0f, 0.0001f, 2.0f, PROP_UNSIGNED},
{SOCK_FLOAT, N_("Lacunarity"), 2.0f, 0.0f, 0.0f, 0.0f, 0.0f, 6.0f, PROP_UNSIGNED},
{SOCK_FLOAT, N_("Octaves"), 2.0f, 0.0f, 0.0f, 0.0f, 0.0f, 8.0f, PROP_UNSIGNED},
{SOCK_FLOAT, N_("iScale"), 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 10.0f, PROP_UNSIGNED},
{SOCK_FLOAT, N_("Size"), 0.25f, 0.0f, 0.0f, 0.0f, 0.0001f, 2.0f, PROP_UNSIGNED},
{-1, ""}}

Definition at line 196 of file node_texture_proc.c.

◆ noise_inputs

bNodeSocketTemplate noise_inputs[] = {COMMON_INPUTS, {-1, ""}}
static

Definition at line 216 of file node_texture_proc.c.

◆ outputs_both

bNodeSocketTemplate outputs_both[]
static
Initial value:
= {{SOCK_RGBA, N_("Color"), 1.0f, 0.0f, 0.0f, 1.0f},
{-1, ""}}

Definition at line 17 of file node_texture_proc.c.

◆ outputs_color_only

bNodeSocketTemplate outputs_color_only[] = {{SOCK_RGBA, N_("Color")}, {-1, ""}}
static

Definition at line 19 of file node_texture_proc.c.

◆ stucci_inputs

bNodeSocketTemplate stucci_inputs[]
static
Initial value:
= {
{SOCK_FLOAT, N_("Size"), 0.25f, 0.0f, 0.0f, 0.0f, 0.0001f, 2.0f, PROP_UNSIGNED},
{SOCK_FLOAT, N_("Turbulence"), 5.0f, 0.0f, 0.0f, 0.0f, 0.0f, 200.0f, PROP_UNSIGNED},
{-1, ""}}

Definition at line 221 of file node_texture_proc.c.

◆ voronoi_inputs

bNodeSocketTemplate voronoi_inputs[]
static
Initial value:
= {
{SOCK_FLOAT, N_("W1"), 1.0f, 0.0f, 0.0f, 0.0f, -2.0f, 2.0f, PROP_NONE},
{SOCK_FLOAT, N_("W2"), 0.0f, 0.0f, 0.0f, 0.0f, -2.0f, 2.0f, PROP_NONE},
{SOCK_FLOAT, N_("W3"), 0.0f, 0.0f, 0.0f, 0.0f, -2.0f, 2.0f, PROP_NONE},
{SOCK_FLOAT, N_("W4"), 0.0f, 0.0f, 0.0f, 0.0f, -2.0f, 2.0f, PROP_NONE},
{SOCK_FLOAT, N_("iScale"), 1.0f, 0.0f, 0.0f, 0.0f, 0.01f, 10.0f, PROP_UNSIGNED},
{SOCK_FLOAT, N_("Size"), 0.25f, 0.0f, 0.0f, 0.0f, 0.0001f, 4.0f, PROP_UNSIGNED},
{-1, ""}}
@ PROP_NONE
Definition: RNA_types.h:126

Definition at line 106 of file node_texture_proc.c.

◆ wood_inputs

bNodeSocketTemplate wood_inputs[]
static
Initial value:
= {
{SOCK_FLOAT, N_("Size"), 0.25f, 0.0f, 0.0f, 0.0f, 0.0001f, 2.0f, PROP_UNSIGNED},
{SOCK_FLOAT, N_("Turbulence"), 5.0f, 0.0f, 0.0f, 0.0f, 0.0f, 200.0f, PROP_UNSIGNED},
{-1, ""}}

Definition at line 183 of file node_texture_proc.c.