diff options
author | Campbell Barton <ideasman42@gmail.com> | 2009-11-09 19:00:12 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2009-11-09 19:00:12 +0300 |
commit | 196ecb7babad8cb865e405e6f696c1c2cfaefdbd (patch) | |
tree | 039395e62f38134ea287ff5fe582e2f2a7da5d22 /source/blender/nodes/intern/SHD_nodes | |
parent | ded68d81d891942305c69d60f5c515e9ddd63b46 (diff) |
material shader curve factor (same as compo node)
Diffstat (limited to 'source/blender/nodes/intern/SHD_nodes')
-rw-r--r-- | source/blender/nodes/intern/SHD_nodes/SHD_curves.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/source/blender/nodes/intern/SHD_nodes/SHD_curves.c b/source/blender/nodes/intern/SHD_nodes/SHD_curves.c index d277547b636..511a6a6566d 100644 --- a/source/blender/nodes/intern/SHD_nodes/SHD_curves.c +++ b/source/blender/nodes/intern/SHD_nodes/SHD_curves.c @@ -32,6 +32,7 @@ /* **************** CURVE VEC ******************** */ static bNodeSocketType sh_node_curve_vec_in[]= { + { SOCK_VALUE, 0, "Fac", 1.0f, 0.0f, 1.0f, 1.0f, 0.0f, 1.0f}, { SOCK_VECTOR, 1, "Vector", 0.0f, 0.0f, 0.0f, 1.0f, -1.0f, 1.0f}, { -1, 0, "" } }; @@ -47,7 +48,7 @@ static void node_shader_exec_curve_vec(void *data, bNode *node, bNodeStack **in, /* stack order input: vec */ /* stack order output: vec */ - nodestack_get_vec(vec, SOCK_VECTOR, in[0]); + nodestack_get_vec(vec, SOCK_VECTOR, in[1]); curvemapping_evaluate3F(node->storage, out[0]->vec, vec); } @@ -86,6 +87,7 @@ bNodeType sh_node_curve_vec= { /* **************** CURVE RGB ******************** */ static bNodeSocketType sh_node_curve_rgb_in[]= { + { SOCK_VALUE, 1, "Fac", 1.0f, 0.0f, 0.0f, 1.0f, -1.0f, 1.0f}, { SOCK_RGBA, 1, "Color", 0.0f, 0.0f, 0.0f, 1.0f, -1.0f, 1.0f}, { -1, 0, "" } }; @@ -101,8 +103,11 @@ static void node_shader_exec_curve_rgb(void *data, bNode *node, bNodeStack **in, /* stack order input: vec */ /* stack order output: vec */ - nodestack_get_vec(vec, SOCK_VECTOR, in[0]); + nodestack_get_vec(vec, SOCK_VECTOR, in[1]); curvemapping_evaluateRGBF(node->storage, out[0]->vec, vec); + if(in[0]->vec[0] != 1.0f) { + VecLerpf(out[0]->vec, vec, out[0]->vec, *in[0]->vec); + } } static void node_shader_init_curve_rgb(bNode *node) @@ -114,7 +119,6 @@ static int gpu_shader_curve_rgb(GPUMaterial *mat, bNode *node, GPUNodeStack *in, { float *array; int size; - curvemapping_table_RGBA(node->storage, &array, &size); return GPU_stack_link(mat, "curves_rgb", in, out, GPU_texture(size, array)); } |