17 b.add_input<
decl::Float>(
N_(
"Scale")).
min(-1000.0f).max(1000.0f).default_value(5.0f);
18 b.add_input<
decl::Float>(
N_(
"Distortion")).
min(-1000.0f).max(1000.0f).default_value(0.0f);
20 b.add_input<
decl::Float>(
N_(
"Detail Scale")).
min(-1000.0f).max(1000.0f).default_value(1.0f);
26 b.add_input<
decl::Float>(
N_(
"Phase Offset")).
min(-1000.0f).max(1000.0f).default_value(0.0f);
67 float wave_type =
tex->wave_type;
68 float bands_direction =
tex->bands_direction;
69 float rings_direction =
tex->rings_direction;
70 float wave_profile =
tex->wave_profile;
91 WaveFunction(
int wave_type,
int bands_direction,
int rings_direction,
int wave_profile)
92 : wave_type_(wave_type),
93 bands_direction_(bands_direction),
94 rings_direction_(rings_direction),
95 wave_profile_(wave_profile)
106 signature.single_input<
float>(
"Distortion");
108 signature.single_input<
float>(
"Detail Scale");
109 signature.single_input<
float>(
"Detail Roughness");
110 signature.single_input<
float>(
"Phase Offset");
123 const VArray<float> &droughness =
params.readonly_single_input<
float>(5,
"Detail Roughness");
134 p = (p + 0.000001f) * 0.999999f;
139 switch (wave_type_) {
141 switch (bands_direction_) {
152 n = (p.x + p.y + p.z) * 10.0f;
158 switch (rings_direction_) {
160 rp *=
float3(0.0f, 1.0f, 1.0f);
163 rp *=
float3(1.0f, 0.0f, 1.0f);
166 rp *=
float3(1.0f, 1.0f, 0.0f);
178 if (distortion[i] != 0.0f) {
183 switch (wave_profile_) {
199 if (!r_color.is_empty()) {
212 tex->wave_type,
tex->bands_direction,
tex->rings_direction,
tex->wave_profile);
void node_type_gpu(struct bNodeType *ntype, NodeGPUExecFunction gpu_fn)
void node_type_init(struct bNodeType *ntype, void(*initfunc)(struct bNodeTree *ntree, struct bNode *node))
void node_type_size_preset(struct bNodeType *ntype, eNodeSizePreset size)
void node_type_storage(struct bNodeType *ntype, const char *storagename, void(*freefunc)(struct bNode *node), void(*copyfunc)(struct bNodeTree *dest_ntree, struct bNode *dest_node, const struct bNode *src_node))
#define NODE_CLASS_TEXTURE
void nodeRegisterType(struct bNodeType *ntype)
void BKE_texture_mapping_default(struct TexMapping *texmap, int type)
void BKE_texture_colormapping_default(struct ColorMapping *colormap)
MINLINE float len_v3(const float a[3]) ATTR_WARN_UNUSED_RESULT
@ SHD_WAVE_BANDS_DIRECTION_Y
@ SHD_WAVE_BANDS_DIRECTION_X
@ SHD_WAVE_BANDS_DIRECTION_Z
@ SHD_WAVE_BANDS_DIRECTION_DIAGONAL
@ SHD_WAVE_RINGS_DIRECTION_Z
@ SHD_WAVE_RINGS_DIRECTION_Y
@ SHD_WAVE_RINGS_DIRECTION_X
@ SHD_WAVE_RINGS_DIRECTION_SPHERICAL
#define TEXMAP_TYPE_POINT
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum type
GPUNodeLink * GPU_constant(const float *num)
bool GPU_stack_link(GPUMaterial *mat, struct bNode *node, const char *name, GPUNodeStack *in, GPUNodeStack *out,...)
in reality light always falls off quadratically Particle Retrieve the data of the particle that spawned the object for example to give variation to multiple instances of an object Point Retrieve information about points in a point cloud Retrieve the edges of an object as it appears to Cycles topology will always appear triangulated Convert a blackbody temperature to an RGB value Normal Generate a perturbed normal from an RGB normal map image Typically used for faking highly detailed surfaces Generate an OSL shader from a file or text data block Image Sample an image file as a texture Sky Generate a procedural sky texture Noise Generate fractal Perlin noise SH_NODE_TEX_WAVE
@ UI_ITEM_R_SPLIT_EMPTY_NAME
void uiItemR(uiLayout *layout, struct PointerRNA *ptr, const char *propname, int flag, const char *name, int icon)
void set_signature(const MFSignature *signature)
const MFSignature & signature() const
void construct_and_set_matching_fn(Args &&...args)
static fn::MFSignature create_signature()
WaveFunction(int wave_type, int bands_direction, int rings_direction, int wave_profile)
void call(IndexMask mask, fn::MFParams params, fn::MFContext UNUSED(context)) const override
ccl_device_inline float4 mask(const int4 &mask, const float4 &a)
static void sh_node_wave_tex_build_multi_function(NodeMultiFunctionBuilder &builder)
static void node_shader_buts_tex_wave(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
static int node_shader_gpu_tex_wave(GPUMaterial *mat, bNode *node, bNodeExecData *UNUSED(execdata), GPUNodeStack *in, GPUNodeStack *out)
static void sh_node_tex_wave_declare(NodeDeclarationBuilder &b)
static void node_shader_init_tex_wave(bNodeTree *UNUSED(ntree), bNode *node)
float perlin_fractal(float position, float octaves, float roughness)
vec_base< float, 3 > float3
ColorSceneLinear4f< eAlpha::Premultiplied > ColorGeometry4f
static const pxr::TfToken out("out", pxr::TfToken::Immortal)
static const pxr::TfToken b("b", pxr::TfToken::Immortal)
void register_node_type_sh_tex_wave()
void node_shader_gpu_tex_mapping(GPUMaterial *mat, bNode *node, GPUNodeStack *in, GPUNodeStack *UNUSED(out))
void node_shader_gpu_default_tex_coord(GPUMaterial *mat, bNode *node, GPUNodeLink **link)
void sh_fn_node_type_base(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)
void node_free_standard_storage(bNode *node)
int RNA_enum_get(PointerRNA *ptr, const char *name)
void(* draw_buttons)(struct uiLayout *, struct bContext *C, struct PointerRNA *ptr)
NodeMultiFunctionBuildFunction build_multi_function
NodeDeclareFunction declare