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/material/gpu_shader_material_vector_curves.glsl')
-rw-r--r--source/blender/gpu/shaders/material/gpu_shader_material_vector_curves.glsl8
1 files changed, 8 insertions, 0 deletions
diff --git a/source/blender/gpu/shaders/material/gpu_shader_material_vector_curves.glsl b/source/blender/gpu/shaders/material/gpu_shader_material_vector_curves.glsl
new file mode 100644
index 00000000000..35d2e903cf4
--- /dev/null
+++ b/source/blender/gpu/shaders/material/gpu_shader_material_vector_curves.glsl
@@ -0,0 +1,8 @@
+void curves_vec(float fac, vec3 vec, sampler1DArray curvemap, float layer, out vec3 outvec)
+{
+ vec4 co = vec4(vec * 0.5 + 0.5, layer);
+ outvec.x = texture(curvemap, co.xw).x;
+ outvec.y = texture(curvemap, co.yw).y;
+ outvec.z = texture(curvemap, co.zw).z;
+ outvec = mix(vec, outvec, fac);
+}