45 switch (
node->custom1) {
92 if (in0 <= 1 && in0 >= -1) {
102 if (in0 <= 1 && in0 >= -1) {
117 out[0] =
pow(in0, in1);
120 float y_mod_1 = fmod(in1, 1);
121 if (y_mod_1 > 0.999f || y_mod_1 < 0.001f) {
132 if (in0 > 0 && in1 > 0) {
133 *out =
log(in0) /
log(in1);
159 *out = (in0 < 0) ? (
int)(in0 - 0.5f) : (
int)(in0 + 0.5f);
188 *out = fmod(in0, in1);
209 *out =
atan2(in0, in1);
250 *out = 1.0f /
sqrtf(in0);
273 *out =
floorf(in0 / in1) * in1;
280 *out =
wrapf(in0, in1, in2);
291 *out = (
fabsf(in0 - in1) <=
MAX2(in2, 1e-5f)) ? 1.0f : 0.0f;
297 *out = in0 * in1 + in2;
320 CLAMP(*out, 0.0f, 1.0f);
void node_type_socket_templates(struct bNodeType *ntype, struct bNodeSocketTemplate *inputs, struct bNodeSocketTemplate *outputs)
void node_type_update(struct bNodeType *ntype, void(*updatefunc)(struct bNodeTree *ntree, struct bNode *node))
#define NODE_CLASS_CONVERTOR
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))
void node_type_exec(struct bNodeType *ntype, NodeInitExecFunction init_exec_fn, NodeFreeExecFunction free_exec_fn, NodeExecFunction exec_fn)
void nodeRegisterType(struct bNodeType *ntype)
void node_type_label(struct bNodeType *ntype, void(*labelfunc)(struct bNodeTree *ntree, struct bNode *, char *label, int maxlen))
Group RGB to Bright Vector Camera CLAMP
MINLINE float smoothminf(float a, float b, float c)
MINLINE float pingpongf(float value, float scale)
MINLINE float compatible_signf(float f)
MINLINE float wrapf(float value, float max, float min)
INLINE Rall1d< T, V, S > pow(const Rall1d< T, V, S > &arg, double m)
INLINE Rall1d< T, V, S > log(const Rall1d< T, V, S > &arg)
INLINE Rall1d< T, V, S > atan(const Rall1d< T, V, S > &x)
INLINE Rall1d< T, V, S > atan2(const Rall1d< T, V, S > &y, const Rall1d< T, V, S > &x)
void register_node_type_tex_math(void)
static bNodeSocketTemplate outputs[]
static bNodeSocketTemplate inputs[]
static void exec(void *data, int UNUSED(thread), bNode *node, bNodeExecData *execdata, bNodeStack **in, bNodeStack **out)
static void valuefn(float *out, TexParams *p, bNode *node, bNodeStack **in, short thread)
void tex_node_type_base(struct bNodeType *ntype, int type, const char *name, short nclass, short flag)
float tex_input_value(bNodeStack *in, TexParams *params, short thread)
void tex_output(bNode *node, bNodeExecData *execdata, bNodeStack **in, bNodeStack *out, TexFn texfn, TexCallData *cdata)
void node_math_label(bNodeTree *UNUSED(ntree), bNode *node, char *label, int maxlen)
void node_math_update(bNodeTree *UNUSED(ntree), bNode *node)
Compact definition of a node socket.
ccl_device_inline float2 floor(const float2 &a)