Blender V5.0
node_texture_proc.cc File Reference
#include "BKE_material.hh"
#include "BKE_texture.h"
#include "BLI_listbase.h"
#include "BLI_math_vector.h"
#include "DNA_material_types.h"
#include "node_texture_util.hh"
#include "node_util.hh"
#include "RE_texture.h"

Go to the source code of this file.

Macros

#define I   2 /* count */
#define COMMON_INPUTS   {SOCK_RGBA, "Color 1", 0.0f, 0.0f, 0.0f, 1.0f}, {SOCK_RGBA, "Color 2", 1.0f, 1.0f, 1.0f, 1.0f}
#define ProcNoInputs(name)
#define ProcDef(name)
#define TexDef(TEXTYPE, idname, outputs, name, Name, EnumNameLegacy)
#define C   outputs_color_only
#define CV   outputs_both

Typedefs

using MapFn = void (*)(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 *, bNode *node)
 TexDef (TEX_VORONOI, "TextureNodeTexVoronoi", CV, voronoi, "Voronoi", "TEX_VORONOI")
 TexDef (TEX_BLEND, "TextureNodeTexBlend", C, blend, "Blend", "TEX_BLEND")
 TexDef (TEX_MAGIC, "TextureNodeTexMagic", C, magic, "Magic", "TEX_MAGIC")
 TexDef (TEX_MARBLE, "TextureNodeTexMarble", CV, marble, "Marble", "TEX_MARBLE")
 TexDef (TEX_CLOUDS, "TextureNodeTexClouds", CV, clouds, "Clouds", "TEX_CLOUDS")
 TexDef (TEX_WOOD, "TextureNodeTexWood", CV, wood, "Wood", "TEX_WOOD")
 TexDef (TEX_MUSGRAVE, "TextureNodeTexMusgrave", CV, musgrave, "Musgrave", "TEX_MUSGRAVE")
 TexDef (TEX_NOISE, "TextureNodeTexNoise", C, noise, "Noise", "TEX_NOISE")
 TexDef (TEX_STUCCI, "TextureNodeTexStucci", CV, stucci, "Stucci", "TEX_STUCCI")
 TexDef (TEX_DISTNOISE, "TextureNodeTexDistNoise", CV, distnoise, "Distorted Noise", "TEX_DISTNOISE")

Variables

static blender::bke::bNodeSocketTemplate outputs_both []
static blender::bke::bNodeSocketTemplate outputs_color_only []
static blender::bke::bNodeSocketTemplate voronoi_inputs []
static blender::bke::bNodeSocketTemplate blend_inputs [] = {COMMON_INPUTS, {-1, ""}}
static blender::bke::bNodeSocketTemplate magic_inputs []
static blender::bke::bNodeSocketTemplate marble_inputs []
static blender::bke::bNodeSocketTemplate clouds_inputs []
static blender::bke::bNodeSocketTemplate distnoise_inputs []
static blender::bke::bNodeSocketTemplate wood_inputs []
static blender::bke::bNodeSocketTemplate musgrave_inputs []
static blender::bke::bNodeSocketTemplate noise_inputs [] = {COMMON_INPUTS, {-1, ""}}
static blender::bke::bNodeSocketTemplate stucci_inputs []

Macro Definition Documentation

◆ C

#define C   outputs_color_only

Definition at line 271 of file node_texture_proc.cc.

◆ COMMON_INPUTS

#define COMMON_INPUTS   {SOCK_RGBA, "Color 1", 0.0f, 0.0f, 0.0f, 1.0f}, {SOCK_RGBA, "Color 2", 1.0f, 1.0f, 1.0f, 1.0f}

Definition at line 30 of file node_texture_proc.cc.

◆ CV

◆ I

#define I   2 /* count */

Definition at line 29 of file node_texture_proc.cc.

Referenced by btDeformableLinearElasticityForce::addScaledDampingForce(), btDeformableNeoHookeanForce::addScaledDampingForce(), btDeformableLinearElasticityForce::addScaledDampingForceDifferential(), btDeformableNeoHookeanForce::addScaledDampingForceDifferential(), btDeformableLinearElasticityForce::addScaledHessian(), btSoftBody::applyRepulsionForce(), blender::ValueSequence< T, Elements >::at_index(), blinn_specular(), bump_shadowing_term(), clouds_map_inputs(), btRigidBody::computeGyroscopicImpulseImplicit_World(), libmv::ComputeTrackingEquation(), libmv::ComputeTrackingEquation(), Freestyle::computeVisibility(), copy_particle_systems_to_object(), dfdx_spring(), distnoise_map_inputs(), ensure_valid_specular_reflection(), evalEulerEqn(), evalEulerEqnDeriv(), blender::fn::multi_function::build::detail::execute_element_fn_as_multi_function(), blender::fn::lazy_function::detail::execute_lazy_function_eagerly_impl(), film_adaptive_sampling_convergence_check(), Freestyle::findOccludee(), Freestyle::findOccludee(), blender::detail::get_default_hash_array(), guiding_record_volume_segment(), light_pdf_area_to_solid_angle(), magic_map_inputs(), marble_map_inputs(), mirrorball_to_direction(), musgrave_map_inputs(), btDeformableBackwardEulerObjective::reinitialize(), libmv::SelectKeyframesBasedOnGRICAndVariance(), shader_setup_from_displace(), shader_setup_from_sample(), SIM_hair_volume_vertex_grid_forces(), SIM_mass_spring_add_constraint_ndof1(), SIM_mass_spring_add_constraint_ndof2(), SIM_mass_spring_force_drag(), SIM_mass_spring_force_spring_bending_hair(), SIM_mass_spring_solver_create(), spring_grad_dir(), stucci_map_inputs(), studiolight_lights_eval(), triangle_light_pdf_area_sampling(), blender::unroll_impl(), voronoi_map_inputs(), and wood_map_inputs().

◆ 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 /*thread*/, \
bNode *node, \
bNodeExecData *execdata, \
{ \
int outs = count_outputs(node); \
if (outs >= 1) { \
tex_output(node, execdata, in, out[0], &name##_colorfn, static_cast<TexCallData *>(data)); \
} \
}
BMesh const char void * data
#define in
#define out
static int count_outputs(bNode *node)
const char * name

Definition at line 88 of file node_texture_proc.cc.

◆ ProcNoInputs

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

Definition at line 82 of file node_texture_proc.cc.

◆ TexDef

#define TexDef ( TEXTYPE,
idname,
outputs,
name,
Name,
EnumNameLegacy )
Value:
void register_node_type_tex_proc_##name(void) \
{ \
static blender::bke::bNodeType ntype; \
\
tex_node_type_base(&ntype, idname, TEX_NODE_PROC + TEXTYPE); \
ntype.ui_name = Name; \
ntype.enum_name_legacy = EnumNameLegacy; \
blender::bke::node_type_socket_templates(&ntype, name##_inputs, outputs); \
blender::bke::node_type_size_preset(ntype, blender::bke::eNodeSizePreset::Middle); \
ntype.initfunc = init; \
blender::bke::node_type_storage( \
ntype.exec_fn = name##_exec; \
ntype.flag |= NODE_PREVIEW; \
\
blender::bke::node_register_type(ntype); \
}
#define NODE_CLASS_TEXTURE
Definition BKE_node.hh:457
#define TEX_NODE_PROC
@ NODE_PREVIEW
static blender::bke::bNodeSocketTemplate outputs[]
static void init(bNodeTree *, bNode *node)
void node_free_standard_storage(bNode *node)
Definition node_util.cc:42
void node_copy_standard_storage(bNodeTree *, bNode *dest_node, const bNode *src_node)
Definition node_util.cc:54
Defines a node type.
Definition BKE_node.hh:238
NodeExecFunction exec_fn
Definition BKE_node.hh:340
void(* initfunc)(bNodeTree *ntree, bNode *node)
Definition BKE_node.hh:289
const char * enum_name_legacy
Definition BKE_node.hh:247

Definition at line 251 of file node_texture_proc.cc.

Typedef Documentation

◆ MapFn

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

Definition at line 56 of file node_texture_proc.cc.

Function Documentation

◆ clouds_map_inputs()

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

Definition at line 165 of file node_texture_proc.cc.

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

◆ count_outputs()

int count_outputs ( bNode * node)
static

Definition at line 71 of file node_texture_proc.cc.

References LISTBASE_FOREACH, num, and bNode::outputs.

◆ distnoise_map_inputs()

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

Definition at line 177 of file node_texture_proc.cc.

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

◆ do_proc()

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

◆ init()

◆ magic_map_inputs()

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

Definition at line 141 of file node_texture_proc.cc.

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

◆ marble_map_inputs()

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

Definition at line 153 of file node_texture_proc.cc.

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

◆ musgrave_map_inputs()

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

◆ ProcDef() [1/10]

ProcDef ( blend )

References blend().

◆ ProcDef() [2/10]

ProcDef ( clouds )

References clouds().

◆ ProcDef() [3/10]

ProcDef ( distnoise )

◆ ProcDef() [4/10]

ProcDef ( magic )

References magic().

◆ ProcDef() [5/10]

ProcDef ( marble )

References marble().

◆ ProcDef() [6/10]

ProcDef ( musgrave )

◆ ProcDef() [7/10]

ProcDef ( noise )

References noise().

◆ ProcDef() [8/10]

ProcDef ( stucci )

References stucci().

◆ ProcDef() [9/10]

ProcDef ( voronoi )

◆ ProcDef() [10/10]

ProcDef ( wood )

References wood().

◆ ProcNoInputs() [1/2]

ProcNoInputs ( blend )

References blend().

◆ ProcNoInputs() [2/2]

ProcNoInputs ( noise )

References noise().

◆ stucci_map_inputs()

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

Definition at line 228 of file node_texture_proc.cc.

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

◆ TexDef() [1/10]

TexDef ( TEX_BLEND ,
"TextureNodeTexBlend" ,
C ,
blend ,
"Blend" ,
"TEX_BLEND"  )

References blend(), C, and TEX_BLEND.

◆ TexDef() [2/10]

TexDef ( TEX_CLOUDS ,
"TextureNodeTexClouds" ,
CV ,
clouds ,
"Clouds" ,
"TEX_CLOUDS"  )

References clouds(), CV, and TEX_CLOUDS.

◆ TexDef() [3/10]

TexDef ( TEX_DISTNOISE ,
"TextureNodeTexDistNoise" ,
CV ,
distnoise ,
"Distorted Noise" ,
"TEX_DISTNOISE"  )

References CV, and TEX_DISTNOISE.

◆ TexDef() [4/10]

TexDef ( TEX_MAGIC ,
"TextureNodeTexMagic" ,
C ,
magic ,
"Magic" ,
"TEX_MAGIC"  )

References C, magic(), and TEX_MAGIC.

◆ TexDef() [5/10]

TexDef ( TEX_MARBLE ,
"TextureNodeTexMarble" ,
CV ,
marble ,
"Marble" ,
"TEX_MARBLE"  )

References CV, marble(), and TEX_MARBLE.

◆ TexDef() [6/10]

TexDef ( TEX_MUSGRAVE ,
"TextureNodeTexMusgrave" ,
CV ,
musgrave ,
"Musgrave" ,
"TEX_MUSGRAVE"  )

References CV, and TEX_MUSGRAVE.

◆ TexDef() [7/10]

TexDef ( TEX_NOISE ,
"TextureNodeTexNoise" ,
C ,
noise ,
"Noise" ,
"TEX_NOISE"  )

References C, noise(), and TEX_NOISE.

◆ TexDef() [8/10]

TexDef ( TEX_STUCCI ,
"TextureNodeTexStucci" ,
CV ,
stucci ,
"Stucci" ,
"TEX_STUCCI"  )

References CV, stucci(), and TEX_STUCCI.

◆ TexDef() [9/10]

TexDef ( TEX_VORONOI ,
"TextureNodeTexVoronoi" ,
CV ,
voronoi ,
"Voronoi" ,
"TEX_VORONOI"  )

References CV, and TEX_VORONOI.

◆ TexDef() [10/10]

TexDef ( TEX_WOOD ,
"TextureNodeTexWood" ,
CV ,
wood ,
"Wood" ,
"TEX_WOOD"  )

References CV, TEX_WOOD, and wood().

◆ texfn()

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

Definition at line 58 of file node_texture_proc.cc.

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

Referenced by tex_output().

◆ voronoi_map_inputs()

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

◆ wood_map_inputs()

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

Definition at line 190 of file node_texture_proc.cc.

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

Variable Documentation

◆ blend_inputs

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

Definition at line 132 of file node_texture_proc.cc.

◆ clouds_inputs

blender::bke::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.hh:249
#define COMMON_INPUTS
#define N_(msgid)

Definition at line 161 of file node_texture_proc.cc.

◆ distnoise_inputs

blender::bke::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 172 of file node_texture_proc.cc.

◆ magic_inputs

blender::bke::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 137 of file node_texture_proc.cc.

◆ marble_inputs

blender::bke::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 148 of file node_texture_proc.cc.

◆ musgrave_inputs

blender::bke::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 198 of file node_texture_proc.cc.

◆ noise_inputs

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

Definition at line 218 of file node_texture_proc.cc.

◆ outputs_both

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

Definition at line 23 of file node_texture_proc.cc.

◆ outputs_color_only

blender::bke::bNodeSocketTemplate outputs_color_only[]
static
Initial value:
= {{SOCK_RGBA, N_("Color")},
{-1, ""}}

Definition at line 25 of file node_texture_proc.cc.

◆ stucci_inputs

blender::bke::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 223 of file node_texture_proc.cc.

◆ voronoi_inputs

blender::bke::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.hh:233

Definition at line 108 of file node_texture_proc.cc.

◆ wood_inputs

blender::bke::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 185 of file node_texture_proc.cc.