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:
authorCharlie Jolly <charlie>2020-02-19 04:03:43 +0300
committerClément Foucault <foucault.clem@gmail.com>2020-02-19 04:27:36 +0300
commiteef5b506d5ce5086ab7e91cb243f2d387e60d9c4 (patch)
tree5f14ed695aa6ff9e59c9c854d1083d9b6e46c3c2 /source/blender/gpu
parente82827bf6ed54a1d1552ac9176df9e309b4d29e2 (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/gpu')
-rw-r--r--source/blender/gpu/shaders/material/gpu_shader_material_color_ramp.glsl9
1 files changed, 9 insertions, 0 deletions
diff --git a/source/blender/gpu/shaders/material/gpu_shader_material_color_ramp.glsl b/source/blender/gpu/shaders/material/gpu_shader_material_color_ramp.glsl
index 9fe45f91f45..17240da4050 100644
--- a/source/blender/gpu/shaders/material/gpu_shader_material_color_ramp.glsl
+++ b/source/blender/gpu/shaders/material/gpu_shader_material_color_ramp.glsl
@@ -13,6 +13,15 @@ void valtorgb_opti_linear(
outalpha = outcol.a;
}
+void valtorgb_opti_ease(
+ float fac, vec2 mulbias, vec4 color1, vec4 color2, out vec4 outcol, out float outalpha)
+{
+ fac = clamp(fac * mulbias.x + mulbias.y, 0.0, 1.0);
+ fac = fac * fac * (3.0 - 2.0 * fac);
+ outcol = mix(color1, color2, fac);
+ outalpha = outcol.a;
+}
+
void valtorgb(float fac, sampler1DArray colormap, float layer, out vec4 outcol, out float outalpha)
{
outcol = texture(colormap, vec2(fac, layer));