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.glsl4
1 files changed, 1 insertions, 3 deletions
diff --git a/source/blender/gpu/shaders/gpu_shader_material.glsl b/source/blender/gpu/shaders/gpu_shader_material.glsl
index 806bffea806..69e01882d50 100644
--- a/source/blender/gpu/shaders/gpu_shader_material.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_material.glsl
@@ -420,12 +420,10 @@ void math_fraction(float a, float b, out float result)
void math_modulo(float a, float b, out float result)
{
- result = (b != 0.0) ? mod(a, b) : 0.0;
-
/* Change sign to match C convention, mod in GLSL will take absolute for negative numbers.
* See https://www.opengl.org/sdk/docs/man/html/mod.xhtml
*/
- result = (a > 0.0) ? result : result - b;
+ result = (b != 0.0) ? sign(a) * mod(abs(a), b) : 0.0;
}
void math_sine(float a, float b, out float result)