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");
70 NodeTexGabor *storage = MEM_cnew<NodeTexGabor>(__func__);
76 node->storage = storage;
101 const float type =
float(node_storage(*node).type);
112 static std::array<mf::Signature, 2> signatures{
124 builder.single_input<
float3>(
"Vector");
125 builder.single_input<
float>(
"Scale");
126 builder.single_input<
float>(
"Frequency");
127 builder.single_input<
float>(
"Anistropy");
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);
158 mask.foreach_index([&](
const int64_t i) {
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]);
172 mask.foreach_index([&](
const int64_t 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.
declare = file_ns::sh_node_tex_gabor_declare;
212 ntype.
draw_buttons = file_ns::node_shader_buts_tex_gabor;
213 ntype.
initfunc = file_ns::node_shader_init_tex_gabor;
216 ntype.
gpu_fn = file_ns::node_shader_gpu_tex_gabor;
217 ntype.
updatefunc = file_ns::node_shader_update_tex_gabor;
220 node_register_type(&ntype);
#define SH_NODE_TEX_GABOR
#define NODE_STORAGE_FUNCS(StorageT)
#define NODE_CLASS_TEXTURE
void BKE_texture_mapping_default(struct TexMapping *texmap, int type)
void BKE_texture_colormapping_default(struct ColorMapping *colormap)
bool GPU_stack_link(GPUMaterial *mat, const bNode *node, const char *name, GPUNodeStack *in, GPUNodeStack *out,...)
GPUNodeLink * GPU_constant(const float *num)
void uiItemR(uiLayout *layout, PointerRNA *ptr, const char *propname, eUI_Item_Flag flag, const char *name, int icon)
@ 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
local_group_size(16, 16) .push_constant(Type b
draw_view in_light_buf[] float
void node_set_socket_availability(bNodeTree *ntree, bNodeSocket *sock, bool is_available)
bNodeSocket * node_find_socket(bNode *node, eNodeSocketInOut in_out, StringRef identifier)
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)
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 sh_fn_node_type_base(blender::bke::bNodeType *ntype, int type, const char *name, short nclass)
void node_free_standard_storage(bNode *node)
void node_copy_standard_storage(bNodeTree *, bNode *dest_node, const bNode *src_node)
ColorMapping color_mapping
void(* initfunc)(bNodeTree *ntree, bNode *node)
NodeGPUExecFunction gpu_fn
NodeMultiFunctionBuildFunction build_multi_function
void(* draw_buttons)(uiLayout *, bContext *C, PointerRNA *ptr)
NodeDeclareFunction declare
void(* updatefunc)(bNodeTree *ntree, bNode *node)