Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/nodes')
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_valToRgb.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/source/blender/nodes/shader/nodes/node_shader_valToRgb.c b/source/blender/nodes/shader/nodes/node_shader_valToRgb.c
index 00940b5acaf..5f583e1e29b 100644
--- a/source/blender/nodes/shader/nodes/node_shader_valToRgb.c
+++ b/source/blender/nodes/shader/nodes/node_shader_valToRgb.c
@@ -65,12 +65,19 @@ static void node_shader_init_valtorgb(bNodeTree *UNUSED(ntree), bNode *node)
static int gpu_shader_valtorgb(GPUMaterial *mat, bNode *node, bNodeExecData *UNUSED(execdata), GPUNodeStack *in, GPUNodeStack *out)
{
+ struct ColorBand *coba = node->storage;
float *array, layer;
int size;
- BKE_colorband_evaluate_table_rgba(node->storage, &array, &size);
+ BKE_colorband_evaluate_table_rgba(coba, &array, &size);
GPUNodeLink *tex = GPU_texture_ramp(mat, size, array, &layer);
- return GPU_stack_link(mat, node, "valtorgb", in, out, tex, GPU_uniform(&layer));
+
+ if (coba->ipotype == COLBAND_INTERP_CONSTANT) {
+ return GPU_stack_link(mat, node, "valtorgb_nearest", in, out, tex, GPU_uniform(&layer));
+ }
+ else {
+ return GPU_stack_link(mat, node, "valtorgb", in, out, tex, GPU_uniform(&layer));
+ }
}
void register_node_type_sh_valtorgb(void)