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/gpu/shaders/gpu_shader_material.glsl')
-rw-r--r--source/blender/gpu/shaders/gpu_shader_material.glsl6
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/gpu/shaders/gpu_shader_material.glsl b/source/blender/gpu/shaders/gpu_shader_material.glsl
index 91104fe51bd..40aba1cc004 100644
--- a/source/blender/gpu/shaders/gpu_shader_material.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_material.glsl
@@ -818,6 +818,12 @@ void valtorgb(float fac, sampler1DArray colormap, float layer, out vec4 outcol,
outalpha = outcol.a;
}
+void valtorgb_nearest(float fac, sampler1DArray colormap, float layer, out vec4 outcol, out float outalpha)
+{
+ outcol = texelFetch(colormap, ivec2(fac * textureSize(colormap, 0).x, layer), 0);
+ outalpha = outcol.a;
+}
+
void rgbtobw(vec4 color, out float outval)
{
vec3 factors = vec3(0.2126, 0.7152, 0.0722);