28 "The coordinates at which Gabor noise will be evaluated. The Z component is ignored in "
31 "The scale of the Gabor noise");
36 "The rate at which the Gabor noise changes across space. This is different from the "
37 "Scale input in that it only scales perpendicular to the Gabor noise direction");
44 "The directionality of Gabor noise. 1 means the noise is completely directional, while "
45 "0 means the noise is omnidirectional");
46 b.add_input<
decl::Float>(
"Orientation",
"Orientation 2D")
49 .description(
"The direction of the anisotropic Gabor noise");
53 .description(
"The direction of the anisotropic Gabor noise");
55 "The Gabor noise value with both random intensity and phase. This is equal to sine the "
56 "phase multiplied by the intensity");
58 "The phase of the Gabor noise, which has no random intensity");
60 .
description(
"The intensity of the Gabor noise, which has no random phase");
101 const float type =
float(node_storage(*node).type);
112 static std::array<mf::Signature, 2> signatures{
122 mf::SignatureBuilder builder{
"GaborNoise",
signature};
124 builder.single_input<
float3>(
"Vector");
125 builder.single_input<
float>(
"Scale");
126 builder.single_input<
float>(
"Frequency");
127 builder.single_input<
float>(
"Anisotropy");
130 builder.single_input<
float>(
"Orientation");
133 builder.single_input<
float3>(
"Orientation");
136 builder.single_output<
float>(
"Value", mf::ParamFlag::SupportsUnusedOutput);
137 builder.single_output<
float>(
"Phase", mf::ParamFlag::SupportsUnusedOutput);
138 builder.single_output<
float>(
"Intensity", mf::ParamFlag::SupportsUnusedOutput);
164 r_value.
is_empty() ?
nullptr : &r_value[
i],
165 r_phase.is_empty() ?
nullptr : &r_phase[
i],
166 r_intensity.is_empty() ?
nullptr : &r_intensity[
i]);
178 r_value.
is_empty() ?
nullptr : &r_value[
i],
179 r_phase.is_empty() ?
nullptr : &r_phase[
i],
180 r_intensity.is_empty() ?
nullptr : &r_intensity[
i]);
211 ntype.
ui_name =
"Gabor Texture";
215 ntype.
declare = file_ns::sh_node_tex_gabor_declare;
216 ntype.
draw_buttons = file_ns::node_shader_buts_tex_gabor;
217 ntype.
initfunc = file_ns::node_shader_init_tex_gabor;
219 ntype.
gpu_fn = file_ns::node_shader_gpu_tex_gabor;
220 ntype.
updatefunc = file_ns::node_shader_update_tex_gabor;
223 node_register_type(ntype);
#define NODE_STORAGE_FUNCS(StorageT)
#define NODE_CLASS_TEXTURE
#define SH_NODE_TEX_GABOR
void BKE_texture_mapping_default(struct TexMapping *texmap, int type)
void BKE_texture_colormapping_default(struct ColorMapping *colormap)
@ NODE_DEFAULT_INPUT_POSITION_FIELD
bool GPU_stack_link(GPUMaterial *mat, const bNode *node, const char *name, GPUNodeStack *in, GPUNodeStack *out,...)
GPUNodeLink * GPU_constant(const float *num)
@ UI_ITEM_R_SPLIT_EMPTY_NAME
const Signature & signature() const
void set_signature(const Signature *signature)
void construct_and_set_matching_fn(Args &&...args)
ExecutionHints get_execution_hints() const override
GaborNoiseFunction(const NodeGaborType type)
static mf::Signature create_signature(const NodeGaborType type)
void call(const IndexMask &mask, mf::Params params, mf::Context) const override
void * MEM_callocN(size_t len, const char *str)
ccl_device_inline float2 mask(const MaskType mask, const float2 a)
bNodeSocket * node_find_socket(bNode &node, eNodeSocketInOut in_out, StringRef identifier)
void node_set_socket_availability(bNodeTree &ntree, bNodeSocket &sock, bool is_available)
static void build_multi_function(NodeMultiFunctionBuilder &builder)
static void node_shader_init_tex_gabor(bNodeTree *, bNode *node)
static void node_shader_buts_tex_gabor(uiLayout *layout, bContext *, PointerRNA *ptr)
static void node_shader_update_tex_gabor(bNodeTree *ntree, bNode *node)
static void sh_node_tex_gabor_declare(NodeDeclarationBuilder &b)
static int node_shader_gpu_tex_gabor(GPUMaterial *material, bNode *node, bNodeExecData *, GPUNodeStack *in, GPUNodeStack *out)
void gabor(const float2 coordinates, const float scale, const float frequency, const float anisotropy, const float orientation, float *r_value, float *r_phase, float *r_intensity)
VecBase< float, 3 > float3
void register_node_type_sh_tex_gabor()
void node_shader_gpu_tex_mapping(GPUMaterial *mat, bNode *node, GPUNodeStack *in, GPUNodeStack *)
void node_shader_gpu_default_tex_coord(GPUMaterial *mat, bNode *node, GPUNodeLink **link)
void common_node_type_base(blender::bke::bNodeType *ntype, std::string idname, const std::optional< int16_t > legacy_type)
void node_free_standard_storage(bNode *node)
void node_copy_standard_storage(bNodeTree *, bNode *dest_node, const bNode *src_node)
ColorMapping color_mapping
std::string ui_description
void(* initfunc)(bNodeTree *ntree, bNode *node)
NodeGPUExecFunction gpu_fn
NodeMultiFunctionBuildFunction build_multi_function
const char * enum_name_legacy
void(* draw_buttons)(uiLayout *, bContext *C, PointerRNA *ptr)
NodeDeclareFunction declare
void(* updatefunc)(bNodeTree *ntree, bNode *node)
void prop(PointerRNA *ptr, PropertyRNA *prop, int index, int value, eUI_Item_Flag flag, std::optional< blender::StringRef > name_opt, int icon, std::optional< blender::StringRef > placeholder=std::nullopt)