[Bf-blender-cvs] [d9be59e872f] master: Fix T68687 Eevee: Modulo node behaves unexpectedly/inconsistently

Clément Foucault noreply at git.blender.org
Tue Aug 27 01:50:06 CEST 2019


Commit: d9be59e872f8a112f31b73f07fe41efb51a08ad9
Author: Clément Foucault
Date:   Tue Aug 27 01:49:36 2019 +0200
Branches: master
https://developer.blender.org/rBd9be59e872f8a112f31b73f07fe41efb51a08ad9

Fix T68687 Eevee: Modulo node behaves unexpectedly/inconsistently

This was a regression.

===================================================================

M	source/blender/gpu/shaders/gpu_shader_material.glsl

===================================================================

diff --git a/source/blender/gpu/shaders/gpu_shader_material.glsl b/source/blender/gpu/shaders/gpu_shader_material.glsl
index 57061ad1628..6f5d9b92b8e 100644
--- a/source/blender/gpu/shaders/gpu_shader_material.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_material.glsl
@@ -346,7 +346,7 @@ void math_fraction(float a, float b, out float result)
  */
 void math_modulo(float a, float b, out float result)
 {
-  result = (b != 0.0) ? sign(a) * mod(abs(a), b) : 0.0;
+  result = (b != 0.0 && a != b) ? sign(a) * mod(abs(a), b) : 0.0;
 }
 
 void math_sine(float a, float b, out float result)



More information about the Bf-blender-cvs mailing list