Blender  V2.59
Defines | Typedefs | Functions | Variables
TEX_proc.c File Reference
#include "../TEX_util.h"
#include "TEX_node.h"
#include "RE_shader_ext.h"

Go to the source code of this file.

Defines

#define I   2
#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, short thread)

Functions

static void do_proc (float *result, TexParams *p, float *col1, float *col2, char is_normal, Tex *tex, short thread)
static void texfn (float *result, TexParams *p, bNode *node, bNodeStack **in, char is_normal, 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)
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)
static void stucci_map_inputs (Tex *tex, bNodeStack **in, TexParams *p, short thread)
 ProcDef (stucci)

Variables

static bNodeSocketType outputs_both []
static bNodeSocketType outputs_color_only []
static bNodeSocketType voronoi_inputs []

Detailed Description

Definition in file TEX_proc.c.


Define Documentation

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

Definition at line 56 of file TEX_proc.c.

Referenced by ProcDef(), and ProcNoInputs().

#define CV   outputs_both

Definition at line 314 of file TEX_proc.c.

#define I   2
#define ProcDef (   name)
Value:
static void name##_colorfn(float *result, TexParams *p, bNode *node, bNodeStack **in, short thread)  \
                {                                                                                                    \
                                texfn(result, p, node, in, 0, &name##_map_inputs, thread);                               \
                }                                                                                                    \
                static void name##_normalfn(float *result, TexParams *p, bNode *node, bNodeStack **in, short thread) \
                {                                                                                                    \
                                texfn(result, p, node, in, 1, &name##_map_inputs, thread);                               \
                }                                                                                                    \
                static void name##_exec(void *data, bNode *node, bNodeStack **in, bNodeStack **out)                  \
                {                                                                                                    \
                                int outs = count_outputs(node);                                                              \
                                if(outs >= 1) tex_output(node, in, out[0], &name##_colorfn, data);                                 \
                                if(outs >= 2) tex_output(node, in, out[1], &name##_normalfn, data);                                \
                }

Definition at line 124 of file TEX_proc.c.

#define ProcNoInputs (   name)
Value:
static void name##_map_inputs(Tex *UNUSED(tex), bNodeStack **UNUSED(in), TexParams *UNUSED(p), short UNUSED(thread)) \
                {}

Definition at line 120 of file TEX_proc.c.

#define TexDef (   TEXTYPE,
  outputs,
  name,
  Name 
)
Value:
void register_node_type_tex_proc_##name(ListBase *lb) \
{ \
        static bNodeType ntype; \
	\
	node_type_base(&ntype, TEX_NODE_PROC+TEXTYPE, Name, NODE_CLASS_TEXTURE, NODE_PREVIEW|NODE_OPTIONS, name##_inputs, outputs); \
        node_type_size(&ntype, 140, 80, 140); \
        node_type_init(&ntype, init); \
        node_type_storage(&ntype, "Tex", node_free_standard_storage, node_copy_standard_storage); \
        node_type_exec(&ntype, name##_exec); \
	\
	nodeRegisterType(lb, &ntype); \
}

Definition at line 299 of file TEX_proc.c.


Typedef Documentation

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

Definition at line 87 of file TEX_proc.c.


Function Documentation

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

Definition at line 206 of file TEX_proc.c.

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

static int count_outputs ( bNode node) [static]

Definition at line 108 of file TEX_proc.c.

References ListBase::first, bNodeSocket::next, and bNode::outputs.

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

Definition at line 219 of file TEX_proc.c.

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

static void do_proc ( float *  result,
TexParams p,
float *  col1,
float *  col2,
char  is_normal,
Tex tex,
short  thread 
) [static]
static void magic_map_inputs ( Tex tex,
bNodeStack **  in,
TexParams p,
short  thread 
) [static]

Definition at line 180 of file TEX_proc.c.

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

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

Definition at line 193 of file TEX_proc.c.

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

static void musgrave_map_inputs ( Tex tex,
bNodeStack **  in,
TexParams p,
short  thread 
) [static]
ProcDef ( voronoi  )

Definition at line 164 of file TEX_proc.c.

References COMMON_INPUTS.

ProcDef ( magic  )

Definition at line 184 of file TEX_proc.c.

References COMMON_INPUTS, and SOCK_VALUE.

ProcDef ( marble  )

Definition at line 198 of file TEX_proc.c.

References COMMON_INPUTS, and SOCK_VALUE.

ProcDef ( clouds  )

Definition at line 210 of file TEX_proc.c.

References COMMON_INPUTS, and SOCK_VALUE.

ProcDef ( distnoise  )

Definition at line 224 of file TEX_proc.c.

References COMMON_INPUTS, and SOCK_VALUE.

ProcDef ( wood  )

Definition at line 238 of file TEX_proc.c.

References COMMON_INPUTS, and SOCK_VALUE.

ProcDef ( musgrave  )

Definition at line 259 of file TEX_proc.c.

References COMMON_INPUTS.

ProcDef ( stucci  )
ProcNoInputs ( blend  )

Definition at line 171 of file TEX_proc.c.

References COMMON_INPUTS, and SOCK_VALUE.

ProcNoInputs ( noise  )

Definition at line 266 of file TEX_proc.c.

References COMMON_INPUTS, and SOCK_VALUE.

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

Definition at line 276 of file TEX_proc.c.

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

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

Definition at line 89 of file TEX_proc.c.

References do_proc(), bNode::storage, and tex_input_rgba().

Referenced by tex_output().

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

Definition at line 233 of file TEX_proc.c.

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


Variable Documentation

Initial value:
 {
        { SOCK_RGBA, 0, "Color",  1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f },
        { SOCK_VECTOR, 0, "Normal", 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f },
        { -1, 0, "" }
}

Definition at line 44 of file TEX_proc.c.

Initial value:
 {
        { SOCK_RGBA, 0, "Color",  1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f },
        { -1, 0, "" }
}

Definition at line 49 of file TEX_proc.c.

Initial value:
 {
        COMMON_INPUTS,
        { SOCK_VALUE, 1, "W1", 1.0f, 0.0f, 0.0f, 0.0f,   -2.0f, 2.0f },
        { SOCK_VALUE, 1, "W2", 0.0f, 0.0f, 0.0f, 0.0f,   -2.0f, 2.0f },
        { SOCK_VALUE, 1, "W3", 0.0f, 0.0f, 0.0f, 0.0f,   -2.0f, 2.0f },
        { SOCK_VALUE, 1, "W4", 0.0f, 0.0f, 0.0f, 0.0f,   -2.0f, 2.0f },
        
        { SOCK_VALUE, 1, "iScale", 1.0f, 0.0f, 0.0f, 0.0f,    0.01f,  10.0f },
        { SOCK_VALUE, 1, "Size",   0.25f, 0.0f, 0.0f, 0.0f,   0.0001f, 4.0f },
        
        { -1, 0, "" }
}

Definition at line 142 of file TEX_proc.c.