diff options
author | Charlie Jolly <charlie> | 2020-02-19 04:03:43 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2020-02-19 04:27:36 +0300 |
commit | eef5b506d5ce5086ab7e91cb243f2d387e60d9c4 (patch) | |
tree | 5f14ed695aa6ff9e59c9c854d1083d9b6e46c3c2 /source/blender/nodes | |
parent | e82827bf6ed54a1d1552ac9176df9e309b4d29e2 (diff) |
EEVEE: Color Ramp Ease Optimisation
This patch provides an optimisation for Ease (Smoothstep) setting in the color ramp node.
This optimisation exists already for Constant and Linear modes.
Reviewed By: fclem
Differential Revision: https://developer.blender.org/D6880
Diffstat (limited to 'source/blender/nodes')
-rw-r--r-- | source/blender/nodes/shader/nodes/node_shader_valToRgb.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/source/blender/nodes/shader/nodes/node_shader_valToRgb.c b/source/blender/nodes/shader/nodes/node_shader_valToRgb.c index 6d2611626c2..37b2516713c 100644 --- a/source/blender/nodes/shader/nodes/node_shader_valToRgb.c +++ b/source/blender/nodes/shader/nodes/node_shader_valToRgb.c @@ -94,6 +94,17 @@ static int gpu_shader_valtorgb(GPUMaterial *mat, GPU_uniform(&mul_bias[1]), GPU_uniform(&coba->data[0].r), GPU_uniform(&coba->data[1].r)); + case COLBAND_INTERP_EASE: + mul_bias[0] = 1.0f / (coba->data[1].pos - coba->data[0].pos); + mul_bias[1] = -mul_bias[0] * coba->data[0].pos; + return GPU_stack_link(mat, + node, + "valtorgb_opti_ease", + in, + out, + GPU_uniform(mul_bias), + GPU_uniform(&coba->data[0].r), + GPU_uniform(&coba->data[1].r)); default: break; } |