27 if (fac != 0 && (
hue != 0.5f || sat != 1 || val != 1)) {
28 float col[3], hsv[3], mfac = 1.0f - fac;
30 rgb_to_hsv(in[0], in[1], in[2], hsv, hsv + 1, hsv + 2);
31 hsv[0] += (
hue - 0.5f);
35 else if (hsv[0] < 0.0f) {
42 else if (hsv[1] < 0.0f) {
49 else if (hsv[2] < 0.0f) {
54 out[0] = mfac * in[0] + fac *
col[0];
55 out[1] = mfac * in[1] + fac *
col[1];
56 out[2] = mfac * in[2] + fac *
col[2];
void node_type_socket_templates(struct bNodeType *ntype, struct bNodeSocketTemplate *inputs, struct bNodeSocketTemplate *outputs)
void node_type_size_preset(struct bNodeType *ntype, eNodeSizePreset size)
#define NODE_CLASS_OP_COLOR
void node_type_exec(struct bNodeType *ntype, NodeInitExecFunction init_exec_fn, NodeFreeExecFunction free_exec_fn, NodeExecFunction exec_fn)
void nodeRegisterType(struct bNodeType *ntype)
void rgb_to_hsv(float r, float g, float b, float *r_h, float *r_s, float *r_v)
void hsv_to_rgb(float h, float s, float v, float *r_r, float *r_g, float *r_b)
MINLINE void copy_v4_v4(float r[4], const float a[4])
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 Wave Generate procedural bands or rings with noise Voronoi Generate Worley noise based on the distance to random points Typically used to generate textures such as or biological cells Brick Generate a procedural texture producing bricks Texture Retrieve multiple types of texture coordinates nTypically used as inputs for texture nodes Vector Convert a or normal between and object coordinate space Combine Create a color from its hue
static const pxr::TfToken out("out", pxr::TfToken::Immortal)
static bNodeSocketTemplate outputs[]
static void do_hue_sat_fac(bNode *UNUSED(node), float *out, float hue, float sat, float val, float *in, float fac)
static bNodeSocketTemplate inputs[]
static void exec(void *data, int UNUSED(thread), bNode *node, bNodeExecData *execdata, bNodeStack **in, bNodeStack **out)
static void colorfn(float *out, TexParams *p, bNode *node, bNodeStack **in, short thread)
void register_node_type_tex_hue_sat(void)
float tex_input_value(bNodeStack *in, TexParams *params, short thread)
void tex_input_rgba(float *out, bNodeStack *in, TexParams *params, short thread)
void tex_node_type_base(struct bNodeType *ntype, int type, const char *name, short nclass)
void tex_output(bNode *node, bNodeExecData *execdata, bNodeStack **in, bNodeStack *out, TexFn texfn, TexCallData *cdata)
Compact definition of a node socket.