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:
authorThomas Dinges <blender@dingto.org>2013-05-20 18:38:47 +0400
committerThomas Dinges <blender@dingto.org>2013-05-20 18:38:47 +0400
commit38dc85f296a27a5641d296c8f41834db41dac18b (patch)
treeb47567b3c6fd455a6a92b359fc92509ff33e85fb /source/blender/gpu
parent0fb5c9117fdb9ad24184a2dad2ad1c8c66565aaa (diff)
Math Node:
* Added a Modulo operation to the math node, available in Compositor, Shader and Texture Nodes.
Diffstat (limited to 'source/blender/gpu')
-rw-r--r--source/blender/gpu/shaders/gpu_shader_material.glsl8
1 files changed, 8 insertions, 0 deletions
diff --git a/source/blender/gpu/shaders/gpu_shader_material.glsl b/source/blender/gpu/shaders/gpu_shader_material.glsl
index fd519a86fc9..3a68b79d154 100644
--- a/source/blender/gpu/shaders/gpu_shader_material.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_material.glsl
@@ -279,6 +279,14 @@ void math_greater_than(float val1, float val2, out float outval)
outval = 0.0;
}
+void math_modulo(float val1, float val2, out float outval)
+{
+ if (val2 == 0.0)
+ outval = 0.0;
+ else
+ outval = mod(val1, val2);
+}
+
void squeeze(float val, float width, float center, out float outval)
{
outval = 1.0/(1.0 + pow(2.71828183, -((val-center)*width)));